From b7a79dac5d18244df43f72295c719c742114ffc4 Mon Sep 17 00:00:00 2001 From: Rafa Gould <50337143+rafa-gould@users.noreply.github.com> Date: Tue, 7 May 2019 13:53:55 -0400 Subject: [PATCH 001/189] Created Korean Translations --- locale/ko.po | 2570 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2570 insertions(+) create mode 100644 locale/ko.po diff --git a/locale/ko.po b/locale/ko.po new file mode 100644 index 0000000000..ef6dcd1c38 --- /dev/null +++ b/locale/ko.po @@ -0,0 +1,2570 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# 글라파, 2019. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-04-17 11:24-0700\n" +"PO-Revision-Date: 2019-05-06 14:22-0700\n" +"Last-Translator: \n" +"Language-Team: LANGUAGE \n" +"Language: ko\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: main.c +msgid "" +"\n" +"Code done running. Waiting for reload.\n" +msgstr "" +"\n" +"실행 완료 코드. 재장전 을 기다리는 중입니다.\n" + +#: py/obj.c +msgid " File \"%q\"" +msgstr " 파일 \"%q\"" + +#: py/obj.c +msgid " File \"%q\", line %d" +msgstr " 파일 \"%q\", 라인 %d" + +#: main.c +msgid " output:\n" +msgstr " 산출:\n" + +#: py/objstr.c +#, c-format +msgid "%%c requires int or char" +msgstr "%%c int또는 char필요합니다" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q in use" +msgstr "%q 사용 중입니다" + +#: py/obj.c +msgid "%q index out of range" +msgstr "%q 인덱스 범위를 벗어났습니다" + +#: py/obj.c +msgid "%q indices must be integers, not %s" +msgstr "%q 인덱스는 %s 가 아닌 정수 여야합니다" + +#: shared-bindings/bleio/CharacteristicBuffer.c +#: shared-bindings/displayio/Group.c shared-bindings/displayio/Shape.c +msgid "%q must be >= 1" +msgstr "%q 는 >=1이어야합니다" + +#: shared-bindings/fontio/BuiltinFont.c +msgid "%q should be an int" +msgstr "%q 는 정수 여야합니다" + +#: py/bc.c py/objnamedtuple.c +msgid "%q() takes %d positional arguments but %d were given" +msgstr "" + +#: py/argcheck.c +msgid "'%q' argument required" +msgstr "" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects a label" +msgstr "'%s' 에는 라벨이 필요합니다" + +#: py/emitinlinethumb.c py/emitinlinextensa.c +#, c-format +msgid "'%s' expects a register" +msgstr "'%s%' 에는 레지스터가 필요합니다" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects a special register" +msgstr "'%s' 에는 특별한 레지스터가 필요합니다" + +#: py/emitinlinethumb.c +#, c-format +msgid "'%s' expects an FPU register" +msgstr "'%s' 에는 FPU레지스터가 필요합니다" + +#: 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 "'%s' 는 정수 여야합니다" + +#: 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/obj.c +#, c-format +msgid "'%s' object does not support item assignment" +msgstr "'%s' 을 지정할 수 없습니다" + +#: py/obj.c +#, c-format +msgid "'%s' object does not support item deletion" +msgstr "'%s' 은 삭제할 수 없습니다" + +#: py/runtime.c +msgid "'%s' object has no attribute '%q'" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "'%s' object is not an iterator" +msgstr "'%s' 은 수정할 수 없습니다" + +#: py/objtype.c py/runtime.c +#, c-format +msgid "'%s' object is not callable" +msgstr "'%s' 을 검색 할 수 없습니다" + +#: py/runtime.c +#, c-format +msgid "'%s' object is not iterable" +msgstr "'%s' 은 변경할 수 없습니다" + +#: py/obj.c +#, c-format +msgid "'%s' object is not subscriptable" +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 "'align' 에는 1 개의 독립변수가 필요합니다" + +#: py/compile.c +msgid "'await' outside function" +msgstr "'await' 는 펑크션 외부에 있습니다" + +#: py/compile.c +msgid "'break' outside loop" +msgstr "'break' 는 루프 외부에 있습니다" + +#: py/compile.c +msgid "'continue' outside loop" +msgstr "'continue' 는 루프 외부에 있습니다" + +#: py/compile.c +msgid "'data' requires at least 2 arguments" +msgstr "'data' 에는 >=2 개의 독립변수가 필요합니다" + +#: py/compile.c +msgid "'data' requires integer arguments" +msgstr "" + +#: py/compile.c +msgid "'label' requires 1 argument" +msgstr "'label' 에는 1 개의 독립변수가 필요합니다" + +#: py/compile.c +msgid "'return' outside function" +msgstr "'return' 는 함수 외부에 존재합니다" + +#: py/compile.c +msgid "'yield' outside function" +msgstr "'yield' 는 함수 외부에 존재합니다" + +#: py/compile.c +msgid "*x must be assignment target" +msgstr "" + +#: py/obj.c +msgid ", in %q\n" +msgstr ", 에서 %q\n" + +#: py/objcomplex.c +msgid "0.0 to a complex power" +msgstr "" + +#: py/modbuiltins.c +msgid "3-arg pow() not supported" +msgstr "" + +#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c +msgid "A hardware interrupt channel is already in use" +msgstr "" + +#: shared-bindings/bleio/Address.c +#, c-format +msgid "Address is not %d bytes long or is in wrong format" +msgstr "" + +#: shared-bindings/bleio/Address.c +#, c-format +msgid "Address must be %d bytes long" +msgstr "" + +#: ports/nrf/common-hal/busio/I2C.c +msgid "All I2C peripherals are in use" +msgstr "사용중인 모든 I2C주변 기기" + +#: ports/nrf/common-hal/busio/SPI.c +msgid "All SPI peripherals are in use" +msgstr "사용중인 모든 SPI주변 기기" + +#: ports/nrf/common-hal/busio/UART.c +msgid "All UART peripherals are in use" +msgstr "사용중인 모든 UART주변 기기" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "All event channels 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/pulseio/PWMOut.c +msgid "All timers for this pin are in use" +msgstr "핀의 모든 타이머가 사용 중입니다" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c +#: shared-module/_pew/PewPew.c +msgid "All timers in use" +msgstr "모든 타이머가 사용 중입니다" + +#: ports/nrf/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 +msgid "Another send is already active" +msgstr "" + +#: shared-bindings/pulseio/PulseOut.c +msgid "Array must contain halfwords (type 'H')" +msgstr "" + +#: shared-bindings/nvm/ByteArray.c +msgid "Array values should be single bytes." +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Attempted heap allocation when MicroPython VM not running.\n" +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 "" +"자동 새로 고침이 켜져 있습니다. USB를 통해 파일을 저장하여 실행하십시오. 비활성화하려면 " +"REPL을 입력하십시오" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Bit clock and word select must share a clock unit" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Bit depth must be multiple of 8." +msgstr "" + +#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c +msgid "Both pins must support hardware interrupts" +msgstr "" + +#: shared-bindings/supervisor/__init__.c +msgid "Brightness must be between 0 and 255" +msgstr "밝기는 0에서 255 사이 여야합니다" + +#: shared-bindings/displayio/Display.c +msgid "Brightness not adjustable" +msgstr "밝기를 조절할 수 없습니다" + +#: shared-module/usb_hid/Device.c +#, c-format +msgid "Buffer incorrect size. Should be %d bytes." +msgstr "잘못된 크기의 버퍼. %d 바이트 여야합니다." + +#: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c +msgid "Buffer must be at least length 1" +msgstr "잘못된 크기의 버퍼. >1 바이트 여야합니다." + +#: ports/atmel-samd/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 "잘못된 크기의 버퍼. 16 바이트 여야합니다." + +#: shared-bindings/nvm/ByteArray.c +msgid "Bytes must be between 0 and 255." +msgstr "바이트는 0에서 255 사이 여야합니다." + +#: shared-bindings/_pixelbuf/PixelBuf.c +#, c-format +msgid "Can not use dotstar with %s" +msgstr "" + +#: shared-bindings/bleio/Device.c +msgid "Can't add services in Central mode" +msgstr "" + +#: shared-bindings/bleio/Device.c +msgid "Can't advertise in Central mode" +msgstr "" + +#: shared-bindings/bleio/Device.c +msgid "Can't change the name in Central mode" +msgstr "" + +#: shared-bindings/bleio/Device.c +msgid "Can't connect in Peripheral mode" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c +msgid "Cannot delete values" +msgstr "" + +#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c +#: ports/nrf/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 "온도 데이터를 수신 할 수 없습니다" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "Cannot output both channels on the same pin" +msgstr "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot read without MISO pin." +msgstr "MISO핀이 없으면 읽을 수 없습니다" + +#: 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 +msgid "Cannot reset into bootloader because no bootloader is present." +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Cannot set value when direction is input." +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 "" + +#: shared-module/bitbangio/SPI.c +msgid "Cannot write without MOSI pin." +msgstr "" + +#: shared-bindings/bleio/Service.c +msgid "Characteristic UUID doesn't match Service UUID" +msgstr "" + +#: ports/nrf/common-hal/bleio/Service.c +msgid "Characteristic already in use by another Service." +msgstr "" + +#: shared-bindings/bleio/CharacteristicBuffer.c +msgid "CharacteristicBuffer writing not provided" +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/ParallelBus.c +msgid "Command must be an int between 0 and 255" +msgstr "명령은 0에서 255 사이의 int 여야합니다" + +#: ports/nrf/common-hal/bleio/UUID.c +#, c-format +msgid "Could not decode ble_uuid, err 0x%04x" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +msgid "Could not initialize UART" +msgstr "" + +#: shared-module/audioio/Mixer.c shared-module/audioio/WaveFile.c +msgid "Couldn't allocate first buffer" +msgstr "" + +#: shared-module/audioio/Mixer.c shared-module/audioio/WaveFile.c +msgid "Couldn't allocate second buffer" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "Crash into the HardFault_Handler.\n" +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 "" + +#: shared-module/audioio/WaveFile.c +msgid "Data chunk must follow fmt chunk" +msgstr "" + +#: ports/nrf/common-hal/bleio/Broadcaster.c +#: ports/nrf/common-hal/bleio/Peripheral.c +msgid "Data too large for advertisement packet" +msgstr "" + +#: ports/nrf/common-hal/bleio/Device.c +msgid "Data too large for the advertisement packet" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Destination capacity is smaller than destination_length." +msgstr "" + +#: shared-bindings/displayio/Display.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 "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "EXTINT channel already in use" +msgstr "" + +#: extmod/modure.c +msgid "Error in regex" +msgstr "" + +#: shared-bindings/microcontroller/Pin.c +#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c +#: shared-bindings/terminalio/Terminal.c +msgid "Expected a %q" +msgstr "%q 이 예상되었습니다." + +#: shared-bindings/bleio/CharacteristicBuffer.c +msgid "Expected a Characteristic" +msgstr "Characteristic이 예상되었습니다." + +#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Descriptor.c +#: shared-bindings/bleio/Service.c +msgid "Expected a UUID" +msgstr "UUID이 예상되었습니다." + +#: shared-module/_pixelbuf/PixelBuf.c +#, c-format +msgid "Expected tuple of length %d, got %d" +msgstr "" + +#: ports/nrf/common-hal/bleio/Device.c +msgid "Failed to acquire mutex" +msgstr "" + +#: ports/nrf/common-hal/bleio/Characteristic.c ports/nrf/sd_mutex.c +#, c-format +msgid "Failed to acquire mutex, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Service.c +#, c-format +msgid "Failed to add characteristic, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Device.c +msgid "Failed to add service" +msgstr "" + +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to add service, err 0x%04x" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +msgid "Failed to allocate RX buffer" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +#, c-format +msgid "Failed to allocate RX buffer of %d bytes" +msgstr "" + +#: ports/nrf/common-hal/bleio/Adapter.c +msgid "Failed to change softdevice state" +msgstr "" + +#: ports/nrf/common-hal/bleio/Device.c +msgid "Failed to connect:" +msgstr "" + +#: ports/nrf/common-hal/bleio/Device.c +msgid "Failed to continue scanning" +msgstr "" + +#: ports/nrf/common-hal/bleio/Scanner.c +#, c-format +msgid "Failed to continue scanning, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Device.c +msgid "Failed to create mutex" +msgstr "" + +#: ports/nrf/common-hal/bleio/Device.c +msgid "Failed to discover services" +msgstr "" + +#: ports/nrf/common-hal/bleio/Adapter.c +msgid "Failed to get local address" +msgstr "" + +#: ports/nrf/common-hal/bleio/Adapter.c +msgid "Failed to get softdevice state" +msgstr "" + +#: ports/nrf/common-hal/bleio/Characteristic.c +#, c-format +msgid "Failed to notify or indicate attribute value, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Characteristic.c +#, c-format +msgid "Failed to read CCCD value, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Characteristic.c +#, c-format +msgid "Failed to read attribute value, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Characteristic.c +#, c-format +msgid "Failed to read gatts value, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/UUID.c +#, c-format +msgid "Failed to register Vendor-Specific UUID, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Device.c +msgid "Failed to release mutex" +msgstr "" + +#: ports/nrf/common-hal/bleio/Characteristic.c ports/nrf/sd_mutex.c +#, c-format +msgid "Failed to release mutex, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Device.c +msgid "Failed to start advertising" +msgstr "" + +#: ports/nrf/common-hal/bleio/Broadcaster.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to start advertising, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Device.c +msgid "Failed to start scanning" +msgstr "" + +#: ports/nrf/common-hal/bleio/Scanner.c +#, c-format +msgid "Failed to start scanning, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Device.c +msgid "Failed to stop advertising" +msgstr "" + +#: ports/nrf/common-hal/bleio/Broadcaster.c +#: ports/nrf/common-hal/bleio/Peripheral.c +#, c-format +msgid "Failed to stop advertising, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Characteristic.c +#, c-format +msgid "Failed to write attribute value, err 0x%04x" +msgstr "" + +#: ports/nrf/common-hal/bleio/Characteristic.c +#, c-format +msgid "Failed to write gatts value, err 0x%04x" +msgstr "" + +#: py/moduerrno.c +msgid "File exists" +msgstr "" + +#: ports/nrf/peripherals/nrf/nvm.c +msgid "Flash erase failed" +msgstr "" + +#: ports/nrf/peripherals/nrf/nvm.c +#, c-format +msgid "Flash erase failed to start, err 0x%04x" +msgstr "" + +#: ports/nrf/peripherals/nrf/nvm.c +msgid "Flash write failed" +msgstr "" + +#: ports/nrf/peripherals/nrf/nvm.c +#, c-format +msgid "Flash write failed to start, err 0x%04x" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +msgid "Frequency captured is above capability. Capture Paused." +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 "" + +#: shared-module/displayio/Group.c +msgid "Group full" +msgstr "" + +#: extmod/vfs_posix_file.c py/objstringio.c +msgid "I/O operation on closed file" +msgstr "" + +#: extmod/machine_i2c.c +msgid "I2C operation not supported" +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 "" + +#: py/moduerrno.c +msgid "Input/output error" +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Invalid %q pin" +msgstr "" + +#: shared-module/displayio/OnDiskBitmap.c +msgid "Invalid BMP file" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PWMOut.c +#: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c +msgid "Invalid PWM frequency" +msgstr "" + +#: py/moduerrno.c +msgid "Invalid argument" +msgstr "" + +#: shared-module/displayio/Bitmap.c +msgid "Invalid bits per value" +msgstr "" + +#: ports/nrf/common-hal/busio/UART.c +msgid "Invalid buffer size" +msgstr "" + +#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +msgid "Invalid capture period. Valid range: 1 - 500" +msgstr "" + +#: shared-bindings/audioio/Mixer.c +msgid "Invalid channel count" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Invalid direction." +msgstr "" + +#: shared-module/audioio/WaveFile.c +msgid "Invalid file" +msgstr "" + +#: shared-module/audioio/WaveFile.c +msgid "Invalid format chunk size" +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 +msgid "Invalid phase" +msgstr "" + +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: shared-bindings/pulseio/PWMOut.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/i2cslave/I2CSlave.c +#: ports/nrf/common-hal/busio/I2C.c +msgid "Invalid pins" +msgstr "" + +#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c +msgid "Invalid polarity" +msgstr "" + +#: shared-bindings/microcontroller/__init__.c +msgid "Invalid run mode." +msgstr "" + +#: shared-bindings/audioio/Mixer.c +msgid "Invalid voice count" +msgstr "" + +#: shared-module/audioio/WaveFile.c +msgid "Invalid wave file" +msgstr "" + +#: py/compile.c +msgid "LHS of keyword arg must be an id" +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 "" + +#: supervisor/shared/safe_mode.c +msgid "" +"Looks like our core CircuitPython code crashed hard. Whoops!\n" +"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" +" with the contents of your CIRCUITPY drive and this message:\n" +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 "" + +#: supervisor/shared/safe_mode.c +msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "MicroPython fatal error.\n" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Microphone startup delay must be in range 0.0 to 1.0" +msgstr "" + +#: shared-bindings/displayio/Display.c +msgid "Must be a Group subclass." +msgstr "" + +#: ports/atmel-samd/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 +msgid "No DMA channel found" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +msgid "No RX pin" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/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/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/frequencyio/FrequencyIn.c +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +msgid "No hardware support on pin" +msgstr "" + +#: py/moduerrno.c +msgid "No space left on device" +msgstr "" + +#: py/moduerrno.c +msgid "No such file/directory" +msgstr "" + +#: shared-bindings/bleio/CharacteristicBuffer.c +msgid "Not connected" +msgstr "" + +#: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c +msgid "Not playing" +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 +msgid "Only 8 or 16 bit mono with " +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 8bpp, and 16bpp or greater BMPs supported: %d bpp " +"given" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "Only slices with step=1 (aka None) are supported" +msgstr "" + +#: shared-bindings/audiobusio/PDMIn.c +msgid "Oversample must be multiple of 8." +msgstr "" + +#: shared-bindings/pulseio/PWMOut.c +msgid "" +"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +msgstr "" + +#: shared-bindings/pulseio/PWMOut.c +msgid "" +"PWM frequency not writable when variable_frequency is False on construction." +msgstr "" + +#: py/moduerrno.c +msgid "Permission denied" +msgstr "" + +#: ports/atmel-samd/common-hal/analogio/AnalogIn.c +#: ports/nrf/common-hal/analogio/AnalogIn.c +msgid "Pin does not have ADC capabilities" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "Pixel beyond bounds of buffer" +msgstr "" + +#: py/builtinhelp.c +msgid "Plus any modules on the filesystem\n" +msgstr "" + +#: main.c +msgid "Press any key to enter the REPL. Use CTRL-D to reload." +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Pull not used when direction is output." +msgstr "" + +#: ports/nrf/common-hal/rtc/RTC.c +msgid "RTC calibration is not supported on this board" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "RTC is not supported on this board" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "Range out of bounds" +msgstr "" + +#: 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/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! Auto-reload is off.\n" +msgstr "" + +#: main.c +msgid "Running in safe mode! Not running saved code.\n" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c +msgid "SDA or SCL needs a pull up" +msgstr "" + +#: shared-bindings/audioio/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/atmel-samd/common-hal/audiobusio/I2SOut.c +#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c +msgid "Serializer in use" +msgstr "" + +#: 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/pulseio/PulseIn.c +msgid "Slices not supported" +msgstr "" + +#: ports/nrf/common-hal/bleio/Adapter.c +#, c-format +msgid "Soft device assert, id: 0x%08lX, pc: 0x%08lX" +msgstr "" + +#: extmod/modure.c +msgid "Splitting with sub-captures" +msgstr "" + +#: shared-bindings/supervisor/__init__.c +msgid "Stack size must be at least 256" +msgstr "" + +#: shared-bindings/multiterminal/__init__.c +msgid "Stream missing readinto() or write() method." +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The CircuitPython heap was corrupted because the stack was too small.\n" +"Please increase stack size limits and press reset (after ejecting " +"CIRCUITPY).\n" +"If you didn't change the stack, then file an issue here with the contents of " +"your CIRCUITPY drive:\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The microcontroller's power dipped. Please make sure your power supply " +"provides\n" +"enough power for the whole circuit and press reset (after ejecting " +"CIRCUITPY).\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"The reset button was pressed while booting CircuitPython. Press again to " +"exit safe mode.\n" +msgstr "" + +#: shared-module/audioio/Mixer.c +msgid "The sample's bits_per_sample does not match the mixer's" +msgstr "" + +#: shared-module/audioio/Mixer.c +msgid "The sample's channel count does not match the mixer's" +msgstr "" + +#: shared-module/audioio/Mixer.c +msgid "The sample's sample rate does not match the mixer's" +msgstr "" + +#: shared-module/audioio/Mixer.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 +msgid "Tile indices must be 0 - 255" +msgstr "" + +#: shared-bindings/displayio/TileGrid.c +msgid "Tile width must exactly divide bitmap width" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "To exit, please reset the board without " +msgstr "" + +#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample." +msgstr "" + +#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/ParallelBus.c +msgid "Too many display busses" +msgstr "" + +#: shared-bindings/displayio/Display.c +msgid "Too many displays" +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 "" + +#: 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 not in range 0 to 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 +msgid "Unable to allocate buffers for signed conversion" +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 "" + +#: ports/nrf/common-hal/bleio/UUID.c +msgid "Unexpected nrfx uuid type" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +#, c-format +msgid "Unmatched number of items on RHS (expected %d, got %d)." +msgstr "" + +#: ports/atmel-samd/common-hal/busio/I2C.c +msgid "Unsupported baudrate" +msgstr "" + +#: shared-module/displayio/Display.c +msgid "Unsupported display bus type" +msgstr "" + +#: shared-module/audioio/WaveFile.c +msgid "Unsupported format" +msgstr "" + +#: py/moduerrno.c +msgid "Unsupported operation" +msgstr "" + +#: shared-bindings/digitalio/DigitalInOut.c +msgid "Unsupported pull value." +msgstr "" + +#: py/emitnative.c +msgid "Viper functions don't currently support more than 4 arguments" +msgstr "" + +#: shared-module/audioio/Mixer.c +msgid "Voice index too high" +msgstr "" + +#: main.c +msgid "WARNING: Your code filename has two extensions\n" +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 "" + +#: supervisor/shared/safe_mode.c +msgid "" +"You are running in safe mode which means 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 +#, c-format +msgid "__init__() should return None, not '%s'" +msgstr "" + +#: py/objobject.c +msgid "__new__ arg must be a user-type" +msgstr "" + +#: extmod/modubinascii.c extmod/moduhashlib.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/i2cslave/I2CSlave.c +msgid "address out of bounds" +msgstr "" + +#: shared-bindings/i2cslave/I2CSlave.c +msgid "addresses is empty" +msgstr "" + +#: py/modbuiltins.c +msgid "arg is an empty sequence" +msgstr "" + +#: py/runtime.c +msgid "argument has wrong type" +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 "" + +#: py/objarray.c shared-bindings/nvm/ByteArray.c +msgid "array/bytes required on right side" +msgstr "" + +#: py/objstr.c +msgid "attributes not supported yet" +msgstr "" + +#: ports/nrf/common-hal/bleio/Characteristic.c +msgid "bad GATT role" +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 +msgid "bad typecode" +msgstr "" + +#: py/emitnative.c +msgid "binary op %q not implemented" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "bits must be 7, 8 or 9" +msgstr "" + +#: extmod/machine_spi.c +msgid "bits must be 8" +msgstr "" + +#: shared-bindings/audioio/Mixer.c +msgid "bits_per_sample must be 8 or 16" +msgstr "" + +#: py/emitinlinethumb.c +msgid "branch not in range" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +#, c-format +msgid "buf is too small. need %d bytes" +msgstr "" + +#: shared-bindings/audioio/RawSample.c +msgid "buffer must be a bytes-like object" +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 "" + +#: extmod/machine_spi.c +msgid "buffers must be the same length" +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 +#, c-format +msgid "byteorder is not an instance of ByteOrder (got a %s)" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c +msgid "bytes > 8 bits not supported" +msgstr "" + +#: py/objstr.c +msgid "bytes value out of range" +msgstr "" + +#: ports/atmel-samd/bindings/samd/Clock.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 +#, c-format +msgid "can't convert %s to complex" +msgstr "" + +#: py/obj.c +#, c-format +msgid "can't convert %s to float" +msgstr "" + +#: py/obj.c +#, c-format +msgid "can't convert %s to int" +msgstr "" + +#: py/objstr.c +msgid "can't convert '%q' object to %q implicitly" +msgstr "" + +#: py/objint.c +msgid "can't convert NaN to int" +msgstr "" + +#: shared-bindings/i2cslave/I2CSlave.c +msgid "can't convert address to int" +msgstr "" + +#: py/objint.c +msgid "can't convert inf to int" +msgstr "" + +#: py/obj.c +msgid "can't convert to complex" +msgstr "" + +#: py/obj.c +msgid "can't convert to float" +msgstr "" + +#: py/obj.c +msgid "can't convert to int" +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 "" + +#: 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 "" + +#: 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/bleio/Service.c +msgid "characteristics includes an object that is not a Characteristic" +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-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 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 "" + +#: py/parsenum.c +msgid "decimal numbers not supported" +msgstr "" + +#: py/compile.c +msgid "default 'except' must be last" +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 "" + +#: 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 "" + +#: ports/nrf/common-hal/busio/UART.c +#, c-format +msgid "error = 0x%08lX" +msgstr "" + +#: py/runtime.c +msgid "exceptions must derive from BaseException" +msgstr "" + +#: py/objstr.c +msgid "expected ':' after format specifier" +msgstr "':'이 예상되었습니다" + +#: py/obj.c +msgid "expected tuple/list" +msgstr "튜플(tuple) 또는 리스트(list)이 예상되었습니다" + +#: py/modthread.c +msgid "expecting a dict for keyword args" +msgstr "사전(dict)이 예상되었습니다" + +#: 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 "" + +#: py/argcheck.c +msgid "extra keyword arguments given" +msgstr "" + +#: py/argcheck.c +msgid "extra positional arguments given" +msgstr "" + +#: shared-bindings/audioio/WaveFile.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 "" + +#: py/objtype.c +msgid "first argument to super() must be type" +msgstr "" + +#: extmod/machine_spi.c +msgid "firstbit must be MSB" +msgstr "" + +#: py/objint.c +msgid "float too big" +msgstr "float이 너무 큽니다" + +#: 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 "완전한(full)" + +#: 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 "" + +#: 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 +#, 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 "" + +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c +msgid "index out of range" +msgstr "" + +#: py/obj.c +msgid "indices must be integers" +msgstr "" + +#: py/compile.c +msgid "inline assembler must be a function" +msgstr "" + +#: py/parsenum.c +msgid "int() arg 2 must be >= 2 and <= 36" +msgstr "" + +#: py/objstr.c +msgid "integer required" +msgstr "정수(int)가 필요합니다." + +#: ports/nrf/common-hal/bleio/Broadcaster.c +msgid "interval not in range 0.0020 to 10.24" +msgstr "" + +#: extmod/machine_i2c.c +msgid "invalid I2C peripheral" +msgstr "ICT주변 기기가 유효하지 않습니다." + +#: extmod/machine_spi.c +msgid "invalid SPI peripheral" +msgstr "SPI주변 기기가 유효하지 않습니다." + +#: lib/netutils/netutils.c +msgid "invalid arguments" +msgstr "" + +#: extmod/modussl_axtls.c +msgid "invalid cert" +msgstr "cert가 유효하지 않습니다." + +#: extmod/uos_dupterm.c +msgid "invalid dupterm index" +msgstr "Dupterm index가 유효하지 않습니다" + +#: extmod/modframebuf.c +msgid "invalid format" +msgstr "형식가 유효하지 않습니다" + +#: py/objstr.c +msgid "invalid format specifier" +msgstr "형식 지정자(format specifier)가 유효하지 않습니다" + +#: 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 "단계(step)가 유효하지 않습니다" + +#: py/compile.c py/parse.c +msgid "invalid syntax" +msgstr "구문(syntax)가 유효하지 않습니다" + +#: py/parsenum.c +msgid "invalid syntax for integer" +msgstr "" + +#: py/parsenum.c +#, c-format +msgid "invalid syntax for integer with base %d" +msgstr "구문(syntax)가 정수(int)가 유효하지 않습니다." + +#: py/parsenum.c +msgid "invalid syntax for number" +msgstr "숫자에 대한 구문(syntax)가 유효하지 않습니다." + +#: 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 "" + +#: 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 "" + +#: 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 "" + +#: shared-bindings/_stage/Layer.c +msgid "map buffer too small" +msgstr "" + +#: py/modmath.c shared-bindings/math/__init__.c +msgid "math domain error" +msgstr "" + +#: py/runtime.c +msgid "maximum recursion depth exceeded" +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/builtinimport.c +msgid "module not found" +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 "" + +#: extmod/machine_spi.c +msgid "must specify all of sck/mosi/miso" +msgstr "" + +#: py/modbuiltins.c +msgid "must use keyword argument for key function" +msgstr "" + +#: py/runtime.c +msgid "name '%q' is not defined" +msgstr "" + +#: shared-bindings/bleio/Peripheral.c +msgid "name must be a string" +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 "" + +#: 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 "" + +#: py/builtinimport.c +msgid "no module named '%q'" +msgstr "" + +#: py/runtime.c shared-bindings/_pixelbuf/__init__.c +msgid "no such attribute" +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 "" + +#: 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 "" + +#: py/obj.c +#, c-format +msgid "object '%s' 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 +msgid "object not in sequence" +msgstr "" + +#: py/runtime.c +msgid "object not iterable" +msgstr "" + +#: py/obj.c +#, c-format +msgid "object of type '%s' has no len()" +msgstr "" + +#: py/obj.c +msgid "object with buffer protocol required" +msgstr "" + +#: extmod/modubinascii.c +msgid "odd-length string" +msgstr "" + +#: py/objstr.c py/objstrunicode.c +msgid "offset out of bounds" +msgstr "" + +#: py/objarray.c py/objstr.c py/objstrunicode.c py/objtuple.c +#: shared-bindings/nvm/ByteArray.c +msgid "only slices with step=1 (aka None) are supported" +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 "" + +#: py/objint_mpz.c +msgid "overflow converting long int to machine word" +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 +msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter" +msgstr "" + +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c +msgid "pop from an empty PulseIn" +msgstr "" + +#: py/objset.c +msgid "pop from an empty set" +msgstr "" + +#: py/objlist.c +msgid "pop from empty list" +msgstr "" + +#: py/objdict.c +msgid "popitem(): dictionary is empty" +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 "" + +#: extmod/modutimeq.c +msgid "queue overflow" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "rawbuf is not the same size as buf" +msgstr "" + +#: shared-bindings/_pixelbuf/__init__.c +msgid "readonly attribute" +msgstr "" + +#: py/builtinimport.c +msgid "relative import" +msgstr "" + +#: py/obj.c +#, c-format +msgid "requested length %d but object has length %d" +msgstr "" + +#: py/compile.c +msgid "return annotation must be an identifier" +msgstr "" + +#: py/emitnative.c +msgid "return expected '%q' but got '%q'" +msgstr "" + +#: py/objstr.c +msgid "rsplit(None,n)" +msgstr "" + +#: shared-bindings/audioio/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 +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 "" + +#: shared-bindings/bleio/Peripheral.c +msgid "services includes an object that is not a Service" +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 "" + +#: shared-bindings/time/__init__.c +msgid "sleep length must be non-negative" +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 "" + +#: 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 index out of range" +msgstr "" + +#: py/objstrunicode.c +#, c-format +msgid "string indices must be integers, not %s" +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: index out of range" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: no fields" +msgstr "" + +#: 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/displayio/TileGrid.c +msgid "tile index out of bounds" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "time.struct_time() takes a 9-sequence" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "time.struct_time() takes exactly 1 argument" +msgstr "" + +#: shared-bindings/busio/UART.c +msgid "timeout >100 (units are now seconds, not msecs)" +msgstr "" + +#: shared-bindings/bleio/CharacteristicBuffer.c +msgid "timeout must be >= 0.0" +msgstr "" + +#: shared-bindings/time/__init__.c +msgid "timestamp out of range for platform time_t" +msgstr "" + +#: shared-module/struct/__init__.c +msgid "too many arguments provided with the given format" +msgstr "" + +#: py/runtime.c +#, c-format +msgid "too many values to unpack (expected %d)" +msgstr "" + +#: py/objstr.c +msgid "tuple index out of range" +msgstr "" + +#: py/obj.c +msgid "tuple/list has wrong length" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "tuple/list required on RHS" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.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/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 +#, c-format +msgid "unknown format code '%c' for object of type '%s'" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "unknown format code '%c' for object of type 'float'" +msgstr "" + +#: py/objstr.c +#, c-format +msgid "unknown format code '%c' for object of type 'str'" +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 +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: '%s'" +msgstr "" + +#: py/runtime.c +msgid "unsupported type for operator" +msgstr "" + +#: py/runtime.c +msgid "unsupported types for %q: '%s', '%s'" +msgstr "" + +#: shared-bindings/displayio/Bitmap.c +msgid "value_count must be > 0" +msgstr "" + +#: shared-bindings/_pixelbuf/PixelBuf.c +msgid "write_args must be a list, tuple, or None" +msgstr "" + +#: py/objstr.c +msgid "wrong number of arguments" +msgstr "" + +#: py/runtime.c +msgid "wrong number of values to unpack" +msgstr "" + +#: shared-module/displayio/Shape.c +msgid "x value out of bounds" +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 "" From 54b4a20ca21e0674d87c4e289ca9f93977ed6993 Mon Sep 17 00:00:00 2001 From: Rafa Gould Date: Wed, 8 May 2019 14:57:15 -0400 Subject: [PATCH 003/189] added translations --- locale/ko.po | 86 ++++++++++++++++++++++++++-------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/locale/ko.po b/locale/ko.po index ef6dcd1c38..13a4ae9e16 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -23,7 +23,7 @@ msgid "" "Code done running. Waiting for reload.\n" msgstr "" "\n" -"실행 완료 코드. 재장전 을 기다리는 중입니다.\n" +"실행 완료 코드. 재장전 을 기다리는 중입니다\n" #: py/obj.c msgid " File \"%q\"" @@ -40,7 +40,7 @@ msgstr " 산출:\n" #: py/objstr.c #, c-format msgid "%%c requires int or char" -msgstr "%%c int또는 char필요합니다" +msgstr "%%c 전수(int)또는 캐릭터(char)필요합니다" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" @@ -61,7 +61,7 @@ msgstr "%q 는 >=1이어야합니다" #: shared-bindings/fontio/BuiltinFont.c msgid "%q should be an int" -msgstr "%q 는 정수 여야합니다" +msgstr "%q 는 정수(int) 여야합니다" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" @@ -109,7 +109,7 @@ msgstr "" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects {r0, r1, ...}" -msgstr "" +msgstr "'%s' {r0, r1, ...}은 을 기대합니다" #: py/emitinlinextensa.c #, c-format @@ -299,7 +299,7 @@ msgid "" "disable.\n" msgstr "" "자동 새로 고침이 켜져 있습니다. USB를 통해 파일을 저장하여 실행하십시오. 비활성화하려면 " -"REPL을 입력하십시오" +"REPL을 입력하십시오.\n" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" @@ -328,7 +328,7 @@ msgstr "잘못된 크기의 버퍼. %d 바이트 여야합니다." #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" -msgstr "잘못된 크기의 버퍼. >1 바이트 여야합니다." +msgstr "잘못된 크기의 버퍼. >1 여야합니다" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c @@ -351,15 +351,15 @@ msgstr "" #: shared-bindings/bleio/Device.c msgid "Can't add services in Central mode" -msgstr "" +msgstr "센트랄(중앙) 모드에서는 서비스를 추가 할 수 없습니다" #: shared-bindings/bleio/Device.c msgid "Can't advertise in Central mode" -msgstr "" +msgstr "센트랄(중앙) 모드로 광고 (브로드 캐스트) 할 수 없습니다" #: shared-bindings/bleio/Device.c msgid "Can't change the name in Central mode" -msgstr "" +msgstr "센트랄(중앙) 모드에서는 이름을 변경할 수 없습니다" #: shared-bindings/bleio/Device.c msgid "Can't connect in Peripheral mode" @@ -367,7 +367,7 @@ msgstr "" #: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" -msgstr "" +msgstr "값을 삭제할 수 없습니다" #: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c #: ports/nrf/common-hal/digitalio/DigitalInOut.c @@ -448,7 +448,7 @@ msgstr "" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/ParallelBus.c msgid "Command must be an int between 0 and 255" -msgstr "명령은 0에서 255 사이의 int 여야합니다" +msgstr "명령은 0에서 255 사이의 정수(int) 여야합니다" #: ports/nrf/common-hal/bleio/UUID.c #, c-format @@ -473,7 +473,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" -msgstr "" +msgstr "DAC가 현재 사용 중입니다" #: ports/atmel-samd/common-hal/displayio/ParallelBus.c #: ports/nrf/common-hal/displayio/ParallelBus.c @@ -487,11 +487,11 @@ msgstr "" #: ports/nrf/common-hal/bleio/Broadcaster.c #: ports/nrf/common-hal/bleio/Peripheral.c msgid "Data too large for advertisement packet" -msgstr "" +msgstr "광고 (브로드 캐스트) 패킷에 대한 데이터가 너무 큽니다" #: ports/nrf/common-hal/bleio/Device.c msgid "Data too large for the advertisement packet" -msgstr "" +msgstr "광고 (브로드 캐스트) 패킷에 대한 데이터가 너무 큽니다" #: shared-bindings/audiobusio/PDMIn.c msgid "Destination capacity is smaller than destination_length." @@ -512,7 +512,7 @@ msgstr "" #: extmod/modure.c msgid "Error in regex" -msgstr "" +msgstr "Regex에 오류가 있습니다." #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c @@ -522,7 +522,7 @@ msgstr "%q 이 예상되었습니다." #: shared-bindings/bleio/CharacteristicBuffer.c msgid "Expected a Characteristic" -msgstr "Characteristic이 예상되었습니다." +msgstr "특성(Characteristic)이 예상되었습니다." #: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Descriptor.c #: shared-bindings/bleio/Service.c @@ -550,12 +550,12 @@ msgstr "" #: ports/nrf/common-hal/bleio/Device.c msgid "Failed to add service" -msgstr "" +msgstr "서비스를 추가하지 못했습니다" #: ports/nrf/common-hal/bleio/Peripheral.c #, c-format msgid "Failed to add service, err 0x%04x" -msgstr "" +msgstr "서비스를 추가하지 못했습니다., 오류 0x%04x" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" @@ -573,16 +573,16 @@ msgstr "" #: ports/nrf/common-hal/bleio/Device.c msgid "Failed to connect:" -msgstr "" +msgstr 연결할 수 없다"" #: ports/nrf/common-hal/bleio/Device.c msgid "Failed to continue scanning" -msgstr "" +msgstr "스캔을 계속할 수 없습니다" #: ports/nrf/common-hal/bleio/Scanner.c #, c-format msgid "Failed to continue scanning, err 0x%04x" -msgstr "" +msgstr "스캔을 계속할 수 없습니다, 오류 0x%04x" #: ports/nrf/common-hal/bleio/Device.c msgid "Failed to create mutex" @@ -770,33 +770,33 @@ msgstr "" #: shared-module/audioio/WaveFile.c msgid "Invalid file" -msgstr "" +msgstr "파일이 유효하지 않습니다" #: shared-module/audioio/WaveFile.c msgid "Invalid format chunk size" -msgstr "" +msgstr "형식 청크 크기가 잘못되었습니다" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid number of bits" -msgstr "" +msgstr "비트 수가 유효하지 않습니다" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid phase" -msgstr "" +msgstr "단계가 잘못되었습니다" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c #: shared-bindings/pulseio/PWMOut.c msgid "Invalid pin" -msgstr "" +msgstr "핀이 잘못되었습니다" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Invalid pin for left channel" -msgstr "" +msgstr "왼쪽 채널 핀이 유효하지 않습니다" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Invalid pin for right channel" -msgstr "" +msgstr "오른쪽 채널 핀이 잘못되었습니다" #: ports/atmel-samd/common-hal/busio/I2C.c #: ports/atmel-samd/common-hal/busio/SPI.c @@ -804,7 +804,7 @@ msgstr "" #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c #: ports/nrf/common-hal/busio/I2C.c msgid "Invalid pins" -msgstr "" +msgstr "핀이 유효하지 않습니다" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid polarity" @@ -832,7 +832,7 @@ msgstr "" #: py/objslice.c msgid "Length must be an int" -msgstr "" +msgstr "길이는 정수(int) 여야합니다" #: py/objslice.c msgid "Length must be non-negative" @@ -1170,11 +1170,11 @@ msgstr "" #: shared-bindings/bleio/UUID.c msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" -msgstr "" +msgstr "UUID문자열이 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'형식이 아닙니다" #: shared-bindings/bleio/UUID.c msgid "UUID value is not str, int or byte buffer" -msgstr "" +msgstr "UUID값이 문자열(str), 정수(int) 또는 바이트버퍼가(byte buffer) 아닙니다" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -1188,7 +1188,7 @@ msgstr "" #: py/parse.c msgid "Unable to init parser" -msgstr "" +msgstr "파서를 초기화(init) 할 수 없습니다" #: shared-module/displayio/OnDiskBitmap.c msgid "Unable to read color palette data" @@ -1343,15 +1343,15 @@ msgstr "" #: shared-bindings/busio/UART.c msgid "bits must be 7, 8 or 9" -msgstr "" +msgstr "비트(bits)는 7, 8 또는 9 여야합니다" #: extmod/machine_spi.c msgid "bits must be 8" -msgstr "" +msgstr "비트(bits)는 8이어야합니다" #: shared-bindings/audioio/Mixer.c msgid "bits_per_sample must be 8 or 16" -msgstr "" +msgstr "bits_per_sample은 8 또는 16이어야합니다." #: py/emitinlinethumb.c msgid "branch not in range" @@ -1851,7 +1851,7 @@ msgstr "" #: py/objstr.c msgid "integer required" -msgstr "정수(int)가 필요합니다." +msgstr "정수가 필요합니다" #: ports/nrf/common-hal/bleio/Broadcaster.c msgid "interval not in range 0.0020 to 10.24" @@ -1859,11 +1859,11 @@ msgstr "" #: extmod/machine_i2c.c msgid "invalid I2C peripheral" -msgstr "ICT주변 기기가 유효하지 않습니다." +msgstr "ICT주변 기기가 유효하지 않습니다" #: extmod/machine_spi.c msgid "invalid SPI peripheral" -msgstr "SPI주변 기기가 유효하지 않습니다." +msgstr "SPI주변 기기가 유효하지 않습니다" #: lib/netutils/netutils.c msgid "invalid arguments" @@ -1871,7 +1871,7 @@ msgstr "" #: extmod/modussl_axtls.c msgid "invalid cert" -msgstr "cert가 유효하지 않습니다." +msgstr "cert가 유효하지 않습니다" #: extmod/uos_dupterm.c msgid "invalid dupterm index" @@ -1903,16 +1903,16 @@ msgstr "구문(syntax)가 유효하지 않습니다" #: py/parsenum.c msgid "invalid syntax for integer" -msgstr "" +msgstr "구문(syntax)가 정수가 유효하지 않습니다" #: py/parsenum.c #, c-format msgid "invalid syntax for integer with base %d" -msgstr "구문(syntax)가 정수(int)가 유효하지 않습니다." +msgstr "구문(syntax)가 정수가 유효하지 않습니다" #: py/parsenum.c msgid "invalid syntax for number" -msgstr "숫자에 대한 구문(syntax)가 유효하지 않습니다." +msgstr "숫자에 대한 구문(syntax)가 유효하지 않습니다" #: py/objtype.c msgid "issubclass() arg 1 must be a class" From c542663a33f608e0a5aeded3c6e3abda575ca3e8 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Mon, 5 Aug 2019 18:30:53 -0700 Subject: [PATCH 004/189] Fix quotes --- locale/ko.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/ko.po b/locale/ko.po index 13a4ae9e16..6405892621 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -573,7 +573,7 @@ msgstr "" #: ports/nrf/common-hal/bleio/Device.c msgid "Failed to connect:" -msgstr 연결할 수 없다"" +msgstr "연결할 수 없다" #: ports/nrf/common-hal/bleio/Device.c msgid "Failed to continue scanning" From a0877b3d0c8a5fcd6788b299bf510e46bb9cab38 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 6 Aug 2019 07:33:44 -0500 Subject: [PATCH 005/189] Update ko.po This fixes two additional problems, a missing newline and an incorrect character set definition. However, the build process still fails locally during "makeqstrdata" --- locale/ko.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locale/ko.po b/locale/ko.po index 6405892621..b3b52c2e29 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -14,7 +14,7 @@ msgstr "" "Language-Team: LANGUAGE \n" "Language: ko\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: main.c @@ -291,7 +291,7 @@ msgstr "" #: main.c msgid "Auto-reload is off.\n" -msgstr "자동 재 장전이 꺼져 있습니다" +msgstr "자동 재 장전이 꺼져 있습니다\n" #: main.c msgid "" From 51901f7de02675d3cae0ba57ece7b464f9479767 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Fri, 4 Oct 2019 11:42:38 -0400 Subject: [PATCH 006/189] Add peripheral definitions --- ports/stm32f4/common-hal/busio/UART.c | 23 ++++++++++++- ports/stm32f4/common-hal/busio/UART.h | 4 +-- ports/stm32f4/peripherals/stm32f4/periph.h | 31 ++++++++++++++--- .../peripherals/stm32f4/stm32f405xx/periph.c | 34 +++++++++++++++++++ .../peripherals/stm32f4/stm32f405xx/periph.h | 7 ++++ 5 files changed, 91 insertions(+), 8 deletions(-) diff --git a/ports/stm32f4/common-hal/busio/UART.c b/ports/stm32f4/common-hal/busio/UART.c index e1810b131e..d353592bf4 100644 --- a/ports/stm32f4/common-hal/busio/UART.c +++ b/ports/stm32f4/common-hal/busio/UART.c @@ -41,7 +41,28 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, mp_float_t timeout, uint16_t receiver_buffer_size) { - mp_raise_NotImplementedError(translate("UART not yet supported")); + + GPIO_InitStruct.Pin = pin_mask(10)|pin_mask(11); + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF7_USART3; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + __HAL_RCC_USART2_CLK_ENABLE(); + + huart2.Instance = USART2; + huart2.Init.BaudRate = 115200; + huart2.Init.WordLength = UART_WORDLENGTH_8B; + huart2.Init.StopBits = UART_STOPBITS_1; + huart2.Init.Parity = UART_PARITY_NONE; + huart2.Init.Mode = UART_MODE_TX_RX; + huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE; + huart2.Init.OverSampling = UART_OVERSAMPLING_16; + if (HAL_UART_Init(&huart2) != HAL_OK) + { + mp_raise_NotImplementedError(translate("UART explode")); + } } bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { diff --git a/ports/stm32f4/common-hal/busio/UART.h b/ports/stm32f4/common-hal/busio/UART.h index 6992339340..8a4b554c4a 100644 --- a/ports/stm32f4/common-hal/busio/UART.h +++ b/ports/stm32f4/common-hal/busio/UART.h @@ -33,8 +33,8 @@ typedef struct { mp_obj_base_t base; - uint8_t rx_pin; - uint8_t tx_pin; + const mcu_uart_tx_obj_t *tx; + const mcu_uart_rx_obj_t *rx; uint8_t character_bits; bool rx_error; uint32_t baudrate; diff --git a/ports/stm32f4/peripherals/stm32f4/periph.h b/ports/stm32f4/peripherals/stm32f4/periph.h index 06ab2d3e4f..c24d205862 100644 --- a/ports/stm32f4/peripherals/stm32f4/periph.h +++ b/ports/stm32f4/peripherals/stm32f4/periph.h @@ -34,8 +34,8 @@ #include "stm32f4/pins.h" // I2C -//TODO: these objects should be condensed into a single 'periph_pin' unless we -//find a compelling reason to store more unique data in them. +// TODO: these objects should be condensed into a single 'periph_pin' unless we +// find a compelling reason to store more unique data in them. typedef struct { uint8_t i2c_index:4; // Index of the I2C unit (1 to 3) @@ -65,8 +65,8 @@ typedef struct { } // SPI -//TODO: these objects should be condensed into a single 'periph_pin' unless we -//find a compelling reason to store more unique data in them. +// TODO: these objects should be condensed into a single 'periph_pin' unless we +// find a compelling reason to store more unique data in them. typedef struct { uint8_t spi_index:4; //Up to 6 SPI units @@ -99,7 +99,28 @@ typedef struct { .pin = spi_pin, \ } -// TODO: SPI, UART, etc +// UART +// TODO: these objects should be condensed into a single 'periph_pin' unless we +// find a compelling reason to store more unique data in them. + +typedef struct { + uint8_t uart_index:4; + uint8_t altfn_index:4; + const mcu_pin_obj_t * pin; +} mcu_uart_tx_obj_t; + +typedef struct { + uint8_t uart_index:4; + uint8_t altfn_index:4; + const mcu_pin_obj_t * pin; +} mcu_uart_rx_obj_t; + +#define UART(index, alt, uart_pin) \ +{ \ + .uart_index = index, \ + .altfn_index = alt, \ + .pin = uart_pin, \ +} // Choose based on chip #ifdef STM32F412Zx diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.c b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.c index 7b0a54e55e..c1c78b3bf8 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.c +++ b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.c @@ -85,4 +85,38 @@ const mcu_spi_nss_obj_t mcu_spi_nss_list[6] = { SPI(3, 6, &pin_PA04), SPI(3, 6, &pin_PA15), }; + +USART_TypeDef * mcu_uart_banks[6] = {USART1, USART2, USART3, UART4, UART5, USART6}; +bool mcu_uart_has_usart[6] = {true, true, true, false, false, true}; + +const mcu_uart_tx_obj_t mcu_uart_tx_list[12] = { + UART(4, 8, &pin_PA00), + UART(2, 7, &pin_PA02), + UART(1, 7, &pin_PA09), + UART(1, 7, &pin_PB06), + UART(3, 7, &pin_PB10), + UART(6, 8, &pin_PC06), + UART(3, 7, &pin_PC10), + UART(4, 8, &pin_PC10), + UART(5, 8, &pin_PC12), + UART(2, 7, &pin_PD05), + UART(3, 7, &pin_PD08), + UART(6, 8, &pin_PG14), +}; + +const mcu_uart_rx_obj_t mcu_uart_rx_list[12] = { + UART(4, 8, &pin_PA01), + UART(2, 7, &pin_PA03), + UART(1, 7, &pin_PA10), + UART(1, 7, &pin_PB07), + UART(3, 7, &pin_PB11), + UART(6, 8, &pin_PC07), + UART(3, 7, &pin_PC11), + UART(4, 8, &pin_PC11), + UART(5, 8, &pin_PD02), + UART(2, 7, &pin_PD06), + UART(3, 7, &pin_PD09), + UART(6, 8, &pin_PG09), +}; + //UART, Etc diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.h b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.h index cb9b33f6eb..6737720266 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.h +++ b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.h @@ -41,5 +41,12 @@ extern const mcu_spi_mosi_obj_t mcu_spi_mosi_list[6]; extern const mcu_spi_miso_obj_t mcu_spi_miso_list[6]; extern const mcu_spi_nss_obj_t mcu_spi_nss_list[6]; +//UART +extern USART_TypeDef * mcu_uart_banks[6]; +bool mcu_uart_has_usart[6] + +extern const mcu_uart_tx_obj_t mcu_uart_tx_list[12]; +extern const mcu_uart_rx_obj_t mcu_uart_rx_list[12]; + #endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F405XX_PERIPH_H \ No newline at end of file From 0b85172ba6358a1b57191cef52b051ba9fa4919b Mon Sep 17 00:00:00 2001 From: Hierophect Date: Fri, 4 Oct 2019 14:37:18 -0400 Subject: [PATCH 007/189] WIP --- ports/stm32f4/Makefile | 1 + .../boards/feather_f405/stm32f4xx_hal_conf.h | 2 +- ports/stm32f4/common-hal/busio/UART.c | 163 ++++++++++++++++-- ports/stm32f4/common-hal/busio/UART.h | 4 + .../peripherals/stm32f4/stm32f405xx/periph.h | 2 +- ports/stm32f4/supervisor/port.c | 2 + 6 files changed, 158 insertions(+), 16 deletions(-) diff --git a/ports/stm32f4/Makefile b/ports/stm32f4/Makefile index bef26d662a..50d0e980f4 100755 --- a/ports/stm32f4/Makefile +++ b/ports/stm32f4/Makefile @@ -152,6 +152,7 @@ SRC_STM32 = \ stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_utils.c \ stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_exti.c \ stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c \ + stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_usart.c \ stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c \ stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c \ stm32f4/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c \ diff --git a/ports/stm32f4/boards/feather_f405/stm32f4xx_hal_conf.h b/ports/stm32f4/boards/feather_f405/stm32f4xx_hal_conf.h index 019b03ca7a..04cb75f2b5 100644 --- a/ports/stm32f4/boards/feather_f405/stm32f4xx_hal_conf.h +++ b/ports/stm32f4/boards/feather_f405/stm32f4xx_hal_conf.h @@ -63,7 +63,7 @@ #define HAL_SPI_MODULE_ENABLED /* #define HAL_TIM_MODULE_ENABLED */ #define HAL_UART_MODULE_ENABLED -/* #define HAL_USART_MODULE_ENABLED */ +#define HAL_USART_MODULE_ENABLED /* #define HAL_IRDA_MODULE_ENABLED */ /* #define HAL_SMARTCARD_MODULE_ENABLED */ /* #define HAL_WWDG_MODULE_ENABLED */ diff --git a/ports/stm32f4/common-hal/busio/UART.c b/ports/stm32f4/common-hal/busio/UART.c index d353592bf4..aef2f62631 100644 --- a/ports/stm32f4/common-hal/busio/UART.c +++ b/ports/stm32f4/common-hal/busio/UART.c @@ -35,34 +35,157 @@ #include "py/stream.h" #include "supervisor/shared/translate.h" +#include "common-hal/microcontroller/Pin.h" +#include "stm32f4xx_hal.h" + #include "tick.h" +STATIC bool reserved_uart[10]; + +void uart_reset(void) { + //ugh. reduce this + #ifdef USART1 + reserved_uart[0] = false; + __HAL_RCC_USART1_CLK_DISABLE(); + #endif + #ifdef USART2 + reserved_uart[1] = false; + __HAL_RCC_USART2_CLK_DISABLE(); + #endif + #ifdef USART3 + reserved_uart[2] = false; + __HAL_RCC_USART3_CLK_DISABLE(); + #endif + #ifdef UART4 + reserved_uart[3] = false; + __HAL_RCC_UART4_CLK_DISABLE(); + #endif + #ifdef UART5 + reserved_uart[4] = false; + __HAL_RCC_UART5_CLK_DISABLE(); + #endif + #ifdef USART6 + reserved_uart[5] = false; + __HAL_RCC_USART6_CLK_DISABLE(); + #endif +} + void common_hal_busio_uart_construct(busio_uart_obj_t *self, const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, mp_float_t timeout, uint16_t receiver_buffer_size) { - GPIO_InitStruct.Pin = pin_mask(10)|pin_mask(11); + //match pins to UART objects + USART_TypeDef * USARTx; + + uint8_t tx_len = sizeof(mcu_uart_tx_list)/sizeof(*mcu_uart_tx_list); + uint8_t rx_len = sizeof(mcu_uart_rx_list)/sizeof(*mcu_uart_rx_list); + + bool uart_taken = false; + //tx + for(uint i=0; itx = &mcu_uart_tx_list[i]; + self->rx = &mcu_uart_rx_list[j]; + break; + } + } + } + } + + //handle typedef selection, errors + if(self->tx!=NULL && self->rx!=NULL) { + USARTx = mcu_uart_banks[self->tx->uart_index-1]; + } else { + if (uart_taken) { + mp_raise_ValueError(translate("Hardware busy, try alternative pins")); + } else { + mp_raise_ValueError(translate("Invalid UART pin selection")); + } + } + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + GPIO_InitStruct.Pin = pin_mask(tx->number); GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_PULLUP; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = GPIO_AF7_USART3; - HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + GPIO_InitStruct.Alternate = self->tx->altfn_index; + HAL_GPIO_Init(pin_port(tx->port), &GPIO_InitStruct); - __HAL_RCC_USART2_CLK_ENABLE(); + GPIO_InitStruct.Pin = pin_mask(rx->number); + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = self->rx->altfn_index; + HAL_GPIO_Init(pin_port(rx->port), &GPIO_InitStruct); - huart2.Instance = USART2; - huart2.Init.BaudRate = 115200; - huart2.Init.WordLength = UART_WORDLENGTH_8B; - huart2.Init.StopBits = UART_STOPBITS_1; - huart2.Init.Parity = UART_PARITY_NONE; - huart2.Init.Mode = UART_MODE_TX_RX; - huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE; - huart2.Init.OverSampling = UART_OVERSAMPLING_16; - if (HAL_UART_Init(&huart2) != HAL_OK) + #ifdef USART1 + if(USARTx==USART1) { + reserved_uart[0] = true; + __HAL_RCC_USART1_CLK_ENABLE(); + mp_printf(&mp_plat_print, "USART1"); + } + #endif + #ifdef UART2 + if(USARTx==USART2) { + reserved_uart[1] = true; + __HAL_RCC_USART2_CLK_ENABLE(); + mp_printf(&mp_plat_print, "USART2"); + } + #endif + #ifdef USART3 + if(USARTx==USART3) { + reserved_uart[2] = true; + __HAL_RCC_USART3_CLK_ENABLE(); + mp_printf(&mp_plat_print, "USART3"); + } + #endif + #ifdef UART4 + if(USARTx==UART4) { + reserved_uart[3] = true; + __HAL_RCC_UART4_CLK_ENABLE(); + mp_printf(&mp_plat_print, "USART4"); + } + #endif + #ifdef UART5 + if(USARTx==UART5) { + reserved_uart[4] = true; + __HAL_RCC_UART5_CLK_ENABLE(); + mp_printf(&mp_plat_print, "USART5"); + } + #endif + #ifdef USART6 + if(USARTx==USART6) { + reserved_uart[5] = true; + __HAL_RCC_USART6_CLK_ENABLE(); + mp_printf(&mp_plat_print, "USART6"); + } + #endif + + self->handle.Instance = USARTx; + self->handle.Init.BaudRate = 115200; + self->handle.Init.WordLength = UART_WORDLENGTH_8B; + self->handle.Init.StopBits = UART_STOPBITS_1; + self->handle.Init.Parity = UART_PARITY_NONE; + self->handle.Init.Mode = UART_MODE_TX_RX; + self->handle.Init.HwFlowCtl = UART_HWCONTROL_NONE; + self->handle.Init.OverSampling = UART_OVERSAMPLING_16; + if (HAL_UART_Init(&self->handle) != HAL_OK) { - mp_raise_NotImplementedError(translate("UART explode")); + mp_raise_ValueError(translate("UART Init Error")); } + claim_pin(tx); + claim_pin(rx); } bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { @@ -74,11 +197,23 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { // Read characters. size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t len, int *errcode) { + if (HAL_UART_Receive(&self->handle, data, (uint16_t)len, 500) == HAL_OK) { + return len; + } else { + mp_raise_ValueError(translate("UART read error")); + } return 0; } // Write characters. size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, size_t len, int *errcode) { + //const char aTxBuffer[] = "This is the internal message"; + + if (HAL_UART_Transmit(&self->handle, (uint8_t *)data, len, 500) == HAL_OK) { + return len; + } else { + mp_raise_ValueError(translate("UART write error")); + } return 0; } diff --git a/ports/stm32f4/common-hal/busio/UART.h b/ports/stm32f4/common-hal/busio/UART.h index 8a4b554c4a..fd1fd113a8 100644 --- a/ports/stm32f4/common-hal/busio/UART.h +++ b/ports/stm32f4/common-hal/busio/UART.h @@ -28,11 +28,13 @@ #define MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_UART_H #include "common-hal/microcontroller/Pin.h" +#include "stm32f4/periph.h" #include "py/obj.h" typedef struct { mp_obj_base_t base; + UART_HandleTypeDef handle; const mcu_uart_tx_obj_t *tx; const mcu_uart_rx_obj_t *rx; uint8_t character_bits; @@ -43,4 +45,6 @@ typedef struct { uint8_t* buffer; } busio_uart_obj_t; +void uart_reset(void); + #endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_UART_H diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.h b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.h index 6737720266..5ab7f025ea 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.h +++ b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.h @@ -43,7 +43,7 @@ extern const mcu_spi_nss_obj_t mcu_spi_nss_list[6]; //UART extern USART_TypeDef * mcu_uart_banks[6]; -bool mcu_uart_has_usart[6] +bool mcu_uart_has_usart[6]; extern const mcu_uart_tx_obj_t mcu_uart_tx_list[12]; extern const mcu_uart_rx_obj_t mcu_uart_rx_list[12]; diff --git a/ports/stm32f4/supervisor/port.c b/ports/stm32f4/supervisor/port.c index df7a6ca427..7d50c94c3b 100644 --- a/ports/stm32f4/supervisor/port.c +++ b/ports/stm32f4/supervisor/port.c @@ -33,6 +33,7 @@ #include "common-hal/microcontroller/Pin.h" #include "common-hal/busio/I2C.h" #include "common-hal/busio/SPI.h" +#include "common-hal/busio/UART.h" #include "stm32f4/clocks.h" #include "stm32f4/gpio.h" @@ -57,6 +58,7 @@ void reset_port(void) { reset_all_pins(); i2c_reset(); spi_reset(); + uart_reset(); } void reset_to_bootloader(void) { From fc19e03128aeeb94a22fdff097e4d0576d768986 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 6 Oct 2019 21:30:26 -0400 Subject: [PATCH 008/189] WIP: bonding --- ports/nrf/README.md | 86 ++----------------- ports/nrf/bluetooth/ble_uart.c | 4 +- ports/nrf/boards/adafruit_nrf52840_s140_v6.ld | 1 + ports/nrf/boards/common.ld | 17 ++-- ports/nrf/mpconfigport.h | 10 --- ports/nrf/supervisor/serial.c | 10 +-- py/circuitpy_mpconfig.mk | 14 ++- supervisor/supervisor.mk | 51 +++++------ 8 files changed, 63 insertions(+), 130 deletions(-) diff --git a/ports/nrf/README.md b/ports/nrf/README.md index 5f6d037204..64f5b8aff5 100644 --- a/ports/nrf/README.md +++ b/ports/nrf/README.md @@ -2,43 +2,8 @@ This is a port of CircuitPython to the Nordic Semiconductor nRF52 series of chips. -## Supported Features - -* UART -* SPI -* LEDs -* Pins -* ADC -* I2C -* PWM -* Temperature -* RTC (Real Time Counter. Low-Power counter) -* BLE support including: - * Peripheral role - * Scanner role - * _REPL over Bluetooth LE_ (optionally using WebBluetooth) - * ubluepy: Bluetooth LE module for CircuitPython - * 1 non-connectable advertiser while in connection - -## Tested Hardware - -* nRF52840 - * [PCA10056](http://www.nordicsemi.com/eng/Products/nRF52840-Preview-DK) - -## Board Specific Instructions - -For board-specific instructions on building and flashing CircuitPython, see -the following links: - -> **NOTE**: These board specific readmes may be more up to date than the - generic board-neutral documentation further down. - -* Adafruit Feather nRF52840: `boards/feather_nrf52840_express/README.md`: 1MB Flash, 256KB SRAM -* Nordic PCA10056 (uses nRF52840): `boards/pca10056/README.md` -* MakerDiary nRF52840 MDK: `boards/makerdiary_nrf52840_mdk/README.md` -* MakerDiary nRF52840 MDK USB Dongle: `boards/makerdiary_nrf52840_mdk_usb_dongle/README.md` - -For all other board targets, see the generic notes below. +> **NOTE**: There are board-specific READMEs that may be more up to date than the + generic board-neutral documentation below. ## Compile and Flash @@ -46,41 +11,17 @@ Prerequisite steps for building the nrf port: git clone .git circuitpython cd circuitpython - git submodule update --init + git submodule update --init --recursive make -C mpy-cross +Some boards have UF2 bootloaders and can simply be flashed in the normal way, by copying +firmware.uf2 to the BOOT drive. + To build and flash issue the following command inside the ports/nrf/ folder: make BOARD=pca10056 make BOARD=pca10056 flash -## Compile and Flash with Bluetooth Stack - -First prepare the bluetooth folder by downloading Bluetooth LE stacks and headers: - - ./bluetooth/download_ble_stack.sh - -If the Bluetooth stacks has been downloaded, compile the target with the following command: - - make BOARD=pca10040 SD=s132 - -The **make sd** will trigger a flash of the bluetooth stack before that application is flashed. Note that **make sd** will perform a full erase of the chip, which could cause 3rd party bootloaders to also be wiped. - - make BOARD=pca10040 SD=s132 sd - -Note: further tuning of features to include in bluetooth or even setting up the device to use REPL over Bluetooth can be configured in the `bluetooth_conf.h`. - -## Target Boards and Make Flags - -Target Board (BOARD) | Bluetooth Stack (SD) | Bluetooth Support | Flash Util --------------------------|-------------------------|------------------------|------------------------------- -pca10056 | s140 | Peripheral and Scanner | [Segger](#segger-targets) -feather_nrf52840_express | s140 | Peripheral and Scanner | UF2 bootloader -makerdiary_nrf52840_mdk | s140 | Peripheral and Scanner | pyocd or ARM mbed DAPLink -makerdiary_nrf52840_mdk_usb_dongle | s140 | Peripheral and Scanner | DFU bootloader & nrfutil -electronut_labs_papyr | s140 | Peripheral and Scanner | UF2 bootloader -electronut_labs_blip | s140 | Peripheral and Scanner | Black Magic Probe - ## Segger Targets Install the necessary tools to flash and debug using Segger: @@ -107,22 +48,7 @@ run follow command to install [adafruit-nrfutil](https://github.com/adafruit/Ada * dfu-gen: Generates a Firmware zip to be used by the DFU flash application. * dfu-flash: Triggers the DFU flash application to upload the firmware from the generated Firmware zip file. -Example on how to generate and flash feather_nrf52840 target: - - make BOARD=feather_nrf52840 SD=s140 - make BOARD=feather_nrf52840 SD=s140 dfu-gen dfu-flash - -## Bluetooth LE REPL - -The port also implements a BLE REPL driver. This feature is disabled by default, as it will deactivate the UART REPL when activated. As some of the nRF devices only have one UART, using the BLE REPL free's the UART instance such that it can be used as a general UART peripheral not bound to REPL. - -The configuration can be enabled by editing the `bluetooth_conf.h` and set `MICROPY_PY_BLE_NUS` to 1. When enabled you have different options to test it: * [NUS Console for Linux](https://github.com/tralamazza/nus_console) (recommended) * [WebBluetooth REPL](https://glennrub.github.io/webbluetooth/micropython/repl/) (experimental) - -Other: -* nRF UART application for IPhone/Android - -WebBluetooth mode can also be configured by editing `bluetooth_conf.h` and set `BLUETOOTH_WEBBLUETOOTH_REPL` to 1. This will alternate advertisement between Eddystone URL and regular connectable advertisement. The Eddystone URL will point the phone or PC to download [WebBluetooth REPL](https://glennrub.github.io/webbluetooth/micropython/repl/) (experimental), which subsequently can be used to connect to the Bluetooth REPL from the PC or Phone browser. diff --git a/ports/nrf/bluetooth/ble_uart.c b/ports/nrf/bluetooth/ble_uart.c index 787a2a1174..1e7a319bdd 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 (MICROPY_PY_BLE_NUS == 1) +#if CIRCUITPY_SERIAL_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 // MICROPY_PY_BLE_NUS +#endif // CIRCUITPY_SERIAL_BLE diff --git a/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld b/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld index 2587a19e34..90b8862cf0 100644 --- a/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld +++ b/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld @@ -24,6 +24,7 @@ MEMORY FLASH_ISR (rx) : ORIGIN = 0x00026000, LENGTH = 0x001000 FLASH_TEXT (rx) : ORIGIN = 0x00027000, LENGTH = 0x086000 FLASH_FATFS (r) : ORIGIN = 0x000AD000, LENGTH = 0x040000 + FLASH_CONFIG (r): ORIGIN = 0x000ED000, LENGTH = 0x007000 /* 0x2000000 - RAM:ORIGIN is reserved for Softdevice */ RAM (xrw) : ORIGIN = 0x20004000, LENGTH = 0x20040000 - 0x20004000 diff --git a/ports/nrf/boards/common.ld b/ports/nrf/boards/common.ld index df81aae583..dfb355a76f 100644 --- a/ports/nrf/boards/common.ld +++ b/ports/nrf/boards/common.ld @@ -2,6 +2,10 @@ __fatfs_flash_start_addr = ORIGIN(FLASH_FATFS); __fatfs_flash_length = LENGTH(FLASH_FATFS); +/* Flash region for configuration information (bonding info, keys, etc.) */ +__config_flash_start_addr = ORIGIN(FLASH_CONFIG); +__config_flash_length = LENGTH(FLASH_CONFIG); + /* define output sections */ SECTIONS { @@ -13,7 +17,7 @@ SECTIONS . = ALIGN(4); } >FLASH_ISR - + /* The program code and other data goes into FLASH */ .text : { @@ -28,7 +32,7 @@ SECTIONS . = ALIGN(4); _etext = .; /* define a global symbol at end of code */ } >FLASH_TEXT - + /* .ARM.extab : { @@ -42,10 +46,10 @@ SECTIONS __exidx_end = .; } >FLASH */ - + /* used by the startup to initialize data */ _sidata = .; - + /* This is the initialized data section The program executes knowing that the data is in the RAM but the loader puts the initial values in the FLASH (inidata). @@ -60,8 +64,8 @@ SECTIONS . = ALIGN(4); _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - + } >RAM + /* Uninitialized data section */ .bss : { @@ -105,4 +109,3 @@ SECTIONS .ARM.attributes 0 : { *(.ARM.attributes) } } - diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index 0b755a156b..9c3d02f44d 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -38,16 +38,6 @@ #define MICROPY_PY_UBINASCII (1) #define MICROPY_PY_UJSON (1) -// TODO this is old BLE stuff -#if BLUETOOTH_SD - #define MICROPY_PY_BLEIO (1) - #define MICROPY_PY_BLE_NUS (0) -#else - #ifndef MICROPY_PY_BLEIO - #define MICROPY_PY_BLEIO (0) - #endif -#endif - // 24kiB stack #define CIRCUITPY_DEFAULT_STACK_SIZE 0x6000 diff --git a/ports/nrf/supervisor/serial.c b/ports/nrf/supervisor/serial.c index 6fd89eb3ea..b19e9267cc 100644 --- a/ports/nrf/supervisor/serial.c +++ b/ports/nrf/supervisor/serial.c @@ -28,15 +28,15 @@ #include "supervisor/serial.h" -#if (MICROPY_PY_BLE_NUS == 1) +#if CIRCUITPY_SERIAL_BLE #include "ble_uart.h" -#else +#elif CIRCUITPY_SERIAL_UART #include #include "nrf_gpio.h" #include "nrfx_uarte.h" #endif -#if (MICROPY_PY_BLE_NUS == 1) +#if CIRCUITPY_SERIAL_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 !defined(NRF52840_XXAA) +#elif CIRCUITPY_SERIAL_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 +#endif // CIRCUITPY_SERIAL_UART diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index c5756f4880..d54e626e2f 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -23,7 +23,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. - # mpconfigboard.mk files can specify: # CIRCUITPY_FULL_BUILD = 1 (which is the default) # or @@ -284,8 +283,21 @@ CIRCUITPY_USTACK = 0 endif CFLAGS += -DCIRCUITPY_USTACK=$(CIRCUITPY_USTACK) +# Non-module conditionals ifndef CIRCUITPY_BITBANG_APA102 CIRCUITPY_BITBANG_APA102 = 0 endif CFLAGS += -DCIRCUITPY_BITBANG_APA102=$(CIRCUITPY_BITBANG_APA102) + +# REPL over BLE +ifndef CIRCUITPY_SERIAL_BLE +CIRCUITPY_SERIAL_BLE = 0 +endif +CFLAGS += -DCIRCUITPY_SERIAL_BLE=$(CIRCUITPY_SERIAL_BLE) + +# REPL over UART +ifndef CIRCUITPY_SERIAL_UART +CIRCUITPY_SERIAL_UART = 0 +endif +CFLAGS += -DCIRCUITPY_SERIAL_UART=$(CIRCUITPY_SERIAL_UART) diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index ee47be4b00..90b0e85d57 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -46,7 +46,7 @@ ifdef EXTERNAL_FLASH_DEVICES else ifeq ($(DISABLE_FILESYSTEM),1) SRC_SUPERVISOR += supervisor/stub/internal_flash.c - else + else SRC_SUPERVISOR += supervisor/internal_flash.c endif endif @@ -58,30 +58,31 @@ ifeq ($(USB),FALSE) 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/class/hid/hid_device.c \ - lib/tinyusb/src/class/midi/midi_device.c \ - lib/tinyusb/src/tusb.c \ - supervisor/shared/serial.c \ - supervisor/usb.c \ - supervisor/shared/usb/usb_desc.c \ - supervisor/shared/usb/usb.c \ - supervisor/shared/usb/usb_msc_flash.c \ - shared-bindings/usb_hid/__init__.c \ - shared-bindings/usb_hid/Device.c \ - shared-bindings/usb_midi/__init__.c \ - shared-bindings/usb_midi/PortIn.c \ - shared-bindings/usb_midi/PortOut.c \ - shared-module/usb_hid/__init__.c \ - shared-module/usb_hid/Device.c \ - shared-module/usb_midi/__init__.c \ - shared-module/usb_midi/PortIn.c \ - shared-module/usb_midi/PortOut.c \ - $(BUILD)/autogen_usb_descriptor.c + 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/class/hid/hid_device.c \ + lib/tinyusb/src/class/midi/midi_device.c \ + lib/tinyusb/src/tusb.c \ + supervisor/shared/serial.c \ + supervisor/usb.c \ + supervisor/shared/usb/usb_desc.c \ + supervisor/shared/usb/usb.c \ + supervisor/shared/usb/usb_msc_flash.c \ + shared-bindings/usb_hid/__init__.c \ + shared-bindings/usb_hid/Device.c \ + shared-bindings/usb_midi/__init__.c \ + shared-bindings/usb_midi/PortIn.c \ + shared-bindings/usb_midi/PortOut.c \ + shared-module/usb_hid/__init__.c \ + shared-module/usb_hid/Device.c \ + shared-module/usb_midi/__init__.c \ + shared-module/usb_midi/PortIn.c \ + shared-module/usb_midi/PortOut.c \ + $(BUILD)/autogen_usb_descriptor.c CFLAGS += -DUSB_AVAILABLE endif From cc3a17845c0dfad0d37f79e3c0791e72365d18d3 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Mon, 7 Oct 2019 14:22:12 -0400 Subject: [PATCH 009/189] Fix USB issues, frequency macro, F412 tests --- ports/stm32f4/Makefile | 2 +- .../boards/stm32f412zg_discovery/mpconfigboard.mk | 1 + ports/stm32f4/boards/stm32f412zg_discovery/pins.c | 4 ++-- ports/stm32f4/common-hal/busio/UART.c | 7 ++++++- .../stm32f4/peripherals/stm32f4/stm32f412zx/periph.c | 11 ++++++++++- .../stm32f4/peripherals/stm32f4/stm32f412zx/periph.h | 8 ++++++++ 6 files changed, 28 insertions(+), 5 deletions(-) diff --git a/ports/stm32f4/Makefile b/ports/stm32f4/Makefile index 50d0e980f4..b1adce3420 100755 --- a/ports/stm32f4/Makefile +++ b/ports/stm32f4/Makefile @@ -120,7 +120,7 @@ LIBS += -lm endif # TinyUSB defines -CFLAGS += -DHSE_VALUE=8000000 -DCFG_TUSB_MCU=OPT_MCU_STM32F4 -DCFG_TUD_CDC_RX_BUFSIZE=1024 -DCFG_TUD_CDC_TX_BUFSIZE=1024 -DCFG_TUD_MSC_BUFSIZE=4096 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 +CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_STM32F4 -DCFG_TUD_CDC_RX_BUFSIZE=1024 -DCFG_TUD_CDC_TX_BUFSIZE=1024 -DCFG_TUD_MSC_BUFSIZE=4096 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 ###################################### diff --git a/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.mk b/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.mk index 509a244106..d642f243ef 100644 --- a/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.mk +++ b/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.mk @@ -2,6 +2,7 @@ USB_VID = 0x239A USB_PID = 0x8056 USB_PRODUCT = "STM32F412ZG Discovery Board - CPy" USB_MANUFACTURER = "STMicroelectronics" +USB_DEVICES = "CDC,MSC,HID" INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE diff --git a/ports/stm32f4/boards/stm32f412zg_discovery/pins.c b/ports/stm32f4/boards/stm32f412zg_discovery/pins.c index a0b477a470..461dee7996 100644 --- a/ports/stm32f4/boards/stm32f412zg_discovery/pins.c +++ b/ports/stm32f4/boards/stm32f412zg_discovery/pins.c @@ -74,8 +74,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PG12) }, { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PF04) }, { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PG13) }, - { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PG14) }, - { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PG09) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PG14) }, //USART6 TX + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PG09) }, //USART6 RX { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA01) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PC01) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PC03) }, diff --git a/ports/stm32f4/common-hal/busio/UART.c b/ports/stm32f4/common-hal/busio/UART.c index aef2f62631..5ef2e9807b 100644 --- a/ports/stm32f4/common-hal/busio/UART.c +++ b/ports/stm32f4/common-hal/busio/UART.c @@ -173,7 +173,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, #endif self->handle.Instance = USARTx; - self->handle.Init.BaudRate = 115200; + self->handle.Init.BaudRate = 9600; self->handle.Init.WordLength = UART_WORDLENGTH_8B; self->handle.Init.StopBits = UART_STOPBITS_1; self->handle.Init.Parity = UART_PARITY_NONE; @@ -183,6 +183,11 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, if (HAL_UART_Init(&self->handle) != HAL_OK) { mp_raise_ValueError(translate("UART Init Error")); + + } else { + mp_printf(&mp_plat_print, "Init Success, "); + const char msg[] = "Program has started"; + if(HAL_UART_Transmit(&self->handle, (uint8_t *)msg, sizeof(msg)/sizeof(*msg), 5000) == HAL_OK) mp_printf(&mp_plat_print, "Write Success"); } claim_pin(tx); claim_pin(rx); diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.c b/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.c index ea94719ecc..3936c0dc09 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.c +++ b/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.c @@ -120,4 +120,13 @@ const mcu_spi_nss_obj_t mcu_spi_nss_list[12] = { SPI(5, 6, &pin_PE11) }; -//UART, Etc +USART_TypeDef * mcu_uart_banks[6] = {USART1, USART2, USART3, NULL, NULL, USART6}; +bool mcu_uart_has_usart[6] = {true, true, true, false, false, true}; + +const mcu_uart_tx_obj_t mcu_uart_tx_list[1] = { + UART(6, 8, &pin_PG14), +}; + +const mcu_uart_rx_obj_t mcu_uart_rx_list[1] = { + UART(6, 8, &pin_PG09), +}; diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.h b/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.h index d12bbba93e..afe7ac0dbe 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.h +++ b/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.h @@ -42,4 +42,12 @@ extern const mcu_spi_mosi_obj_t mcu_spi_mosi_list[14]; extern const mcu_spi_miso_obj_t mcu_spi_miso_list[12]; extern const mcu_spi_nss_obj_t mcu_spi_nss_list[12]; +//UART +extern USART_TypeDef * mcu_uart_banks[6]; +bool mcu_uart_has_usart[6]; + +extern const mcu_uart_tx_obj_t mcu_uart_tx_list[1]; +extern const mcu_uart_rx_obj_t mcu_uart_rx_list[1]; + + #endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H \ No newline at end of file From f58d54cd22eefb7269082cf8e592671741368038 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Tue, 8 Oct 2019 16:03:51 -0400 Subject: [PATCH 010/189] Preliminary read system, not buffered --- ports/stm32f4/common-hal/busio/UART.c | 42 +++++++++++++++------------ 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/ports/stm32f4/common-hal/busio/UART.c b/ports/stm32f4/common-hal/busio/UART.c index 5ef2e9807b..780451782d 100644 --- a/ports/stm32f4/common-hal/busio/UART.c +++ b/ports/stm32f4/common-hal/busio/UART.c @@ -119,7 +119,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_PULLUP; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = self->tx->altfn_index; + GPIO_InitStruct.Alternate = self->tx->altfn_index; HAL_GPIO_Init(pin_port(tx->port), &GPIO_InitStruct); GPIO_InitStruct.Pin = pin_mask(rx->number); @@ -133,42 +133,36 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, if(USARTx==USART1) { reserved_uart[0] = true; __HAL_RCC_USART1_CLK_ENABLE(); - mp_printf(&mp_plat_print, "USART1"); } #endif #ifdef UART2 if(USARTx==USART2) { reserved_uart[1] = true; __HAL_RCC_USART2_CLK_ENABLE(); - mp_printf(&mp_plat_print, "USART2"); } #endif #ifdef USART3 if(USARTx==USART3) { reserved_uart[2] = true; __HAL_RCC_USART3_CLK_ENABLE(); - mp_printf(&mp_plat_print, "USART3"); } #endif #ifdef UART4 if(USARTx==UART4) { reserved_uart[3] = true; __HAL_RCC_UART4_CLK_ENABLE(); - mp_printf(&mp_plat_print, "USART4"); } #endif #ifdef UART5 if(USARTx==UART5) { reserved_uart[4] = true; __HAL_RCC_UART5_CLK_ENABLE(); - mp_printf(&mp_plat_print, "USART5"); } #endif #ifdef USART6 if(USARTx==USART6) { reserved_uart[5] = true; __HAL_RCC_USART6_CLK_ENABLE(); - mp_printf(&mp_plat_print, "USART6"); } #endif @@ -184,36 +178,46 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, { mp_raise_ValueError(translate("UART Init Error")); - } else { - mp_printf(&mp_plat_print, "Init Success, "); - const char msg[] = "Program has started"; - if(HAL_UART_Transmit(&self->handle, (uint8_t *)msg, sizeof(msg)/sizeof(*msg), 5000) == HAL_OK) mp_printf(&mp_plat_print, "Write Success"); } + claim_pin(tx); claim_pin(rx); } bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { - return 0; + return self->tx->pin == mp_const_none; } void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { + reset_pin_number(self->tx->pin->port,self->tx->pin->number); + reset_pin_number(self->rx->pin->port,self->rx->pin->number); + self->tx = mp_const_none; + self->rx = mp_const_none; } // Read characters. size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t len, int *errcode) { - if (HAL_UART_Receive(&self->handle, data, (uint16_t)len, 500) == HAL_OK) { - return len; - } else { - mp_raise_ValueError(translate("UART read error")); + uint pos = 0; + HAL_StatusTypeDef result = HAL_OK; + uint8_t cha[1]; + if (__HAL_UART_GET_FLAG(&self->handle, UART_FLAG_RXNE)) { + while(poshandle, cha, 1, 500); + data[pos] = cha[0]; + pos++; + } } - return 0; + + if (pos == 0) { + *errcode = EAGAIN; + return MP_STREAM_ERROR; + } + + return pos; } // Write characters. size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, size_t len, int *errcode) { - //const char aTxBuffer[] = "This is the internal message"; - if (HAL_UART_Transmit(&self->handle, (uint8_t *)data, len, 500) == HAL_OK) { return len; } else { From 1140ff5cd5d997f1faeb61826b34971828a83426 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Fri, 11 Oct 2019 15:47:55 -0400 Subject: [PATCH 011/189] WIP --- ports/stm32f4/common-hal/busio/UART.c | 285 ++++++++++++++++++++------ ports/stm32f4/common-hal/busio/UART.h | 13 +- 2 files changed, 231 insertions(+), 67 deletions(-) diff --git a/ports/stm32f4/common-hal/busio/UART.c b/ports/stm32f4/common-hal/busio/UART.c index 780451782d..2883974eb6 100644 --- a/ports/stm32f4/common-hal/busio/UART.c +++ b/ports/stm32f4/common-hal/busio/UART.c @@ -35,15 +35,15 @@ #include "py/stream.h" #include "supervisor/shared/translate.h" -#include "common-hal/microcontroller/Pin.h" -#include "stm32f4xx_hal.h" - #include "tick.h" +#include "stm32f4xx_hal.h" + STATIC bool reserved_uart[10]; +//TODO: remove this horrible hack +STATIC busio_uart_obj_t * context_pointers[10]; //numbered by uart module void uart_reset(void) { - //ugh. reduce this #ifdef USART1 reserved_uart[0] = false; __HAL_RCC_USART1_CLK_DISABLE(); @@ -68,6 +68,7 @@ void uart_reset(void) { reserved_uart[5] = false; __HAL_RCC_USART6_CLK_DISABLE(); #endif + //TODO: this technically needs to go to 10 to support F413. Any way to condense? } void common_hal_busio_uart_construct(busio_uart_obj_t *self, @@ -80,54 +81,127 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, uint8_t tx_len = sizeof(mcu_uart_tx_list)/sizeof(*mcu_uart_tx_list); uint8_t rx_len = sizeof(mcu_uart_rx_list)/sizeof(*mcu_uart_rx_list); - bool uart_taken = false; - //tx - for(uint i=0; itx = &mcu_uart_tx_list[i]; + self->rx = &mcu_uart_rx_list[j]; + break; } - //store pins if not - self->tx = &mcu_uart_tx_list[i]; - self->rx = &mcu_uart_rx_list[j]; - break; } } } - } - - //handle typedef selection, errors - if(self->tx!=NULL && self->rx!=NULL) { - USARTx = mcu_uart_banks[self->tx->uart_index-1]; - } else { - if (uart_taken) { - mp_raise_ValueError(translate("Hardware busy, try alternative pins")); + //handle typedef selection, errors + if(self->tx!=NULL && self->rx!=NULL) { + USARTx = mcu_uart_banks[self->tx->uart_index-1]; + mp_printf(&mp_plat_print, "UART:%d \n", self->tx->uart_index); + //TODO: remove this horrible hack + context_pointers[self->tx->uart_index-1] = self; } else { - mp_raise_ValueError(translate("Invalid UART pin selection")); + if (uart_taken) { + mp_raise_ValueError(translate("Hardware busy, try alternative pins")); + } else { + mp_raise_ValueError(translate("Invalid UART pin selection")); + } } + } else if (tx==mp_const_none) { + //run only rx + for(uint i=0; irx = &mcu_uart_rx_list[i]; + break; + } + } + //handle typedef selection, errors + if(self->rx!=NULL) { + USARTx = mcu_uart_banks[self->rx->uart_index-1]; + //TODO: remove this horrible hack + context_pointers[self->rx->uart_index-1] = self; + } else { + if (uart_taken) { + mp_raise_ValueError(translate("Hardware busy, try alternative pins")); + } else { + mp_raise_ValueError(translate("Invalid UART pin selection")); + } + } + } else if (rx==mp_const_none) { + //run only tx + for(uint i=0; itx = &mcu_uart_tx_list[i]; + break; + } + } + //handle typedef selection, errors + if(self->tx!=NULL) { + USARTx = mcu_uart_banks[self->tx->uart_index-1]; + //TODO: remove this horrible hack + context_pointers[self->tx->uart_index-1] = self; + } else { + if (uart_taken) { + mp_raise_ValueError(translate("Hardware busy, try alternative pins")); + } else { + mp_raise_ValueError(translate("Invalid UART pin selection")); + } + } + } else { + //both pins cannot be empty + mp_raise_ValueError(translate("You must supply at least one UART pin")); } - GPIO_InitTypeDef GPIO_InitStruct = {0}; - GPIO_InitStruct.Pin = pin_mask(tx->number); - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_PULLUP; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = self->tx->altfn_index; - HAL_GPIO_Init(pin_port(tx->port), &GPIO_InitStruct); + //Other errors + if ( receiver_buffer_size == 0 ) { + mp_raise_ValueError(translate("Invalid buffer size")); + } + if ( bits != 8 && bits != 9 ) { + mp_raise_ValueError(translate("Invalid word/bit length")); + } - GPIO_InitStruct.Pin = pin_mask(rx->number); - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_PULLUP; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = self->rx->altfn_index; - HAL_GPIO_Init(pin_port(rx->port), &GPIO_InitStruct); + //GPIO Init + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if (self->tx!=NULL) { + GPIO_InitStruct.Pin = pin_mask(tx->number); + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = self->tx->altfn_index; + HAL_GPIO_Init(pin_port(tx->port), &GPIO_InitStruct); + } + if (self->rx!=NULL) { + GPIO_InitStruct.Pin = pin_mask(rx->number); + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = self->rx->altfn_index; + HAL_GPIO_Init(pin_port(rx->port), &GPIO_InitStruct); + } #ifdef USART1 if(USARTx==USART1) { @@ -166,12 +240,21 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } #endif + HAL_NVIC_SetPriority(USART2_IRQn, 0, 1); + HAL_NVIC_EnableIRQ(USART2_IRQn); + + //TODO: this technically needs to go to 10 to support F413. Condense? + self->handle.Instance = USARTx; - self->handle.Init.BaudRate = 9600; - self->handle.Init.WordLength = UART_WORDLENGTH_8B; - self->handle.Init.StopBits = UART_STOPBITS_1; - self->handle.Init.Parity = UART_PARITY_NONE; - self->handle.Init.Mode = UART_MODE_TX_RX; + self->handle.Init.BaudRate = baudrate; + self->handle.Init.WordLength = (bits == 9) ? UART_WORDLENGTH_9B : UART_WORDLENGTH_8B; + self->handle.Init.StopBits = (stop>1) ? UART_STOPBITS_2 : UART_STOPBITS_1; + self->handle.Init.Parity = (parity==PARITY_ODD) ? UART_PARITY_ODD : + (parity==PARITY_EVEN) ? UART_PARITY_EVEN : + UART_PARITY_NONE; + self->handle.Init.Mode = (self->tx != NULL && self->rx != NULL) ? UART_MODE_TX_RX : + (self->tx != NULL) ? UART_MODE_TX : + UART_MODE_RX; self->handle.Init.HwFlowCtl = UART_HWCONTROL_NONE; self->handle.Init.OverSampling = UART_OVERSAMPLING_16; if (HAL_UART_Init(&self->handle) != HAL_OK) @@ -180,8 +263,24 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } - claim_pin(tx); - claim_pin(rx); + // Init buffer for rx and claim pins + if (self->rx != NULL) { + ringbuf_alloc(&self->rbuf, receiver_buffer_size, true); + if (!self->rbuf.buf) { + mp_raise_ValueError(translate("UART Buffer allocation error")); + } + claim_pin(rx); + } + if (self->tx != NULL) { + claim_pin(tx); + } + + self->baudrate = baudrate; + self->timeout_ms = timeout * 1000; + + if (HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1) != HAL_OK) { + mp_raise_ValueError(translate("HAL recieve IT start error")); + } } bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { @@ -197,23 +296,43 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { // Read characters. size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t len, int *errcode) { - uint pos = 0; - HAL_StatusTypeDef result = HAL_OK; - uint8_t cha[1]; - if (__HAL_UART_GET_FLAG(&self->handle, UART_FLAG_RXNE)) { - while(poshandle, cha, 1, 500); - data[pos] = cha[0]; - pos++; + // if ( nrf_uarte_rx_pin_get(self->uarte->p_reg) == NRF_UARTE_PSEL_DISCONNECTED ) { + // mp_raise_ValueError(translate("No RX pin")); + // } + + size_t rx_bytes = 0; + uint64_t start_ticks = ticks_ms; + + // Wait for all bytes received or timeout, same as nrf + while ( (ringbuf_count(&self->rbuf) < len) && (ticks_ms - start_ticks < self->timeout_ms) ) { + RUN_BACKGROUND_TASKS; + // Allow user to break out of a timeout with a KeyboardInterrupt. + if ( mp_hal_is_interrupted() ) { + return 0; } } - if (pos == 0) { + // Halt reception + HAL_UART_AbortReceive_IT(&self->handle); + + // copy received data + rx_bytes = ringbuf_count(&self->rbuf); + rx_bytes = MIN(rx_bytes, len); + for ( uint16_t i = 0; i < rx_bytes; i++ ) { + data[i] = ringbuf_get(&self->rbuf); + } + + if (HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1) != HAL_OK) { + mp_raise_ValueError(translate("HAL recieve IT start error")); + } + + mp_printf(&mp_plat_print, "bytes:%d, char:%c", rx_bytes, self->rx_char); + + if (rx_bytes == 0) { *errcode = EAGAIN; return MP_STREAM_ERROR; } - - return pos; + return rx_bytes; } // Write characters. @@ -226,20 +345,60 @@ size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, return 0; } +void HAL_UART_TxCpltCallback(UART_HandleTypeDef *handle) +{ + //not used at the moment. +} + +void HAL_UART_RxCpltCallback(UART_HandleTypeDef *handle) +{ + //TODO: I feel bad just writing this + for(int i=0; i<7; i++) { + if(handle == &context_pointers[i]->handle) { + mp_raise_msg_varg(&mp_type_RuntimeError, translate("error = 0x%d ,%c"), i, &context_pointers[i]->rx_char); + ringbuf_put_n(&context_pointers[i]->rbuf, &context_pointers[i]->rx_char, 1); + HAL_UART_Receive_IT(handle, &context_pointers[i]->rx_char, 1); + return; + } + } +} + +void HAL_UART_ErrorCallback(UART_HandleTypeDef *UartHandle) +{ + mp_raise_RuntimeError(translate("UART Callback Error")); +} + uint32_t common_hal_busio_uart_get_baudrate(busio_uart_obj_t *self) { - return 0; + return self->baudrate; } void common_hal_busio_uart_set_baudrate(busio_uart_obj_t *self, uint32_t baudrate) { + //Don't reset if it's the same value + if (baudrate == self->baudrate) return; + + //Otherwise de-init and set new rate + if(HAL_UART_DeInit(&self->handle) != HAL_OK) { + mp_raise_ValueError(translate("UART De-init error")); + } + self->handle.Init.BaudRate = baudrate; + if(HAL_UART_Init(&self->handle) != HAL_OK) { + mp_raise_ValueError(translate("UART Re-init error")); + } + + self->baudrate = baudrate; } uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { - return 0; + return ringbuf_count(&self->rbuf); } void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) { + // Halt reception + HAL_UART_AbortReceive_IT(&self->handle); + ringbuf_clear(&self->rbuf); + HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1); } bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) { - return 0; + return true; } diff --git a/ports/stm32f4/common-hal/busio/UART.h b/ports/stm32f4/common-hal/busio/UART.h index fd1fd113a8..5d88ddd930 100644 --- a/ports/stm32f4/common-hal/busio/UART.h +++ b/ports/stm32f4/common-hal/busio/UART.h @@ -29,22 +29,27 @@ #include "common-hal/microcontroller/Pin.h" #include "stm32f4/periph.h" +#include "stm32f4xx_hal.h" #include "py/obj.h" +#include "py/ringbuf.h" typedef struct { mp_obj_base_t base; UART_HandleTypeDef handle; const mcu_uart_tx_obj_t *tx; const mcu_uart_rx_obj_t *rx; - uint8_t character_bits; - bool rx_error; + + ringbuf_t rbuf; + uint8_t rx_char; + uint32_t baudrate; uint32_t timeout_ms; - uint32_t buffer_length; - uint8_t* buffer; + //bool tx_complete; } busio_uart_obj_t; void uart_reset(void); +void USART2_IRQHandler(void); + #endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_UART_H From 14eefaafeeebbb2193da13c105bf30a826ee39cd Mon Sep 17 00:00:00 2001 From: Hierophect Date: Wed, 16 Oct 2019 11:33:55 -0400 Subject: [PATCH 012/189] Hack in interrupt support --- ports/stm32f4/common-hal/busio/UART.c | 74 ++++++++++++++++++++------- ports/stm32f4/common-hal/busio/UART.h | 4 +- ports/stm32f4/mpconfigport.h | 2 + 3 files changed, 61 insertions(+), 19 deletions(-) diff --git a/ports/stm32f4/common-hal/busio/UART.c b/ports/stm32f4/common-hal/busio/UART.c index 2883974eb6..7eb1a4b1a2 100644 --- a/ports/stm32f4/common-hal/busio/UART.c +++ b/ports/stm32f4/common-hal/busio/UART.c @@ -40,8 +40,6 @@ STATIC bool reserved_uart[10]; -//TODO: remove this horrible hack -STATIC busio_uart_obj_t * context_pointers[10]; //numbered by uart module void uart_reset(void) { #ifdef USART1 @@ -110,8 +108,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, if(self->tx!=NULL && self->rx!=NULL) { USARTx = mcu_uart_banks[self->tx->uart_index-1]; mp_printf(&mp_plat_print, "UART:%d \n", self->tx->uart_index); - //TODO: remove this horrible hack - context_pointers[self->tx->uart_index-1] = self; + //assign a root pointer pointer for IRQ + MP_STATE_PORT(cpy_uart_obj_all)[self->tx->uart_index-1] = self; } else { if (uart_taken) { mp_raise_ValueError(translate("Hardware busy, try alternative pins")); @@ -136,8 +134,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, //handle typedef selection, errors if(self->rx!=NULL) { USARTx = mcu_uart_banks[self->rx->uart_index-1]; - //TODO: remove this horrible hack - context_pointers[self->rx->uart_index-1] = self; + //assign a root pointer pointer for IRQ + MP_STATE_PORT(cpy_uart_obj_all)[self->rx->uart_index-1] = self; } else { if (uart_taken) { mp_raise_ValueError(translate("Hardware busy, try alternative pins")); @@ -162,8 +160,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, //handle typedef selection, errors if(self->tx!=NULL) { USARTx = mcu_uart_banks[self->tx->uart_index-1]; - //TODO: remove this horrible hack - context_pointers[self->tx->uart_index-1] = self; + //assign a root pointer pointer for IRQ + MP_STATE_PORT(cpy_uart_obj_all)[self->tx->uart_index-1] = self; } else { if (uart_taken) { mp_raise_ValueError(translate("Hardware busy, try alternative pins")); @@ -207,24 +205,32 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, if(USARTx==USART1) { reserved_uart[0] = true; __HAL_RCC_USART1_CLK_ENABLE(); + HAL_NVIC_SetPriority(USART1_IRQn, 0, 1); + HAL_NVIC_EnableIRQ(USART1_IRQn); } #endif #ifdef UART2 if(USARTx==USART2) { reserved_uart[1] = true; __HAL_RCC_USART2_CLK_ENABLE(); + HAL_NVIC_SetPriority(USART2_IRQn, 0, 1); + HAL_NVIC_EnableIRQ(USART2_IRQn); } #endif #ifdef USART3 if(USARTx==USART3) { reserved_uart[2] = true; __HAL_RCC_USART3_CLK_ENABLE(); + HAL_NVIC_SetPriority(USART3_IRQn, 0, 1); + HAL_NVIC_EnableIRQ(USART3_IRQn); } #endif #ifdef UART4 if(USARTx==UART4) { reserved_uart[3] = true; __HAL_RCC_UART4_CLK_ENABLE(); + HAL_NVIC_SetPriority(UART4_IRQn, 0, 1); + HAL_NVIC_EnableIRQ(UART4_IRQn); } #endif #ifdef UART5 @@ -240,9 +246,6 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } #endif - HAL_NVIC_SetPriority(USART2_IRQn, 0, 1); - HAL_NVIC_EnableIRQ(USART2_IRQn); - //TODO: this technically needs to go to 10 to support F413. Condense? self->handle.Instance = USARTx; @@ -281,6 +284,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, if (HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1) != HAL_OK) { mp_raise_ValueError(translate("HAL recieve IT start error")); } + + //__HAL_UART_ENABLE_IT(&self->uart, UART_IT_RXNE); } bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { @@ -325,8 +330,6 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t if (HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1) != HAL_OK) { mp_raise_ValueError(translate("HAL recieve IT start error")); } - - mp_printf(&mp_plat_print, "bytes:%d, char:%c", rx_bytes, self->rx_char); if (rx_bytes == 0) { *errcode = EAGAIN; @@ -352,12 +355,12 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *handle) void HAL_UART_RxCpltCallback(UART_HandleTypeDef *handle) { - //TODO: I feel bad just writing this for(int i=0; i<7; i++) { - if(handle == &context_pointers[i]->handle) { - mp_raise_msg_varg(&mp_type_RuntimeError, translate("error = 0x%d ,%c"), i, &context_pointers[i]->rx_char); - ringbuf_put_n(&context_pointers[i]->rbuf, &context_pointers[i]->rx_char, 1); - HAL_UART_Receive_IT(handle, &context_pointers[i]->rx_char, 1); + //get context pointer and cast it as struct pointer + busio_uart_obj_t * context = (busio_uart_obj_t *)MP_STATE_PORT(cpy_uart_obj_all)[i]; + if(handle == &context->handle) { + ringbuf_put_n(&context->rbuf, &context->rx_char, 1); + HAL_UART_Receive_IT(handle, &context->rx_char, 1); return; } } @@ -402,3 +405,38 @@ void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) { bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) { return true; } + +static void call_hal_irq(int uart_num) { + //Create casted context pointer + busio_uart_obj_t * context = (busio_uart_obj_t *)MP_STATE_PORT(cpy_uart_obj_all)[uart_num-1]; + if(context != NULL) { + HAL_UART_IRQHandler(&context->handle); + } else { + mp_raise_ValueError(translate("UART IRQ bad handle supplied")); + } +} + +// UART/USART IRQ handlers +void USART1_IRQHandler(void) { + call_hal_irq(1); +} + +void USART2_IRQHandler(void) { + call_hal_irq(2); +} + +void USART3_IRQHandler(void) { + call_hal_irq(3); +} + +void UART4_IRQHandler(void) { + call_hal_irq(4); +} + +void UART5_IRQHandler(void) { + call_hal_irq(5); +} + +void USART6_IRQHandler(void) { + call_hal_irq(6); +} diff --git a/ports/stm32f4/common-hal/busio/UART.h b/ports/stm32f4/common-hal/busio/UART.h index 5d88ddd930..ee45d9b74c 100644 --- a/ports/stm32f4/common-hal/busio/UART.h +++ b/ports/stm32f4/common-hal/busio/UART.h @@ -50,6 +50,8 @@ typedef struct { void uart_reset(void); +void USART1_IRQHandler(void); void USART2_IRQHandler(void); - +void USART3_IRQHandler(void); +void UART_IRQHandler(void); #endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_UART_H diff --git a/ports/stm32f4/mpconfigport.h b/ports/stm32f4/mpconfigport.h index 543a55942e..080916be11 100644 --- a/ports/stm32f4/mpconfigport.h +++ b/ports/stm32f4/mpconfigport.h @@ -40,6 +40,8 @@ #include "py/circuitpy_mpconfig.h" #define MICROPY_PORT_ROOT_POINTERS \ + /* pointers to all 10 UART objects (if they have been created) */ \ + void *cpy_uart_obj_all[9]; \ CIRCUITPY_COMMON_ROOT_POINTERS #endif // __INCLUDED_MPCONFIGPORT_H From b4a6246e30200b78b2eb14ceda15d042205ea274 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Wed, 16 Oct 2019 12:32:34 -0400 Subject: [PATCH 013/189] Cleanup --- ports/stm32f4/common-hal/busio/UART.c | 28 ++++++++++++++++----------- ports/stm32f4/common-hal/busio/UART.h | 1 - 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/ports/stm32f4/common-hal/busio/UART.c b/ports/stm32f4/common-hal/busio/UART.c index 7eb1a4b1a2..826804ef67 100644 --- a/ports/stm32f4/common-hal/busio/UART.c +++ b/ports/stm32f4/common-hal/busio/UART.c @@ -45,26 +45,32 @@ void uart_reset(void) { #ifdef USART1 reserved_uart[0] = false; __HAL_RCC_USART1_CLK_DISABLE(); + HAL_NVIC_DisableIRQ(USART1_IRQn); #endif #ifdef USART2 reserved_uart[1] = false; __HAL_RCC_USART2_CLK_DISABLE(); + HAL_NVIC_DisableIRQ(USART2_IRQn); #endif #ifdef USART3 reserved_uart[2] = false; __HAL_RCC_USART3_CLK_DISABLE(); + HAL_NVIC_DisableIRQ(USART3_IRQn); #endif #ifdef UART4 reserved_uart[3] = false; __HAL_RCC_UART4_CLK_DISABLE(); + HAL_NVIC_DisableIRQ(UART4_IRQn); #endif #ifdef UART5 reserved_uart[4] = false; __HAL_RCC_UART5_CLK_DISABLE(); + HAL_NVIC_DisableIRQ(UART5_IRQn); #endif #ifdef USART6 reserved_uart[5] = false; __HAL_RCC_USART6_CLK_DISABLE(); + HAL_NVIC_DisableIRQ(USART6_IRQn); #endif //TODO: this technically needs to go to 10 to support F413. Any way to condense? } @@ -237,15 +243,18 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, if(USARTx==UART5) { reserved_uart[4] = true; __HAL_RCC_UART5_CLK_ENABLE(); + HAL_NVIC_SetPriority(UART5_IRQn, 0, 1); + HAL_NVIC_EnableIRQ(UART5_IRQn); } #endif #ifdef USART6 if(USARTx==USART6) { reserved_uart[5] = true; __HAL_RCC_USART6_CLK_ENABLE(); + HAL_NVIC_SetPriority(USART6_IRQn, 0, 1); + HAL_NVIC_EnableIRQ(USART6_IRQn); } #endif - //TODO: this technically needs to go to 10 to support F413. Condense? self->handle.Instance = USARTx; @@ -284,8 +293,6 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, if (HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1) != HAL_OK) { mp_raise_ValueError(translate("HAL recieve IT start error")); } - - //__HAL_UART_ENABLE_IT(&self->uart, UART_IT_RXNE); } bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { @@ -301,9 +308,9 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { // Read characters. size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t len, int *errcode) { - // if ( nrf_uarte_rx_pin_get(self->uarte->p_reg) == NRF_UARTE_PSEL_DISCONNECTED ) { - // mp_raise_ValueError(translate("No RX pin")); - // } + if (self->rx == NULL) { + mp_raise_ValueError(translate("No RX pin")); + } size_t rx_bytes = 0; uint64_t start_ticks = ticks_ms; @@ -340,6 +347,10 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t // Write characters. size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, size_t len, int *errcode) { + if (self->tx == NULL) { + mp_raise_ValueError(translate("No TX pin")); + } + if (HAL_UART_Transmit(&self->handle, (uint8_t *)data, len, 500) == HAL_OK) { return len; } else { @@ -348,11 +359,6 @@ size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, return 0; } -void HAL_UART_TxCpltCallback(UART_HandleTypeDef *handle) -{ - //not used at the moment. -} - void HAL_UART_RxCpltCallback(UART_HandleTypeDef *handle) { for(int i=0; i<7; i++) { diff --git a/ports/stm32f4/common-hal/busio/UART.h b/ports/stm32f4/common-hal/busio/UART.h index ee45d9b74c..3c746f64e2 100644 --- a/ports/stm32f4/common-hal/busio/UART.h +++ b/ports/stm32f4/common-hal/busio/UART.h @@ -45,7 +45,6 @@ typedef struct { uint32_t baudrate; uint32_t timeout_ms; - //bool tx_complete; } busio_uart_obj_t; void uart_reset(void); From 323fe418f734c235d32cc64f7b16fbb9e7c44d46 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Wed, 16 Oct 2019 13:14:57 -0400 Subject: [PATCH 014/189] Add support for other F4 MCUs --- .../peripherals/stm32f4/stm32f411xe/periph.c | 23 +++++++++++++++++ .../peripherals/stm32f4/stm32f411xe/periph.h | 7 ++++++ .../peripherals/stm32f4/stm32f412zx/periph.c | 25 +++++++++++++++++-- .../peripherals/stm32f4/stm32f412zx/periph.h | 4 +-- 4 files changed, 55 insertions(+), 4 deletions(-) diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.c b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.c index f0966f785f..6c70a56113 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.c +++ b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.c @@ -120,3 +120,26 @@ const mcu_spi_nss_obj_t mcu_spi_nss_list[12] = { }; //UART, Etc + +USART_TypeDef * mcu_uart_banks[6] = {USART1, USART2, NULL, NULL, NULL, USART6}; +bool mcu_uart_has_usart[6] = {true, true, false, false, false, true}; + +const mcu_uart_tx_obj_t mcu_uart_tx_list[7] = { + UART(2, 7, &pin_PA02), + UART(1, 7, &pin_PA09), + UART(1, 7, &pin_PA15), + UART(6, 8, &pin_PA11), + UART(1, 7, &pin_PB06), + UART(6, 8, &pin_PC06), + UART(2, 7, &pin_PD05), +}; + +const mcu_uart_rx_obj_t mcu_uart_rx_list[7] = { + UART(2, 7, &pin_PA03), + UART(1, 7, &pin_PA10), + UART(6, 8, &pin_PA12), + UART(1, 7, &pin_PB03), + UART(1, 7, &pin_PB07), + UART(6, 8, &pin_PC07), + UART(2, 7, &pin_PD06), +}; diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.h b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.h index 08efa14ca5..1d835bb3c6 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.h +++ b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.h @@ -41,4 +41,11 @@ extern const mcu_spi_mosi_obj_t mcu_spi_mosi_list[14]; extern const mcu_spi_miso_obj_t mcu_spi_miso_list[12]; extern const mcu_spi_nss_obj_t mcu_spi_nss_list[12]; +//UART +extern USART_TypeDef * mcu_uart_banks[6]; +bool mcu_uart_has_usart[6]; + +extern const mcu_uart_tx_obj_t mcu_uart_tx_list[7]; +extern const mcu_uart_rx_obj_t mcu_uart_rx_list[7]; + #endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H \ No newline at end of file diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.c b/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.c index 3936c0dc09..3d2454024a 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.c +++ b/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.c @@ -123,10 +123,31 @@ const mcu_spi_nss_obj_t mcu_spi_nss_list[12] = { USART_TypeDef * mcu_uart_banks[6] = {USART1, USART2, USART3, NULL, NULL, USART6}; bool mcu_uart_has_usart[6] = {true, true, true, false, false, true}; -const mcu_uart_tx_obj_t mcu_uart_tx_list[1] = { +const mcu_uart_tx_obj_t mcu_uart_tx_list[11] = { + UART(2, 7, &pin_PA02), + UART(1, 7, &pin_PA09), + UART(1, 7, &pin_PA15), + UART(6, 8, &pin_PA11), + UART(1, 7, &pin_PB06), + UART(3, 7, &pin_PB10), + UART(6, 8, &pin_PC06), + UART(3, 7, &pin_PC10), + UART(2, 7, &pin_PD05), + UART(3, 7, &pin_PD08), UART(6, 8, &pin_PG14), }; -const mcu_uart_rx_obj_t mcu_uart_rx_list[1] = { +const mcu_uart_rx_obj_t mcu_uart_rx_list[12] = { + UART(2, 7, &pin_PA03), + UART(1, 7, &pin_PA10), + UART(6, 8, &pin_PA12), + UART(1, 7, &pin_PB03), + UART(1, 7, &pin_PB07), + UART(3, 7, &pin_PB11), + UART(3, 7, &pin_PC05), + UART(6, 8, &pin_PC07), + UART(3, 7, &pin_PC11), + UART(2, 7, &pin_PD06), + UART(3, 7, &pin_PD09), UART(6, 8, &pin_PG09), }; diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.h b/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.h index afe7ac0dbe..72adaafd1d 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.h +++ b/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.h @@ -46,8 +46,8 @@ extern const mcu_spi_nss_obj_t mcu_spi_nss_list[12]; extern USART_TypeDef * mcu_uart_banks[6]; bool mcu_uart_has_usart[6]; -extern const mcu_uart_tx_obj_t mcu_uart_tx_list[1]; -extern const mcu_uart_rx_obj_t mcu_uart_rx_list[1]; +extern const mcu_uart_tx_obj_t mcu_uart_tx_list[11]; +extern const mcu_uart_rx_obj_t mcu_uart_rx_list[12]; #endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H \ No newline at end of file From 14c64159c8bd9b36f2054cff3f74f710ac679bd8 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Wed, 16 Oct 2019 13:50:54 -0400 Subject: [PATCH 015/189] Implement requested changes, refactors --- ports/stm32f4/common-hal/busio/UART.c | 248 +++++++++--------- ports/stm32f4/mpconfigport.h | 3 +- ports/stm32f4/peripherals/stm32f4/periph.h | 2 + .../peripherals/stm32f4/stm32f405xx/periph.c | 4 +- .../peripherals/stm32f4/stm32f405xx/periph.h | 4 +- .../peripherals/stm32f4/stm32f411xe/periph.c | 4 +- .../peripherals/stm32f4/stm32f411xe/periph.h | 4 +- .../peripherals/stm32f4/stm32f412zx/periph.c | 2 + .../peripherals/stm32f4/stm32f412zx/periph.h | 4 +- 9 files changed, 133 insertions(+), 142 deletions(-) diff --git a/ports/stm32f4/common-hal/busio/UART.c b/ports/stm32f4/common-hal/busio/UART.c index 826804ef67..1830e925e9 100644 --- a/ports/stm32f4/common-hal/busio/UART.c +++ b/ports/stm32f4/common-hal/busio/UART.c @@ -39,7 +39,7 @@ #include "stm32f4xx_hal.h" -STATIC bool reserved_uart[10]; +STATIC bool reserved_uart[MAX_UART]; void uart_reset(void) { #ifdef USART1 @@ -75,138 +75,23 @@ void uart_reset(void) { //TODO: this technically needs to go to 10 to support F413. Any way to condense? } -void common_hal_busio_uart_construct(busio_uart_obj_t *self, - const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, uint32_t baudrate, - uint8_t bits, uart_parity_t parity, uint8_t stop, mp_float_t timeout, - uint16_t receiver_buffer_size) { - - //match pins to UART objects - USART_TypeDef * USARTx; - - uint8_t tx_len = sizeof(mcu_uart_tx_list)/sizeof(*mcu_uart_tx_list); - uint8_t rx_len = sizeof(mcu_uart_rx_list)/sizeof(*mcu_uart_rx_list); - bool uart_taken = false; - - //Can have both pins, or either - //TODO: condense in some elegant clever way that I can't currently think of - if ((tx != mp_const_none) && (rx != mp_const_none)) { - //normal find loop if both pins exist - for(uint i=0; itx = &mcu_uart_tx_list[i]; - self->rx = &mcu_uart_rx_list[j]; - break; - } - } - } - } - //handle typedef selection, errors - if(self->tx!=NULL && self->rx!=NULL) { - USARTx = mcu_uart_banks[self->tx->uart_index-1]; - mp_printf(&mp_plat_print, "UART:%d \n", self->tx->uart_index); - //assign a root pointer pointer for IRQ - MP_STATE_PORT(cpy_uart_obj_all)[self->tx->uart_index-1] = self; - } else { - if (uart_taken) { - mp_raise_ValueError(translate("Hardware busy, try alternative pins")); - } else { - mp_raise_ValueError(translate("Invalid UART pin selection")); - } - } - } else if (tx==mp_const_none) { - //run only rx - for(uint i=0; irx = &mcu_uart_rx_list[i]; - break; - } - } - //handle typedef selection, errors - if(self->rx!=NULL) { - USARTx = mcu_uart_banks[self->rx->uart_index-1]; - //assign a root pointer pointer for IRQ - MP_STATE_PORT(cpy_uart_obj_all)[self->rx->uart_index-1] = self; - } else { - if (uart_taken) { - mp_raise_ValueError(translate("Hardware busy, try alternative pins")); - } else { - mp_raise_ValueError(translate("Invalid UART pin selection")); - } - } - } else if (rx==mp_const_none) { - //run only tx - for(uint i=0; itx = &mcu_uart_tx_list[i]; - break; - } - } - //handle typedef selection, errors - if(self->tx!=NULL) { - USARTx = mcu_uart_banks[self->tx->uart_index-1]; - //assign a root pointer pointer for IRQ - MP_STATE_PORT(cpy_uart_obj_all)[self->tx->uart_index-1] = self; - } else { - if (uart_taken) { - mp_raise_ValueError(translate("Hardware busy, try alternative pins")); - } else { - mp_raise_ValueError(translate("Invalid UART pin selection")); - } - } +STATIC USART_TypeDef * assign_uart_or_throw(busio_uart_obj_t *self, bool pin_eval, + int uart_index, bool uart_taken) { + if(pin_eval) { + //assign a root pointer pointer for IRQ + MP_STATE_PORT(cpy_uart_obj_all)[uart_index] = self; + return mcu_uart_banks[uart_index]; } else { - //both pins cannot be empty - mp_raise_ValueError(translate("You must supply at least one UART pin")); + if (uart_taken) { + mp_raise_ValueError(translate("Hardware busy, try alternative pins")); + } else { + mp_raise_ValueError(translate("Invalid UART pin selection")); + } } +} - //Other errors - if ( receiver_buffer_size == 0 ) { - mp_raise_ValueError(translate("Invalid buffer size")); - } - if ( bits != 8 && bits != 9 ) { - mp_raise_ValueError(translate("Invalid word/bit length")); - } - - //GPIO Init - GPIO_InitTypeDef GPIO_InitStruct = {0}; - if (self->tx!=NULL) { - GPIO_InitStruct.Pin = pin_mask(tx->number); - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_PULLUP; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = self->tx->altfn_index; - HAL_GPIO_Init(pin_port(tx->port), &GPIO_InitStruct); - } - if (self->rx!=NULL) { - GPIO_InitStruct.Pin = pin_mask(rx->number); - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_PULLUP; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = self->rx->altfn_index; - HAL_GPIO_Init(pin_port(rx->port), &GPIO_InitStruct); - } +STATIC void uart_clk_irq_enable(USART_TypeDef * USARTx) { #ifdef USART1 if(USARTx==USART1) { reserved_uart[0] = true; @@ -255,7 +140,109 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, HAL_NVIC_EnableIRQ(USART6_IRQn); } #endif - //TODO: this technically needs to go to 10 to support F413. Condense? +} + +void common_hal_busio_uart_construct(busio_uart_obj_t *self, + const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, uint32_t baudrate, + uint8_t bits, uart_parity_t parity, uint8_t stop, mp_float_t timeout, + uint16_t receiver_buffer_size) { + + //match pins to UART objects + USART_TypeDef * USARTx; + + uint8_t tx_len = sizeof(mcu_uart_tx_list)/sizeof(*mcu_uart_tx_list); + uint8_t rx_len = sizeof(mcu_uart_rx_list)/sizeof(*mcu_uart_rx_list); + bool uart_taken = false; + + //Can have both pins, or either + if ((tx != mp_const_none) && (rx != mp_const_none)) { + //normal find loop if both pins exist + for(uint i=0; itx = &mcu_uart_tx_list[i]; + self->rx = &mcu_uart_rx_list[j]; + break; + } + } + } + } + USARTx = assign_uart_or_throw(self, (self->tx!=NULL && self->rx!=NULL), + self->tx->uart_index-1, uart_taken); + } else if (tx==mp_const_none) { + //If there is no tx, run only rx + for(uint i=0; irx = &mcu_uart_rx_list[i]; + break; + } + } + USARTx = assign_uart_or_throw(self, (self->rx!=NULL), + self->rx->uart_index-1, uart_taken); + } else if (rx==mp_const_none) { + //If there is no rx, run only tx + for(uint i=0; itx = &mcu_uart_tx_list[i]; + break; + } + } + USARTx = assign_uart_or_throw(self, (self->tx!=NULL), + (self->tx->uart_index-1), uart_taken); + } else { + //both pins cannot be empty + mp_raise_ValueError(translate("You must supply at least one UART pin")); + } + + //Other errors + if ( receiver_buffer_size == 0 ) { + mp_raise_ValueError(translate("Invalid buffer size")); + } + if ( bits != 8 && bits != 9 ) { + mp_raise_ValueError(translate("Invalid word/bit length")); + } + + //GPIO Init + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if (self->tx!=NULL) { + GPIO_InitStruct.Pin = pin_mask(tx->number); + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = self->tx->altfn_index; + HAL_GPIO_Init(pin_port(tx->port), &GPIO_InitStruct); + } + if (self->rx!=NULL) { + GPIO_InitStruct.Pin = pin_mask(rx->number); + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = self->rx->altfn_index; + HAL_GPIO_Init(pin_port(rx->port), &GPIO_InitStruct); + } + + uart_clk_irq_enable(USARTx); self->handle.Instance = USARTx; self->handle.Init.BaudRate = baudrate; @@ -446,3 +433,4 @@ void UART5_IRQHandler(void) { void USART6_IRQHandler(void) { call_hal_irq(6); } + diff --git a/ports/stm32f4/mpconfigport.h b/ports/stm32f4/mpconfigport.h index 080916be11..6d9fe43765 100644 --- a/ports/stm32f4/mpconfigport.h +++ b/ports/stm32f4/mpconfigport.h @@ -40,8 +40,7 @@ #include "py/circuitpy_mpconfig.h" #define MICROPY_PORT_ROOT_POINTERS \ - /* pointers to all 10 UART objects (if they have been created) */ \ - void *cpy_uart_obj_all[9]; \ + void *cpy_uart_obj_all[6]; \ CIRCUITPY_COMMON_ROOT_POINTERS #endif // __INCLUDED_MPCONFIGPORT_H diff --git a/ports/stm32f4/peripherals/stm32f4/periph.h b/ports/stm32f4/peripherals/stm32f4/periph.h index 4e6276cfa1..9eda364e93 100644 --- a/ports/stm32f4/peripherals/stm32f4/periph.h +++ b/ports/stm32f4/peripherals/stm32f4/periph.h @@ -33,6 +33,8 @@ #include "stm32f4xx_hal.h" #include "stm32f4/pins.h" +#define MAX_UART 6 //how many UART are implemented + // I2C // TODO: these objects should be condensed into a single 'periph_pin' unless we // find a compelling reason to store more unique data in them. diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.c b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.c index c1c78b3bf8..e43a11d542 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.c +++ b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.c @@ -86,8 +86,8 @@ const mcu_spi_nss_obj_t mcu_spi_nss_list[6] = { SPI(3, 6, &pin_PA15), }; -USART_TypeDef * mcu_uart_banks[6] = {USART1, USART2, USART3, UART4, UART5, USART6}; -bool mcu_uart_has_usart[6] = {true, true, true, false, false, true}; +USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, USART3, UART4, UART5, USART6}; +bool mcu_uart_has_usart[MAX_UART] = {true, true, true, false, false, true}; const mcu_uart_tx_obj_t mcu_uart_tx_list[12] = { UART(4, 8, &pin_PA00), diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.h b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.h index 5ab7f025ea..4232b19469 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.h +++ b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.h @@ -42,8 +42,8 @@ extern const mcu_spi_miso_obj_t mcu_spi_miso_list[6]; extern const mcu_spi_nss_obj_t mcu_spi_nss_list[6]; //UART -extern USART_TypeDef * mcu_uart_banks[6]; -bool mcu_uart_has_usart[6]; +extern USART_TypeDef * mcu_uart_banks[MAX_UART]; +bool mcu_uart_has_usart[MAX_UART]; extern const mcu_uart_tx_obj_t mcu_uart_tx_list[12]; extern const mcu_uart_rx_obj_t mcu_uart_rx_list[12]; diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.c b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.c index 6c70a56113..75ec925d02 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.c +++ b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.c @@ -121,8 +121,8 @@ const mcu_spi_nss_obj_t mcu_spi_nss_list[12] = { //UART, Etc -USART_TypeDef * mcu_uart_banks[6] = {USART1, USART2, NULL, NULL, NULL, USART6}; -bool mcu_uart_has_usart[6] = {true, true, false, false, false, true}; +USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, NULL, NULL, NULL, USART6}; +bool mcu_uart_has_usart[MAX_UART] = {true, true, false, false, false, true}; const mcu_uart_tx_obj_t mcu_uart_tx_list[7] = { UART(2, 7, &pin_PA02), diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.h b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.h index 1d835bb3c6..8fe24ab94a 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.h +++ b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.h @@ -42,8 +42,8 @@ extern const mcu_spi_miso_obj_t mcu_spi_miso_list[12]; extern const mcu_spi_nss_obj_t mcu_spi_nss_list[12]; //UART -extern USART_TypeDef * mcu_uart_banks[6]; -bool mcu_uart_has_usart[6]; +extern USART_TypeDef * mcu_uart_banks[MAX_UART]; +bool mcu_uart_has_usart[MAX_UART]; extern const mcu_uart_tx_obj_t mcu_uart_tx_list[7]; extern const mcu_uart_rx_obj_t mcu_uart_rx_list[7]; diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.c b/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.c index 3d2454024a..adc607f5c9 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.c +++ b/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.c @@ -120,6 +120,8 @@ const mcu_spi_nss_obj_t mcu_spi_nss_list[12] = { SPI(5, 6, &pin_PE11) }; +//UART + USART_TypeDef * mcu_uart_banks[6] = {USART1, USART2, USART3, NULL, NULL, USART6}; bool mcu_uart_has_usart[6] = {true, true, true, false, false, true}; diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.h b/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.h index 72adaafd1d..1dac700c15 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.h +++ b/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.h @@ -43,8 +43,8 @@ extern const mcu_spi_miso_obj_t mcu_spi_miso_list[12]; extern const mcu_spi_nss_obj_t mcu_spi_nss_list[12]; //UART -extern USART_TypeDef * mcu_uart_banks[6]; -bool mcu_uart_has_usart[6]; +extern USART_TypeDef * mcu_uart_banks[MAX_UART]; +bool mcu_uart_has_usart[MAX_UART]; extern const mcu_uart_tx_obj_t mcu_uart_tx_list[11]; extern const mcu_uart_rx_obj_t mcu_uart_rx_list[12]; From af28474b06df405d423bb946e23fee720228ae50 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Fri, 18 Oct 2019 14:10:41 -0400 Subject: [PATCH 016/189] IRQ priority and port clearing scratchwork --- ports/stm32f4/common-hal/busio/UART.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/ports/stm32f4/common-hal/busio/UART.c b/ports/stm32f4/common-hal/busio/UART.c index 1830e925e9..bb6710473d 100644 --- a/ports/stm32f4/common-hal/busio/UART.c +++ b/ports/stm32f4/common-hal/busio/UART.c @@ -44,31 +44,37 @@ STATIC bool reserved_uart[MAX_UART]; void uart_reset(void) { #ifdef USART1 reserved_uart[0] = false; + MP_STATE_PORT(cpy_uart_obj_all)[0] = NULL; __HAL_RCC_USART1_CLK_DISABLE(); HAL_NVIC_DisableIRQ(USART1_IRQn); #endif #ifdef USART2 reserved_uart[1] = false; + MP_STATE_PORT(cpy_uart_obj_all)[1] = NULL; __HAL_RCC_USART2_CLK_DISABLE(); HAL_NVIC_DisableIRQ(USART2_IRQn); #endif #ifdef USART3 reserved_uart[2] = false; + MP_STATE_PORT(cpy_uart_obj_all)[2] = NULL; __HAL_RCC_USART3_CLK_DISABLE(); HAL_NVIC_DisableIRQ(USART3_IRQn); #endif #ifdef UART4 reserved_uart[3] = false; + MP_STATE_PORT(cpy_uart_obj_all)[3] = NULL; __HAL_RCC_UART4_CLK_DISABLE(); HAL_NVIC_DisableIRQ(UART4_IRQn); #endif #ifdef UART5 reserved_uart[4] = false; + MP_STATE_PORT(cpy_uart_obj_all)[4] = NULL; __HAL_RCC_UART5_CLK_DISABLE(); HAL_NVIC_DisableIRQ(UART5_IRQn); #endif #ifdef USART6 reserved_uart[5] = false; + MP_STATE_PORT(cpy_uart_obj_all)[5] = NULL; __HAL_RCC_USART6_CLK_DISABLE(); HAL_NVIC_DisableIRQ(USART6_IRQn); #endif @@ -96,7 +102,7 @@ STATIC void uart_clk_irq_enable(USART_TypeDef * USARTx) { if(USARTx==USART1) { reserved_uart[0] = true; __HAL_RCC_USART1_CLK_ENABLE(); - HAL_NVIC_SetPriority(USART1_IRQn, 0, 1); + //HAL_NVIC_SetPriority(USART1_IRQn, 0, 1); HAL_NVIC_EnableIRQ(USART1_IRQn); } #endif @@ -104,7 +110,7 @@ STATIC void uart_clk_irq_enable(USART_TypeDef * USARTx) { if(USARTx==USART2) { reserved_uart[1] = true; __HAL_RCC_USART2_CLK_ENABLE(); - HAL_NVIC_SetPriority(USART2_IRQn, 0, 1); + //HAL_NVIC_SetPriority(USART2_IRQn, 0, 1); HAL_NVIC_EnableIRQ(USART2_IRQn); } #endif @@ -112,7 +118,7 @@ STATIC void uart_clk_irq_enable(USART_TypeDef * USARTx) { if(USARTx==USART3) { reserved_uart[2] = true; __HAL_RCC_USART3_CLK_ENABLE(); - HAL_NVIC_SetPriority(USART3_IRQn, 0, 1); + //HAL_NVIC_SetPriority(USART3_IRQn, 0, 1); HAL_NVIC_EnableIRQ(USART3_IRQn); } #endif @@ -120,7 +126,7 @@ STATIC void uart_clk_irq_enable(USART_TypeDef * USARTx) { if(USARTx==UART4) { reserved_uart[3] = true; __HAL_RCC_UART4_CLK_ENABLE(); - HAL_NVIC_SetPriority(UART4_IRQn, 0, 1); + //HAL_NVIC_SetPriority(UART4_IRQn, 0, 1); HAL_NVIC_EnableIRQ(UART4_IRQn); } #endif @@ -128,7 +134,7 @@ STATIC void uart_clk_irq_enable(USART_TypeDef * USARTx) { if(USARTx==UART5) { reserved_uart[4] = true; __HAL_RCC_UART5_CLK_ENABLE(); - HAL_NVIC_SetPriority(UART5_IRQn, 0, 1); + //HAL_NVIC_SetPriority(UART5_IRQn, 0, 1); HAL_NVIC_EnableIRQ(UART5_IRQn); } #endif @@ -136,7 +142,7 @@ STATIC void uart_clk_irq_enable(USART_TypeDef * USARTx) { if(USARTx==USART6) { reserved_uart[5] = true; __HAL_RCC_USART6_CLK_ENABLE(); - HAL_NVIC_SetPriority(USART6_IRQn, 0, 1); + //HAL_NVIC_SetPriority(USART6_IRQn, 0, 1); HAL_NVIC_EnableIRQ(USART6_IRQn); } #endif From 7b79ac37399927070e1931022f5759393202ed3d Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 20 Oct 2019 23:50:12 -0400 Subject: [PATCH 017/189] Parameterize linker script --- main.c | 2 +- ports/atmel-samd/Makefile | 22 ++++- .../boards/arduino_mkr1300/mpconfigboard.h | 4 - .../boards/arduino_mkr1300/mpconfigboard.mk | 1 - .../boards/arduino_mkrzero/mpconfigboard.h | 4 - .../boards/arduino_mkrzero/mpconfigboard.mk | 1 - .../boards/arduino_zero/mpconfigboard.h | 4 - .../boards/arduino_zero/mpconfigboard.mk | 1 - .../boards/bast_pro_mini_m0/mpconfigboard.h | 3 +- .../boards/bast_pro_mini_m0/mpconfigboard.mk | 1 - .../capablerobot_usbhub/mpconfigboard.h | 9 -- .../capablerobot_usbhub/mpconfigboard.mk | 1 - .../boards/catwan_usbstick/mpconfigboard.h | 4 - .../boards/catwan_usbstick/mpconfigboard.mk | 1 - .../circuitplayground_express/mpconfigboard.h | 6 -- .../mpconfigboard.mk | 1 - .../mpconfigboard.h | 6 -- .../mpconfigboard.mk | 1 - .../mpconfigboard.h | 6 -- .../mpconfigboard.mk | 1 - ports/atmel-samd/boards/common.template.ld | 89 +++++++++++++++++++ .../atmel-samd/boards/cp32-m4/mpconfigboard.h | 8 -- .../boards/cp32-m4/mpconfigboard.mk | 1 - .../boards/datalore_ip_m4/mpconfigboard.h | 8 -- .../boards/datalore_ip_m4/mpconfigboard.mk | 1 - .../boards/datum_distance/mpconfigboard.h | 4 - .../boards/datum_distance/mpconfigboard.mk | 1 - .../boards/datum_imu/mpconfigboard.h | 4 - .../boards/datum_imu/mpconfigboard.mk | 1 - .../boards/datum_light/mpconfigboard.h | 4 - .../boards/datum_light/mpconfigboard.mk | 1 - .../boards/datum_weather/mpconfigboard.h | 4 - .../boards/datum_weather/mpconfigboard.mk | 1 - .../boards/escornabot_makech/mpconfigboard.h | 6 -- .../boards/escornabot_makech/mpconfigboard.mk | 1 - .../feather_m0_adalogger/mpconfigboard.h | 4 - .../feather_m0_adalogger/mpconfigboard.mk | 1 - .../boards/feather_m0_basic/mpconfigboard.h | 4 - .../boards/feather_m0_basic/mpconfigboard.mk | 1 - .../boards/feather_m0_express/mpconfigboard.h | 7 -- .../feather_m0_express/mpconfigboard.mk | 1 - .../mpconfigboard.h | 6 -- .../mpconfigboard.mk | 1 - .../boards/feather_m0_rfm69/mpconfigboard.h | 4 - .../boards/feather_m0_rfm69/mpconfigboard.mk | 1 - .../boards/feather_m0_rfm9x/mpconfigboard.h | 4 - .../boards/feather_m0_rfm9x/mpconfigboard.mk | 1 - .../feather_m0_supersized/mpconfigboard.h | 6 -- .../feather_m0_supersized/mpconfigboard.mk | 1 - .../boards/feather_m4_express/mpconfigboard.h | 8 -- .../feather_m4_express/mpconfigboard.mk | 1 - .../feather_radiofruit_zigbee/mpconfigboard.h | 6 -- .../mpconfigboard.mk | 1 - .../boards/gemma_m0/mpconfigboard.h | 4 - .../boards/gemma_m0/mpconfigboard.mk | 1 - .../grandcentral_m4_express/mpconfigboard.h | 8 -- .../grandcentral_m4_express/mpconfigboard.mk | 1 - .../hallowing_m0_express/mpconfigboard.h | 6 -- .../hallowing_m0_express/mpconfigboard.mk | 1 - .../hallowing_m4_express/mpconfigboard.h | 8 -- .../hallowing_m4_express/mpconfigboard.mk | 1 - .../itsybitsy_m0_express/mpconfigboard.h | 6 -- .../itsybitsy_m0_express/mpconfigboard.mk | 2 - .../itsybitsy_m4_express/mpconfigboard.h | 8 -- .../itsybitsy_m4_express/mpconfigboard.mk | 1 - .../boards/kicksat-sprite/mpconfigboard.h | 2 - .../boards/kicksat-sprite/mpconfigboard.mk | 1 - .../boards/meowmeow/mpconfigboard.h | 6 -- .../boards/meowmeow/mpconfigboard.mk | 1 - .../boards/metro_m0_express/mpconfigboard.h | 6 -- .../boards/metro_m0_express/mpconfigboard.mk | 1 - .../metro_m4_airlift_lite/mpconfigboard.h | 8 -- .../metro_m4_airlift_lite/mpconfigboard.mk | 1 - .../boards/metro_m4_express/mpconfigboard.h | 8 -- .../boards/metro_m4_express/mpconfigboard.mk | 1 - .../boards/mini_sam_m4/mpconfigboard.h | 8 -- .../boards/mini_sam_m4/mpconfigboard.mk | 1 - .../boards/monster_m4sk/mpconfigboard.h | 8 -- .../boards/monster_m4sk/mpconfigboard.mk | 1 - .../boards/pewpew10/mpconfigboard.h | 5 -- .../boards/pewpew10/mpconfigboard.mk | 1 - .../boards/pewpew_m4/mpconfigboard.h | 9 -- .../boards/pewpew_m4/mpconfigboard.mk | 1 - .../boards/pirkey_m0/mpconfigboard.h | 4 - .../boards/pirkey_m0/mpconfigboard.mk | 1 - .../atmel-samd/boards/pybadge/mpconfigboard.h | 8 -- .../boards/pybadge/mpconfigboard.mk | 1 - .../boards/pybadge_airlift/mpconfigboard.h | 8 -- .../boards/pybadge_airlift/mpconfigboard.mk | 1 - .../atmel-samd/boards/pygamer/mpconfigboard.h | 8 -- .../boards/pygamer/mpconfigboard.mk | 1 - .../boards/pygamer_advance/mpconfigboard.h | 8 -- .../boards/pygamer_advance/mpconfigboard.mk | 1 - .../boards/pyportal/mpconfigboard.h | 8 -- .../boards/pyportal/mpconfigboard.mk | 1 - .../boards/pyportal_titano/mpconfigboard.h | 8 -- .../boards/pyportal_titano/mpconfigboard.mk | 1 - .../atmel-samd/boards/pyruler/mpconfigboard.h | 4 - .../boards/pyruler/mpconfigboard.mk | 1 - .../boards/robohatmm1_m0/mpconfigboard.h | 8 -- .../boards/robohatmm1_m0/mpconfigboard.mk | 1 - .../boards/robohatmm1_m4/mpconfigboard.h | 8 -- .../boards/robohatmm1_m4/mpconfigboard.mk | 1 - ports/atmel-samd/boards/sam32/mpconfigboard.h | 5 +- .../atmel-samd/boards/sam32/mpconfigboard.mk | 1 - .../samd21x18-bootloader-crystalless.ld | 73 +-------------- ...8-bootloader-external-flash-crystalless.ld | 73 +-------------- .../samd21x18-bootloader-external-flash.ld | 73 +-------------- .../atmel-samd/boards/samd21x18-bootloader.ld | 73 +-------------- .../boards/samd21x18-external-flash.ld | 72 +-------------- ports/atmel-samd/boards/samd21x18.ld | 72 +-------------- .../samd51x18-bootloader-external-flash.ld | 73 +-------------- .../samd51x19-bootloader-external-flash.ld | 73 +-------------- .../atmel-samd/boards/samd51x19-bootloader.ld | 73 +-------------- .../samd51x20-bootloader-external-flash.ld | 73 +-------------- .../atmel-samd/boards/samd51x20-bootloader.ld | 74 +-------------- .../boards/samd51x20-external-flash.ld | 72 +-------------- ports/atmel-samd/boards/samd51x20.ld | 72 +-------------- .../boards/serpente/mpconfigboard.h | 7 -- .../boards/serpente/mpconfigboard.mk | 1 - .../boards/snekboard/mpconfigboard.h | 7 -- .../boards/snekboard/mpconfigboard.mk | 1 - .../boards/sparkfun_lumidrive/mpconfigboard.h | 4 - .../sparkfun_lumidrive/mpconfigboard.mk | 1 - .../sparkfun_redboard_turbo/mpconfigboard.h | 10 +-- .../sparkfun_redboard_turbo/mpconfigboard.mk | 1 - .../sparkfun_samd21_dev/mpconfigboard.h | 4 - .../sparkfun_samd21_dev/mpconfigboard.mk | 1 - .../sparkfun_samd21_mini/mpconfigboard.h | 4 - .../sparkfun_samd21_mini/mpconfigboard.mk | 1 - .../stringcar_m0_express/mpconfigboard.h | 7 -- .../stringcar_m0_express/mpconfigboard.mk | 2 - .../boards/trellis_m4_express/mpconfigboard.h | 8 -- .../trellis_m4_express/mpconfigboard.mk | 1 - .../boards/trinket_m0/mpconfigboard.h | 4 - .../boards/trinket_m0/mpconfigboard.mk | 2 +- .../trinket_m0_haxpress/mpconfigboard.h | 6 -- .../trinket_m0_haxpress/mpconfigboard.mk | 1 - ports/atmel-samd/boards/uchip/mpconfigboard.h | 4 +- .../atmel-samd/boards/uchip/mpconfigboard.mk | 1 - .../atmel-samd/boards/ugame10/mpconfigboard.h | 6 -- .../boards/ugame10/mpconfigboard.mk | 1 - .../common-hal/microcontroller/__init__.c | 1 - ports/atmel-samd/ld_defines.c | 14 +++ ports/atmel-samd/mpconfigport.h | 37 +++++++- ports/atmel-samd/mpconfigport.mk | 4 + ports/atmel-samd/tick.c | 2 +- ports/cxd56/tick.c | 2 +- ports/nrf/boards/adafruit_nrf52840_s140_v6.ld | 3 +- .../mpconfigboard.h | 6 -- ports/nrf/boards/common.ld | 4 + .../electronut_labs_blip/mpconfigboard.h | 6 -- .../electronut_labs_papyr/mpconfigboard.h | 6 -- .../feather_nrf52840_express/mpconfigboard.h | 6 -- .../makerdiary_nrf52840_mdk/mpconfigboard.h | 6 -- .../mpconfigboard.h | 6 -- .../metro_nrf52840_express/mpconfigboard.h | 6 -- .../nrf/boards/particle_argon/mpconfigboard.h | 6 -- .../nrf/boards/particle_boron/mpconfigboard.h | 6 -- .../nrf/boards/particle_xenon/mpconfigboard.h | 6 -- ports/nrf/boards/pca10056/mpconfigboard.h | 2 - ports/nrf/boards/pca10059/mpconfigboard.h | 2 - .../sparkfun_nrf52840_mini/mpconfigboard.h | 2 - ports/nrf/common-hal/_bleio/Adapter.c | 9 ++ .../nrf/common-hal/microcontroller/__init__.c | 5 +- ports/nrf/common-hal/nvm/ByteArray.c | 15 +--- ports/nrf/common-hal/nvm/ByteArray.h | 2 + ports/nrf/mpconfigport.h | 4 + ports/nrf/peripherals/nrf/nvm.h | 4 - ports/nrf/supervisor/internal_flash.c | 3 +- ports/nrf/tick.c | 2 +- .../boards/feather_f405/mpconfigboard.h | 3 - .../boards/pyboard_v11/mpconfigboard.h | 3 - .../stm32f411ve_discovery/mpconfigboard.h | 6 -- .../stm32f412zg_discovery/mpconfigboard.h | 4 - ports/stm32f4/tick.c | 2 +- py/circuitpy_defns.mk | 1 - py/circuitpy_mpconfig.h | 13 ++- tools/gen_ld_files.py | 47 ++++++++++ 179 files changed, 272 insertions(+), 1490 deletions(-) create mode 100644 ports/atmel-samd/boards/common.template.ld create mode 100644 ports/atmel-samd/ld_defines.c create mode 100755 tools/gen_ld_files.py diff --git a/main.c b/main.c index 6b56f5ff6f..4683bcf004 100755 --- a/main.c +++ b/main.c @@ -199,7 +199,7 @@ void cleanup_after_vm(supervisor_allocation* heap) { bool run_code_py(safe_mode_t safe_mode) { bool serial_connected_at_start = serial_connected(); - #ifdef CIRCUITPY_AUTORELOAD_DELAY_MS + #if CIRCUITPY_AUTORELOAD_DELAY_MS > 0 if (serial_connected_at_start) { serial_write("\n"); if (autoreload_is_enabled()) { diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 11e6874edd..16aed16158 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -292,12 +292,17 @@ SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) $(addprefix shared-module/, $(SRC_SHARED_MODULE)) \ $(addprefix shared-module/, $(SRC_SHARED_MODULE_INTERNAL)) +# There may be duplicates between SRC_COMMON_HAL_EXPANDED and SRC_SHARED_MODULE_EXPANDED, +# because a few modules have files both in common-hal/ and shared-modules/. +# Doing a $(sort ...) removes duplicates as part of sorting. +SRC_COMMON_HAL_SHARED_MODULE_EXPANDED = $(sort $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED)) + + SRC_S = supervisor/$(CHIP_FAMILY)_cpu.s OBJ = $(PY_O) $(SUPERVISOR_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_ASF:.c=.o)) -OBJ += $(addprefix $(BUILD)/, $(SRC_COMMON_HAL_EXPANDED:.c=.o)) -OBJ += $(addprefix $(BUILD)/, $(SRC_SHARED_MODULE_EXPANDED:.c=.o)) +OBJ += $(addprefix $(BUILD)/, $(SRC_COMMON_HAL_SHARED_MODULE_EXPANDED:.c=.o)) ifeq ($(INTERNAL_LIBM),1) OBJ += $(addprefix $(BUILD)/, $(SRC_LIBM:.c=.o)) endif @@ -310,9 +315,18 @@ SRC_QSTR_PREPROCESSOR += peripherals/samd/$(CHIP_FAMILY)/clocks.c all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2 -$(BUILD)/firmware.elf: $(OBJ) +LD_FILE = $(BUILD)/$(notdir $(patsubst %.template.ld,%.ld,$(LD_TEMPLATE_FILE))) + +# ld_defines.pp is generated from ld_defines.c. See py/mkrules.mk. +# Run gen_ld_files.py over ALL *.template.ld files, not just LD_TEMPLATE_FILE, +# because it may include other template files. +$(LD_FILE): $(BUILD)/ld_defines.pp boards/*.template.ld + $(STEPECHO) "GEN $@" + $(Q)$(PYTHON3) $(TOP)/tools/gen_ld_files.py --defines $< --out_dir $(BUILD) boards/*.template.ld + +$(BUILD)/firmware.elf: $(OBJ) $(LD_FILE) $(STEPECHO) "LINK $@" - $(Q)$(CC) -o $@ $(LDFLAGS) $^ -Wl,--start-group $(LIBS) -Wl,--end-group + $(Q)$(CC) -o $@ $(LDFLAGS) $(OBJ) -Wl,--start-group $(LIBS) -Wl,--end-group $(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(LD_FILE) $(BUILD)/firmware.bin: $(BUILD)/firmware.elf diff --git a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.h b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.h index a508d91913..226717c83b 100644 --- a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.h +++ b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.h @@ -7,10 +7,6 @@ #define MICROPY_HW_LED_STATUS (&pin_PB23) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA09) #define DEFAULT_I2C_BUS_SDA (&pin_PA08) diff --git a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk index a543468e52..bd682ade07 100644 --- a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x2341 USB_PID = 0x8053 USB_PRODUCT = "Arduino MKR1300" diff --git a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.h b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.h index 02750e6469..4871b1798b 100644 --- a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.h +++ b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.h @@ -5,10 +5,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA09) #define DEFAULT_I2C_BUS_SDA (&pin_PA08) diff --git a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk index 5612eb88d7..894b9b0110 100644 --- a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x8050 USB_PRODUCT = "Arduino MKRZero" diff --git a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.h b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.h index ec201e6ef5..bf2a68c57a 100644 --- a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.h +++ b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.h @@ -10,10 +10,6 @@ #define MICROPY_PORT_B (PORT_PB03) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk index cbbf15a3ef..f94ec13b7c 100644 --- a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x2341 USB_PID = 0x824D USB_PRODUCT = "Arduino Zero" diff --git a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.h b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.h index 561240c69a..cbfb11d200 100644 --- a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.h +++ b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.h @@ -5,6 +5,7 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) +// No microcontroller.nvm #define CIRCUITPY_INTERNAL_NVM_SIZE 0 #define DEFAULT_I2C_BUS_SCL (&pin_PA08) @@ -17,8 +18,6 @@ #define DEFAULT_UART_BUS_RX (&pin_PA01) #define DEFAULT_UART_BUS_TX (&pin_PA00) -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000) - #define IGNORE_PIN_PA03 1 #define IGNORE_PIN_PA12 1 #define IGNORE_PIN_PA13 1 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 08e42aa4ef..c3f0750a9e 100644 --- a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x1209 USB_PID = 0xBAB3 USB_PRODUCT = "Bast Pro Mini M0" diff --git a/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.h b/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.h index f4e40739b0..d359687e13 100644 --- a/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.h +++ b/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.h @@ -3,7 +3,6 @@ #define CIRCUITPY_MCU_FAMILY samd51 - #define MICROPY_HW_LED_STATUS (&pin_PA22) // These are pins not to reset. @@ -14,14 +13,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.mk b/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.mk index f390a8681a..0ff6f58eab 100644 --- a/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.mk +++ b/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x04D8 USB_PID = 0xEDB3 USB_PRODUCT = "Programmable USB Hub" diff --git a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.h b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.h index 7a32bf023f..b92c2a65e3 100644 --- a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.h +++ b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.h @@ -7,14 +7,10 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - #define DEFAULT_SPI_BUS_SCK (&pin_PA19) #define DEFAULT_SPI_BUS_MOSI (&pin_PA18) #define DEFAULT_SPI_BUS_MISO (&pin_PA22) -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define IGNORE_PIN_PA00 1 #define IGNORE_PIN_PA01 1 #define IGNORE_PIN_PA02 1 diff --git a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk index 2399aad5c5..adae4beb27 100644 --- a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk +++ b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x1209 USB_PID = 0xBAB2 USB_PRODUCT = "CatWAN USBStick" diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h index e6a7e06769..0ed5262ab5 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h @@ -22,12 +22,6 @@ #define SPEAKER_ENABLE_PIN (&pin_PA30) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk index 3c43776f5b..cdbdf44f80 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x239A USB_PID = 0x8019 USB_PRODUCT = "CircuitPlayground Express" diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h index ca6f9b7734..2db5129291 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h @@ -22,12 +22,6 @@ #define SPEAKER_ENABLE_PIN (&pin_PA30) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk index f456515f9a..a6ed28aa71 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x239A USB_PID = 0x8019 USB_PRODUCT = "CircuitPlayground Express with Crickit libraries" diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h index 333fc79f9b..a1d5b0a671 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h @@ -22,12 +22,6 @@ #define SPEAKER_ENABLE_PIN (&pin_PA30) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk index f0c9c6b8c4..b5a7c2424d 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x239A USB_PID = 0x8019 USB_PRODUCT = "CircuitPlayground Express with displayio" diff --git a/ports/atmel-samd/boards/common.template.ld b/ports/atmel-samd/boards/common.template.ld new file mode 100644 index 0000000000..e02bbfab02 --- /dev/null +++ b/ports/atmel-samd/boards/common.template.ld @@ -0,0 +1,89 @@ +/* Template for SAMD21/SAMD51 linking. dollar-sign-curly-bracket items are replaced with strings. */ + +/* Specify the memory areas */ +MEMORY +{ + /* CIRCUITPY_BOOTLOADER_SIZE is size of bootloader, if any. + * SAMD21 Arduino and UF2 bootloaders are 8KiB. SAMD51 UF2 is 6KiB. + * FLASH_SIZE is defined in ASF4. + * RAM_SIZE is defined in mpconfigport.h, from constants from ASF4. + * CIRCUITPY_INTERNAL_CONFIG_SIZE is size of an optional hidden config area, used currently + * for crystalless USB timing calibration. + * CIRCUITPY_INTERNAL_NVM_SIZE is the size of microntroller.nvm. + */ + FLASH (rx) : ORIGIN = 0x00000000 + ${BOOTLOADER_SIZE}, LENGTH = ${FLASH_SIZE} - ${BOOTLOADER_SIZE} - ${CIRCUITPY_INTERNAL_CONFIG_SIZE} - ${CIRCUITPY_INTERNAL_NVM_SIZE} + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = ${RAM_SIZE} +} + +/* top end of the stack */ +/* stack must be double-word (8 byte) aligned */ +_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; +_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; + +/* define output sections */ +SECTIONS +{ + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + _sfixed = .; + KEEP(*(.vectors)) /* isr vector table */ + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + + . = ALIGN(4); + } >FLASH + + .ARM.exidx : + { + *(.ARM.exidx*) + *(.gnu.linkonce.armexidx.*) + _etext = .; /* define a global symbol at end of code */ + _sidata = .; /* start of .data section */ + } > FLASH + + /* This is the initialized data section + The program executes knowing that the data is in the RAM + but the loader puts the initial values in the FLASH (inidata). + It is one task of the startup to copy the initial values from FLASH to RAM. */ + .data : AT ( _sidata ) + { + . = ALIGN(4); + _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialize the .data section in RAM */ + *(.ramfunc) + *(.ramfunc*) + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialize the .data section in RAM */ + } >RAM + + /* Uninitialized data section */ + .bss : + { + . = ALIGN(4); + _sbss = .; + _szero = .; /* define a global symbol at bss start; used by startup code */ + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ezero = .; /* define a global symbol at bss end; used by startup code */ + _ebss = .; + } >RAM + + /* this just checks there is enough RAM for the requested stack. */ + .stack : + { + . = ALIGN(4); + . = . + ${CIRCUITPY_DEFAULT_STACK_SIZE}; + . = ALIGN(4); + } >RAM + + .ARM.attributes 0 : { *(.ARM.attributes) } +} diff --git a/ports/atmel-samd/boards/cp32-m4/mpconfigboard.h b/ports/atmel-samd/boards/cp32-m4/mpconfigboard.h index 9e329b3ed9..8664a6a0ec 100644 --- a/ports/atmel-samd/boards/cp32-m4/mpconfigboard.h +++ b/ports/atmel-samd/boards/cp32-m4/mpconfigboard.h @@ -12,14 +12,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PB09) #define DEFAULT_I2C_BUS_SDA (&pin_PB08) diff --git a/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk b/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk index 86a7719b84..25ec501627 100644 --- a/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x20-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8021 USB_PRODUCT = "CP32-M4" diff --git a/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.h b/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.h index 99167d31bc..f560cfa493 100644 --- a/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.h +++ b/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.h @@ -20,14 +20,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PB03) diff --git a/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk b/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk index aa5f47d400..b2823e30c3 100644 --- a/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x4097 USB_PID = 0x0001 USB_PRODUCT = "Datalore IP M4" diff --git a/ports/atmel-samd/boards/datum_distance/mpconfigboard.h b/ports/atmel-samd/boards/datum_distance/mpconfigboard.h index e02e437805..74706ba040 100644 --- a/ports/atmel-samd/boards/datum_distance/mpconfigboard.h +++ b/ports/atmel-samd/boards/datum_distance/mpconfigboard.h @@ -10,10 +10,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk b/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk index a7bb8293d4..4f6c7ab82e 100644 --- a/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x04D8 USB_PID = 0xEE8C USB_PRODUCT = "datum-Distance" diff --git a/ports/atmel-samd/boards/datum_imu/mpconfigboard.h b/ports/atmel-samd/boards/datum_imu/mpconfigboard.h index b87739dd0e..3cc218f9e0 100644 --- a/ports/atmel-samd/boards/datum_imu/mpconfigboard.h +++ b/ports/atmel-samd/boards/datum_imu/mpconfigboard.h @@ -10,10 +10,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk b/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk index 507c83b041..336a1b832f 100644 --- a/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x04D8 USB_PID = 0xEE8D USB_PRODUCT = "datum-IMU" diff --git a/ports/atmel-samd/boards/datum_light/mpconfigboard.h b/ports/atmel-samd/boards/datum_light/mpconfigboard.h index 2a91c112dd..33e80d06d0 100644 --- a/ports/atmel-samd/boards/datum_light/mpconfigboard.h +++ b/ports/atmel-samd/boards/datum_light/mpconfigboard.h @@ -10,10 +10,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/datum_light/mpconfigboard.mk b/ports/atmel-samd/boards/datum_light/mpconfigboard.mk index 4bb227ba4e..7ec2efcf96 100644 --- a/ports/atmel-samd/boards/datum_light/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_light/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x04D8 USB_PID = 0xEE8E USB_PRODUCT = "datum-Light" diff --git a/ports/atmel-samd/boards/datum_weather/mpconfigboard.h b/ports/atmel-samd/boards/datum_weather/mpconfigboard.h index 45619197b9..328a6860c4 100644 --- a/ports/atmel-samd/boards/datum_weather/mpconfigboard.h +++ b/ports/atmel-samd/boards/datum_weather/mpconfigboard.h @@ -10,10 +10,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk b/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk index 411aee6254..d3ec1b0fdd 100644 --- a/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x04D8 USB_PID = 0xEE8F USB_PRODUCT = "datum-Weather" diff --git a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h index f27cb533b2..3a984188fa 100644 --- a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h +++ b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h @@ -8,12 +8,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. diff --git a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk index a2c182e683..dedd49ff71 100644 --- a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk +++ b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x1209 USB_PID = 0xBAB6 USB_PRODUCT = "Escornabot Makech" diff --git a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.h b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.h index eb1b905851..a0fde67ef6 100644 --- a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.h @@ -8,10 +8,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA22) #define DEFAULT_I2C_BUS_SDA (&pin_PA23) diff --git a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk index a88dbd563e..134abf7236 100644 --- a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x8015 USB_PRODUCT = "Feather M0 Adalogger" diff --git a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.h b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.h index a16cee0b4c..41a4bde212 100644 --- a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.h @@ -8,10 +8,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk index 076f1f8ff0..3643743509 100644 --- a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x8015 USB_PRODUCT = "Feather M0" diff --git a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.h b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.h index e6cd1c729b..5421dc8890 100644 --- a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.h @@ -15,13 +15,6 @@ #define MICROPY_PORT_B ( 0 ) #define MICROPY_PORT_C ( 0 ) - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PA23) diff --git a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk index 5b89f1be4f..cdee7b7946 100644 --- a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8023 USB_PRODUCT = "Feather M0 Express" diff --git a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.h b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.h index 77146889e5..ee61e1d87d 100644 --- a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.h @@ -15,12 +15,6 @@ #define MICROPY_PORT_B ( 0 ) #define MICROPY_PORT_C ( 0 ) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PA23) 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 5793d82e55..d5e03b49d4 100644 --- a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8023 USB_PRODUCT = "Feather M0 Express" diff --git a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.h b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.h index 19a5147587..2a319a4129 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.h @@ -8,10 +8,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk index 83d794d047..40a461b279 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x8015 USB_PRODUCT = "Feather M0 RFM69" diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.h b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.h index d3db098e54..850033dbe4 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.h @@ -8,10 +8,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk index a84e14f55f..736161047a 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x8015 USB_PRODUCT = "Feather M0 RFM9x" diff --git a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.h b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.h index 5ad265bf14..2d9f88e2e1 100644 --- a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.h @@ -17,12 +17,6 @@ #define MICROPY_PORT_B ( 0 ) #define MICROPY_PORT_C ( 0 ) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk index c5fef4373c..cb13adb76d 100644 --- a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8023 USB_PRODUCT = "Feather M0 Supersized" diff --git a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.h b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.h index f65ea8db78..ba16d17ee4 100644 --- a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.h @@ -16,14 +16,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define EXTERNAL_FLASH_QSPI_DUAL #define BOARD_HAS_CRYSTAL 1 diff --git a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk index 176ebac82c..d736941df3 100644 --- a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8026 USB_PRODUCT = "Feather M4 Express" diff --git a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.h b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.h index 7df31f3a93..2afe358178 100755 --- a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.h @@ -14,12 +14,6 @@ #define MICROPY_PORT_B ( 0 ) #define MICROPY_PORT_C ( 0 ) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PA13) diff --git a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk index c4a3a5a19e..05c305b1a2 100755 --- a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8023 USB_PRODUCT = "Feather RadioFruit Zigbee" diff --git a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.h b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.h index 5f09ab4d2f..b6d8f946bc 100644 --- a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.h +++ b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.h @@ -10,16 +10,12 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - #define DEFAULT_I2C_BUS_SCL (&pin_PA05) #define DEFAULT_I2C_BUS_SDA (&pin_PA04) #define DEFAULT_UART_BUS_RX (&pin_PA05) #define DEFAULT_UART_BUS_TX (&pin_PA04) -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define IGNORE_PIN_PA03 1 #define IGNORE_PIN_PA06 1 #define IGNORE_PIN_PA07 1 diff --git a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk index 6f44a22f84..d649386328 100644 --- a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x801D USB_PRODUCT = "Gemma M0" diff --git a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.h b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.h index bc8f5a134a..bab0550148 100644 --- a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.h @@ -21,14 +21,6 @@ #define MICROPY_PORT_C ( PORT_PC24 | PORT_PC30 | PORT_PC31 ) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PB21) diff --git a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk index 423761c3f7..49331a705d 100644 --- a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x20-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8032 USB_PRODUCT = "Grand Central M4 Express" diff --git a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.h b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.h index d5c2745009..e5ac346daf 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.h @@ -16,12 +16,6 @@ #define MICROPY_PORT_B ( PORT_PB22 | PORT_PB23 ) #define MICROPY_PORT_C ( 0 ) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA17) #define DEFAULT_I2C_BUS_SDA (&pin_PA16) diff --git a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk index 988d10d1cd..af4a5a2932 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0xD1ED USB_PRODUCT = "HalloWing M0 Express" diff --git a/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.h b/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.h index 654632db5d..a0c726e726 100644 --- a/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.h @@ -16,14 +16,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA13) #define DEFAULT_I2C_BUS_SDA (&pin_PA12) diff --git a/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk index 0d891abc82..9379ed3fe0 100644 --- a/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x804A USB_PRODUCT = "Hallowing M4 Express" diff --git a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.h b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.h index 6f9f661d94..db5e2a4df2 100644 --- a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.h @@ -16,12 +16,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk index 2b64e90275..4d516c75b6 100644 --- a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x239A USB_PID = 0x8012 USB_PRODUCT = "ItsyBitsy M0 Express" @@ -21,4 +20,3 @@ CIRCUITPY_RTC = 0 CFLAGS_INLINE_LIMIT = 60 SUPEROPT_GC = 0 - diff --git a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.h b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.h index 9e4d4a10c9..98920b54f2 100644 --- a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.h @@ -17,14 +17,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA13) #define DEFAULT_I2C_BUS_SDA (&pin_PA12) diff --git a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk index 5cab5bf43a..7ce45d0a1a 100644 --- a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x802C USB_PRODUCT = "ItsyBitsy M4 Express" diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h index 194542b055..6664524d24 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h @@ -14,8 +14,6 @@ #define CIRCUITPY_INTERNAL_NVM_SIZE 0 -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - 0x010000) - #define DEFAULT_I2C_BUS_SCL (&pin_PA17) #define DEFAULT_I2C_BUS_SDA (&pin_PA16) diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index 706e551c5d..6d6571a2ae 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader.ld USB_VID = 0x04D8 USB_PID = 0xED94 USB_PRODUCT = "kicksat-sprite" diff --git a/ports/atmel-samd/boards/meowmeow/mpconfigboard.h b/ports/atmel-samd/boards/meowmeow/mpconfigboard.h index 1304b6dfbf..80d3678630 100644 --- a/ports/atmel-samd/boards/meowmeow/mpconfigboard.h +++ b/ports/atmel-samd/boards/meowmeow/mpconfigboard.h @@ -8,12 +8,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. diff --git a/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk b/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk index 894e19a6bb..4b452ecbfe 100644 --- a/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk +++ b/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x1209 USB_PID = 0xBAB1 USB_PRODUCT = "Meow Meow" diff --git a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.h b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.h index bfa254b95e..04565feb40 100644 --- a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.h @@ -21,12 +21,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PA23) diff --git a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk index d3f35ba8b0..b52b1343fb 100644 --- a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8014 USB_PRODUCT = "Metro M0 Express" diff --git a/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.h b/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.h index e89b0322a1..9fa4018046 100644 --- a/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.h +++ b/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.h @@ -18,14 +18,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PB03) diff --git a/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk index 98d85ba826..78e27b422f 100644 --- a/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8038 USB_PRODUCT = "Metro M4 Airlift Lite" diff --git a/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.h b/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.h index 2a8878874d..7f8dbb1d2b 100644 --- a/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.h @@ -20,14 +20,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PB03) diff --git a/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk index 68b6f64065..4f01f3edd1 100644 --- a/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8021 USB_PRODUCT = "Metro M4 Express" diff --git a/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.h b/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.h index c4563964f8..08ab7e16b9 100644 --- a/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.h +++ b/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.h @@ -17,14 +17,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA13) #define DEFAULT_I2C_BUS_SDA (&pin_PA12) diff --git a/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk b/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk index 4bd1d6e522..eedfd2ecca 100644 --- a/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x1209 USB_PID = 0x2017 USB_PRODUCT = "Mini SAM M4" diff --git a/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.h b/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.h index fc77520f5f..42fb4548e0 100644 --- a/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.h +++ b/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.h @@ -13,14 +13,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA01) #define DEFAULT_I2C_BUS_SDA (&pin_PA00) diff --git a/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk b/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk index a3db7dc890..e61f3d2403 100644 --- a/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk +++ b/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8048 USB_PRODUCT = "Monster M4SK" diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.h b/ports/atmel-samd/boards/pewpew10/mpconfigboard.h index 445ccc4355..6b3b4aa15c 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.h +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.h @@ -5,11 +5,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - - #define IGNORE_PIN_PB00 1 #define IGNORE_PIN_PB01 1 #define IGNORE_PIN_PB02 1 diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk index e24a290519..c9aa26e3c8 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x801D USB_PRODUCT = "PewPew 10.2" diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.h b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.h index 1b3035e120..60cd8d754f 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.h +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.h @@ -9,14 +9,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA01) #define DEFAULT_I2C_BUS_SDA (&pin_PA00) @@ -48,4 +40,3 @@ #define IGNORE_PIN_PB09 1 #define IGNORE_PIN_PB10 1 #define IGNORE_PIN_PB11 1 - diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk index 54ec3d1d0e..af7e3fb16c 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader.ld USB_VID = 0x1d50 USB_PID = 0x60e8 USB_PRODUCT = "PewPew M4" diff --git a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.h b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.h index 5a8eb9d147..866e21991b 100644 --- a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.h +++ b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.h @@ -8,10 +8,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define IGNORE_PIN_PA02 1 #define IGNORE_PIN_PA03 1 #define IGNORE_PIN_PA04 1 diff --git a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk index 686c9099fc..c5b2c9eb58 100644 --- a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x8028 USB_PRODUCT = "pIRKey M0" diff --git a/ports/atmel-samd/boards/pybadge/mpconfigboard.h b/ports/atmel-samd/boards/pybadge/mpconfigboard.h index 36115bc873..435185322a 100644 --- a/ports/atmel-samd/boards/pybadge/mpconfigboard.h +++ b/ports/atmel-samd/boards/pybadge/mpconfigboard.h @@ -14,14 +14,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA13) #define DEFAULT_I2C_BUS_SDA (&pin_PA12) diff --git a/ports/atmel-samd/boards/pybadge/mpconfigboard.mk b/ports/atmel-samd/boards/pybadge/mpconfigboard.mk index 7e2cb64398..05df09627c 100644 --- a/ports/atmel-samd/boards/pybadge/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pybadge/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8034 USB_PRODUCT = "PyBadge" diff --git a/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.h b/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.h index ade74786d3..229cfa3354 100644 --- a/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.h +++ b/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.h @@ -14,14 +14,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA13) #define DEFAULT_I2C_BUS_SDA (&pin_PA12) diff --git a/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.mk b/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.mk index 7e77b0feaf..242722870a 100644 --- a/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8043 USB_PRODUCT = "PyBadge AirLift" diff --git a/ports/atmel-samd/boards/pygamer/mpconfigboard.h b/ports/atmel-samd/boards/pygamer/mpconfigboard.h index 4720b22eb1..102c259567 100644 --- a/ports/atmel-samd/boards/pygamer/mpconfigboard.h +++ b/ports/atmel-samd/boards/pygamer/mpconfigboard.h @@ -13,14 +13,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA13) #define DEFAULT_I2C_BUS_SDA (&pin_PA12) diff --git a/ports/atmel-samd/boards/pygamer/mpconfigboard.mk b/ports/atmel-samd/boards/pygamer/mpconfigboard.mk index 0fce468d9f..70109e332e 100644 --- a/ports/atmel-samd/boards/pygamer/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pygamer/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x803E USB_PRODUCT = "PyGamer" diff --git a/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.h b/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.h index c05aa4f062..fbe946b72f 100644 --- a/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.h +++ b/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.h @@ -13,14 +13,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA13) #define DEFAULT_I2C_BUS_SDA (&pin_PA12) diff --git a/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.mk b/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.mk index 8711738d4f..7f3207ecd0 100644 --- a/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x803E USB_PRODUCT = "PyGamer Advance" diff --git a/ports/atmel-samd/boards/pyportal/mpconfigboard.h b/ports/atmel-samd/boards/pyportal/mpconfigboard.h index 43346488ba..2c4cf4f580 100644 --- a/ports/atmel-samd/boards/pyportal/mpconfigboard.h +++ b/ports/atmel-samd/boards/pyportal/mpconfigboard.h @@ -17,14 +17,6 @@ #define MICROPY_PORT_C ( 0 ) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PB03) #define DEFAULT_I2C_BUS_SDA (&pin_PB02) diff --git a/ports/atmel-samd/boards/pyportal/mpconfigboard.mk b/ports/atmel-samd/boards/pyportal/mpconfigboard.mk index f763c74fa4..149141a4e3 100644 --- a/ports/atmel-samd/boards/pyportal/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pyportal/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x20-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8036 USB_PRODUCT = "PyPortal" diff --git a/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.h b/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.h index 91c1188108..c463b56616 100644 --- a/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.h +++ b/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.h @@ -16,14 +16,6 @@ #define MICROPY_PORT_C ( 0 ) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PB03) #define DEFAULT_I2C_BUS_SDA (&pin_PB02) diff --git a/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.mk b/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.mk index 58b363779c..dbc2d5ae99 100644 --- a/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x20-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8054 USB_PRODUCT = "PyPortal Titano" diff --git a/ports/atmel-samd/boards/pyruler/mpconfigboard.h b/ports/atmel-samd/boards/pyruler/mpconfigboard.h index 171873b47c..4d0586d912 100644 --- a/ports/atmel-samd/boards/pyruler/mpconfigboard.h +++ b/ports/atmel-samd/boards/pyruler/mpconfigboard.h @@ -10,10 +10,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define IGNORE_PIN_PA12 1 #define IGNORE_PIN_PA13 1 #define IGNORE_PIN_PA16 1 diff --git a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk index 9663944a38..220e48872a 100644 --- a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x804C USB_PRODUCT = "PyRuler" diff --git a/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.h b/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.h index c6856c68f8..68991f9974 100644 --- a/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.h +++ b/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.h @@ -17,13 +17,6 @@ #define MICROPY_PORT_B ( 0 ) #define MICROPY_PORT_C ( 0 ) - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define CALIBRATE_CRYSTALLESS 1 #define DEFAULT_I2C_BUS_SCL (&pin_PA23) @@ -39,4 +32,3 @@ // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 - diff --git a/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.mk b/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.mk index e703fbfb9f..29cca569e6 100644 --- a/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x1209 USB_PID = 0x4D43 USB_PRODUCT = "Robo HAT MM1 M0" diff --git a/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.h b/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.h index 64040a6586..c66873aeb2 100644 --- a/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.h +++ b/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.h @@ -21,14 +21,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk b/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk index 56f1617dbf..b2ea18e5f2 100644 --- a/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x1209 USB_PID = 0x4D43 USB_PRODUCT = "Robo HAT MM1 M4" diff --git a/ports/atmel-samd/boards/sam32/mpconfigboard.h b/ports/atmel-samd/boards/sam32/mpconfigboard.h index f6d3fb6b46..3c6f52ebcc 100644 --- a/ports/atmel-samd/boards/sam32/mpconfigboard.h +++ b/ports/atmel-samd/boards/sam32/mpconfigboard.h @@ -11,12 +11,9 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - +// No microcontroller.nvm #define CIRCUITPY_INTERNAL_NVM_SIZE 0 -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - 0x010000) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PA04) diff --git a/ports/atmel-samd/boards/sam32/mpconfigboard.mk b/ports/atmel-samd/boards/sam32/mpconfigboard.mk index 12884a9cc8..0d6be64374 100644 --- a/ports/atmel-samd/boards/sam32/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sam32/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x20-bootloader.ld USB_VID = 0x04D8 USB_PID = 0xEDBE USB_PRODUCT = "SAM32" diff --git a/ports/atmel-samd/boards/samd21x18-bootloader-crystalless.ld b/ports/atmel-samd/boards/samd21x18-bootloader-crystalless.ld index 2adf4fa909..1ee745eb17 100644 --- a/ports/atmel-samd/boards/samd21x18-bootloader-crystalless.ld +++ b/ports/atmel-samd/boards/samd21x18-bootloader-crystalless.ld @@ -10,75 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K } -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialize the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialize the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 2K; /* Reserve a minimum of 2K for the stack. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd21x18-bootloader-external-flash-crystalless.ld b/ports/atmel-samd/boards/samd21x18-bootloader-external-flash-crystalless.ld index bddaae99da..d8f4cc2365 100644 --- a/ports/atmel-samd/boards/samd21x18-bootloader-external-flash-crystalless.ld +++ b/ports/atmel-samd/boards/samd21x18-bootloader-external-flash-crystalless.ld @@ -10,75 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K } -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 2K; /* Reserve a minimum of 2K for the stack. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd21x18-bootloader-external-flash.ld b/ports/atmel-samd/boards/samd21x18-bootloader-external-flash.ld index 4e677a079f..f663326d69 100644 --- a/ports/atmel-samd/boards/samd21x18-bootloader-external-flash.ld +++ b/ports/atmel-samd/boards/samd21x18-bootloader-external-flash.ld @@ -10,75 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K /* 32 KiB RAM */ } -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _etext ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 2K; /* Reserve a minimum of 2K for the stack. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd21x18-bootloader.ld b/ports/atmel-samd/boards/samd21x18-bootloader.ld index 2ef09ba9af..666ac79c47 100644 --- a/ports/atmel-samd/boards/samd21x18-bootloader.ld +++ b/ports/atmel-samd/boards/samd21x18-bootloader.ld @@ -11,75 +11,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K } -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialize the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialize the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 2K; /* Reserve a minimum of 2K for the stack. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd21x18-external-flash.ld b/ports/atmel-samd/boards/samd21x18-external-flash.ld index a540bfde2a..6afdab7345 100644 --- a/ports/atmel-samd/boards/samd21x18-external-flash.ld +++ b/ports/atmel-samd/boards/samd21x18-external-flash.ld @@ -10,74 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K } -/* top end of the stack */ -_estack = ORIGIN(RAM) + LENGTH(RAM); -_bootloader_dbl_tap = 0; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 2K; /* Reserve a minimum of 2K for the stack. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd21x18.ld b/ports/atmel-samd/boards/samd21x18.ld index 139be86bb2..c035f5117e 100644 --- a/ports/atmel-samd/boards/samd21x18.ld +++ b/ports/atmel-samd/boards/samd21x18.ld @@ -10,74 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K } -/* top end of the stack */ -_estack = ORIGIN(RAM) + LENGTH(RAM); -_bootloader_dbl_tap = 0; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - -/* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 2K; /* Reserve a minimum of 2K for the stack. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd51x18-bootloader-external-flash.ld b/ports/atmel-samd/boards/samd51x18-bootloader-external-flash.ld index c0e812ce19..b22bef3f3a 100644 --- a/ports/atmel-samd/boards/samd51x18-bootloader-external-flash.ld +++ b/ports/atmel-samd/boards/samd51x18-bootloader-external-flash.ld @@ -10,75 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K } -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 10K; /* Reserve a minimum of 10K for the stack. nvm will temporarily store 8k on the stack when writing. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x19-bootloader-external-flash.ld b/ports/atmel-samd/boards/samd51x19-bootloader-external-flash.ld index 253a764c9b..f1493f2510 100644 --- a/ports/atmel-samd/boards/samd51x19-bootloader-external-flash.ld +++ b/ports/atmel-samd/boards/samd51x19-bootloader-external-flash.ld @@ -10,75 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 192K } -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 10K; /* Reserve a minimum of 10K for the stack. nvm will temporarily store 8k on the stack when writing. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x19-bootloader.ld b/ports/atmel-samd/boards/samd51x19-bootloader.ld index 56786a37af..c73db2ece9 100644 --- a/ports/atmel-samd/boards/samd51x19-bootloader.ld +++ b/ports/atmel-samd/boards/samd51x19-bootloader.ld @@ -10,75 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 192K } -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 10K; /* Reserve a minimum of 10K for the stack. nvm will temporarily store 8k on the stack when writing. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x20-bootloader-external-flash.ld b/ports/atmel-samd/boards/samd51x20-bootloader-external-flash.ld index 598915b1b7..ee28fdf1cc 100644 --- a/ports/atmel-samd/boards/samd51x20-bootloader-external-flash.ld +++ b/ports/atmel-samd/boards/samd51x20-bootloader-external-flash.ld @@ -10,75 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K } -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 10K; /* Reserve a minimum of 10K for the stack. nvm will temporarily store 8k on the stack when writing. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x20-bootloader.ld b/ports/atmel-samd/boards/samd51x20-bootloader.ld index 49d4d87914..ea0e0569f5 100644 --- a/ports/atmel-samd/boards/samd51x20-bootloader.ld +++ b/ports/atmel-samd/boards/samd51x20-bootloader.ld @@ -9,76 +9,4 @@ MEMORY FLASH (rx) : ORIGIN = 0x00000000 + 16K, LENGTH = 1M - 16K - 512K - 8K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K } - -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 10K; /* Reserve a minimum of 10K for the stack. nvm will temporarily store 8k on the stack when writing. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x20-external-flash.ld b/ports/atmel-samd/boards/samd51x20-external-flash.ld index d3ed90476e..5212363fe1 100644 --- a/ports/atmel-samd/boards/samd51x20-external-flash.ld +++ b/ports/atmel-samd/boards/samd51x20-external-flash.ld @@ -9,74 +9,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K } -/* top end of the stack */ -_estack = ORIGIN(RAM) + LENGTH(RAM); -_bootloader_dbl_tap = 0; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 10K; /* Reserve a minimum of 10K for the stack. nvm will temporarily store 8k on the stack when writing. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x20.ld b/ports/atmel-samd/boards/samd51x20.ld index e203c5b7a9..1f0b661720 100644 --- a/ports/atmel-samd/boards/samd51x20.ld +++ b/ports/atmel-samd/boards/samd51x20.ld @@ -10,74 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K } -/* top end of the stack */ -_estack = ORIGIN(RAM) + LENGTH(RAM); -_bootloader_dbl_tap = 0; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 10K; /* Reserve a minimum of 10K for the stack. nvm will temporarily store 8k on the stack when writing. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/serpente/mpconfigboard.h b/ports/atmel-samd/boards/serpente/mpconfigboard.h index 034e1f6c37..515bc14410 100644 --- a/ports/atmel-samd/boards/serpente/mpconfigboard.h +++ b/ports/atmel-samd/boards/serpente/mpconfigboard.h @@ -13,12 +13,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA09) #define DEFAULT_I2C_BUS_SDA (&pin_PA08) @@ -36,4 +30,3 @@ // Not connected #define IGNORE_PIN_PA13 1 #define IGNORE_PIN_PA28 1 - diff --git a/ports/atmel-samd/boards/serpente/mpconfigboard.mk b/ports/atmel-samd/boards/serpente/mpconfigboard.mk index 98e1e37297..a5adb17a1e 100644 --- a/ports/atmel-samd/boards/serpente/mpconfigboard.mk +++ b/ports/atmel-samd/boards/serpente/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x239A USB_PID = 0x8058 USB_PRODUCT = "Serpente" diff --git a/ports/atmel-samd/boards/snekboard/mpconfigboard.h b/ports/atmel-samd/boards/snekboard/mpconfigboard.h index a349143d91..1c0804fe72 100644 --- a/ports/atmel-samd/boards/snekboard/mpconfigboard.h +++ b/ports/atmel-samd/boards/snekboard/mpconfigboard.h @@ -15,13 +15,6 @@ #define MICROPY_PORT_B ( 0 ) #define MICROPY_PORT_C ( 0 ) - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 0 #define DEFAULT_I2C_BUS_SCL (&pin_PA08) /* ANALOG 5 */ diff --git a/ports/atmel-samd/boards/snekboard/mpconfigboard.mk b/ports/atmel-samd/boards/snekboard/mpconfigboard.mk index db2e511abf..4faa041b1b 100644 --- a/ports/atmel-samd/boards/snekboard/mpconfigboard.mk +++ b/ports/atmel-samd/boards/snekboard/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x804E USB_PRODUCT = "snekboard" diff --git a/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.h b/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.h index 80cacfa9b0..d184945f35 100755 --- a/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.h +++ b/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.h @@ -13,10 +13,6 @@ #define MICROPY_PORT_B ( 0 ) #define MICROPY_PORT_C ( 0 ) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 //I2C diff --git a/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk index 9d0ef1c040..6a2afc306e 100755 --- a/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x1B4F USB_PID = 0x0017 USB_PRODUCT = "LUMIDrive Board" diff --git a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.h b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.h index cf7c3998bb..ae272d502b 100755 --- a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.h +++ b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.h @@ -15,20 +15,12 @@ #define SPI_FLASH_SCK_PIN &pin_PB23 #define SPI_FLASH_CS_PIN &pin_PA13 -#define MICROPY_PORT_A ( 0 ) +#define MICROPY_PORT_A ( 0 ) #define MICROPY_PORT_B ( 0 ) #define MICROPY_PORT_C ( 0 ) - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 - // I2C - also QWIIC #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk index e80ef62771..f2d4eccad9 100755 --- a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x1B4F USB_PID = 0x0015 USB_PRODUCT = "RedBoard Turbo Board" diff --git a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.h b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.h index a50c61cf2d..13bb263803 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.h +++ b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.h @@ -5,10 +5,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk index c9d0baf11f..0c33ef960e 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x1B4F USB_PID = 0x8D23 USB_PRODUCT = "SparkFun SAMD21 Dev Breakout" diff --git a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.h b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.h index 6af7fa1918..2cfdd9e73b 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.h +++ b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.h @@ -5,10 +5,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk index a6e216575e..d09785fb8a 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x1B4F USB_PID = 0x8D22 USB_PRODUCT = "SparkFun SAMD21 Mini Breakout" diff --git a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.h b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.h index 34ab8fcfbc..02a6e7f7ce 100644 --- a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.h @@ -16,12 +16,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA05) #define DEFAULT_I2C_BUS_SDA (&pin_PA04) @@ -47,4 +41,3 @@ #define IGNORE_PIN_PA28 1 #define IGNORE_PIN_PA30 1 #define IGNORE_PIN_PA31 1 - diff --git a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk index 17de6ac742..92129eb63f 100644 --- a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x239A USB_PID = 0x8060 USB_PRODUCT = "StringCar M0 Express" @@ -21,4 +20,3 @@ CIRCUITPY_RTC = 0 CFLAGS_INLINE_LIMIT = 60 SUPEROPT_GC = 0 - diff --git a/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.h b/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.h index 8ca1df1621..96b38810c3 100644 --- a/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.h @@ -16,14 +16,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PB08) #define DEFAULT_I2C_BUS_SDA (&pin_PB09) diff --git a/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk index ec37186c3a..3795208724 100644 --- a/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8030 USB_PRODUCT = "Trellis M4 Express" diff --git a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.h b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.h index dd8bc03ccf..69517534ee 100644 --- a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.h +++ b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.h @@ -11,10 +11,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define IGNORE_PIN_PA03 1 #define IGNORE_PIN_PA04 1 #define IGNORE_PIN_PA11 1 diff --git a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk index b4a00b654a..0d41fa4bd7 100644 --- a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk @@ -1,4 +1,4 @@ -LD_FILE = boards/samd21x18-bootloader.ld +LD_TEMPLATE_FILE = boards/common.template.ld USB_VID = 0x239A USB_PID = 0x801F USB_PRODUCT = "Trinket M0" diff --git a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.h b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.h index 369d84b8b8..af473b1288 100644 --- a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.h +++ b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.h @@ -18,12 +18,6 @@ #define CALIBRATE_CRYSTALLESS 1 -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA09) #define DEFAULT_I2C_BUS_SDA (&pin_PA08) diff --git a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk index c20358e19f..bd6c9c9ff7 100644 --- a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x239A USB_PID = 0x801F USB_PRODUCT="Trinket M0 Haxpress" diff --git a/ports/atmel-samd/boards/uchip/mpconfigboard.h b/ports/atmel-samd/boards/uchip/mpconfigboard.h index 6dcaf2965c..1877a41ef9 100644 --- a/ports/atmel-samd/boards/uchip/mpconfigboard.h +++ b/ports/atmel-samd/boards/uchip/mpconfigboard.h @@ -7,11 +7,9 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) +// No microcontroller.nvm #define CIRCUITPY_INTERNAL_NVM_SIZE 0 -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000) - - // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/boards/uchip/mpconfigboard.mk b/ports/atmel-samd/boards/uchip/mpconfigboard.mk index 109492b764..950910e48b 100644 --- a/ports/atmel-samd/boards/uchip/mpconfigboard.mk +++ b/ports/atmel-samd/boards/uchip/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x04D8 USB_PID = 0xED5F USB_PRODUCT = "uChip CircuitPython" diff --git a/ports/atmel-samd/boards/ugame10/mpconfigboard.h b/ports/atmel-samd/boards/ugame10/mpconfigboard.h index b5590d986c..550172a517 100644 --- a/ports/atmel-samd/boards/ugame10/mpconfigboard.h +++ b/ports/atmel-samd/boards/ugame10/mpconfigboard.h @@ -13,12 +13,6 @@ #define CALIBRATE_CRYSTALLESS 1 -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_SPI_BUS_SCK (&pin_PA07) #define DEFAULT_SPI_BUS_MISO (&pin_PA11) #define DEFAULT_SPI_BUS_MOSI (&pin_PA06) diff --git a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk index f0310b4aaa..1c43369076 100644 --- a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x239A USB_PID = 0x801F USB_PRODUCT = "uGame10" diff --git a/ports/atmel-samd/common-hal/microcontroller/__init__.c b/ports/atmel-samd/common-hal/microcontroller/__init__.c index cb0751acef..41dee2b490 100644 --- a/ports/atmel-samd/common-hal/microcontroller/__init__.c +++ b/ports/atmel-samd/common-hal/microcontroller/__init__.c @@ -92,7 +92,6 @@ const mcu_processor_obj_t common_hal_mcu_processor_obj = { }, }; -// NVM is only available on Express boards for now. #if CIRCUITPY_INTERNAL_NVM_SIZE > 0 // The singleton nvm.ByteArray object. const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = { diff --git a/ports/atmel-samd/ld_defines.c b/ports/atmel-samd/ld_defines.c new file mode 100644 index 0000000000..62838ca4b5 --- /dev/null +++ b/ports/atmel-samd/ld_defines.c @@ -0,0 +1,14 @@ +// Fake source file used only to capture #define values for use in ld template files. +#include "mpconfigport.h" + +// For each value needed in the LD file, create a C-like line: +// NAME_OF_VALUE; ///DEFINE_VALUE NAME_OF_VALUE +// The C preprocessor will replace NAME_OF_VALUE with the actual value. +// This will be post-processed by tools/gen_ld_files.py to extract the name and vlaue. + +BOOTLOADER_SIZE; ///DEFINE_VALUE BOOTLOADER_SIZE +RAM_SIZE; ///DEFINE_VALUE RAM_SIZE lambda f: f.rstrip("UL") +FLASH_SIZE; ///DEFINE_VALUE FLASH_SIZE lambda f: f.rstrip("UL") +CIRCUITPY_INTERNAL_CONFIG_SIZE; ///DEFINE_VALUE CIRCUITPY_INTERNAL_CONFIG_SIZE +CIRCUITPY_INTERNAL_NVM_SIZE; ///DEFINE_VALUE CIRCUITPY_INTERNAL_NVM_SIZE +CIRCUITPY_DEFAULT_STACK_SIZE; ///DEFINE_VALUE CIRCUITPY_DEFAULT_STACK_SIZE diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index 4e15a6c308..21adb10028 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -31,6 +31,30 @@ #include "include/sam.h" #ifdef SAMD21 + +// Default is 0, set by py/circuitpy_mpconfig.h +#if INTERNAL_FLASH_FILESYSTEM +// 64kB +#define INTERNAL_FLASH_FILESYSTEM_SIZE (64*1024) +#endif + +#ifndef CIRCUITPY_INTERNAL_NVM_SIZE +#define CIRCUITPY_INTERNAL_NVM_SIZE (256) +#endif + +// if CALIBRATE_CRYSTALLESS is requested, make room for storing +// calibration data generated from external USB. +#ifndef CIRCUITPY_INTERNAL_CONFIG_SIZE + #ifdef CALIBRATE_CRYSTALLESS +#define CIRCUITPY_INTERNAL_CONFIG_SIZE (256) + #else +#define CIRCUITPY_INTERNAL_CONFIG_SIZE (0) + #endif +#endif + +// HMCRAMC0_SIZE is defined in the ASF4 include files for each SAMD21 chip. +#define RAM_SIZE HMCRAMC0_SIZE +#define BOOTLOADER_SIZE (8*1024) #define CIRCUITPY_MCU_FAMILY samd21 #define MICROPY_PY_SYS_PLATFORM "Atmel SAMD21" #define SPI_FLASH_MAX_BAUDRATE 8000000 @@ -54,9 +78,17 @@ X(EISDIR) \ X(EINVAL) \ -#endif +#endif // SAMD21 #ifdef SAMD51 + +#ifndef CIRCUITPY_INTERNAL_NVM_SIZE +#define CIRCUITPY_INTERNAL_NVM_SIZE (8192) +#endif + +// HSRAM_SIZE is defined in the ASF4 include files for each SAMD51 chip. +#define RAM_SIZE HSRAM_SIZE +#define BOOTLOADER_SIZE (16*1024) #define CIRCUITPY_MCU_FAMILY samd51 #define MICROPY_PY_SYS_PLATFORM "MicroChip SAMD51" #define SPI_FLASH_MAX_BAUDRATE 24000000 @@ -69,7 +101,8 @@ #define MICROPY_PY_UJSON (1) #define MICROPY_PY_REVERSE_SPECIAL_METHODS (1) // MICROPY_PY_UERRNO_LIST - Use the default -#endif + +#endif // SAMD51 // Turning off audioio, audiobusio, and touchio as necessary // due to limitations of chips is handled in mpconfigboard.mk diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 88ddb49e01..63ddb5f23f 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -1,3 +1,7 @@ +# All linking can be done with this common templated linker script, which has +# parameters that vary based on chip and/or board. +LD_TEMPLATE_FILE = boards/common.template.ld + # 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. diff --git a/ports/atmel-samd/tick.c b/ports/atmel-samd/tick.c index 4d7bb9dca7..6163a64d87 100644 --- a/ports/atmel-samd/tick.c +++ b/ports/atmel-samd/tick.c @@ -56,7 +56,7 @@ void SysTick_Handler(void) { #if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0 filesystem_tick(); #endif -#ifdef CIRCUITPY_AUTORELOAD_DELAY_MS +#if CIRCUITPY_AUTORELOAD_DELAY_MS > 0 autoreload_tick(); #endif #ifdef CIRCUITPY_GAMEPAD_TICKS diff --git a/ports/cxd56/tick.c b/ports/cxd56/tick.c index 6529db7901..6b93a3b659 100644 --- a/ports/cxd56/tick.c +++ b/ports/cxd56/tick.c @@ -39,7 +39,7 @@ void board_timerhook(void) #if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0 filesystem_tick(); #endif -#ifdef CIRCUITPY_AUTORELOAD_DELAY_MS +#if CIRCUITPY_AUTORELOAD_DELAY_MS > 0 autoreload_tick(); #endif } diff --git a/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld b/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld index 90b8862cf0..74e66754d8 100644 --- a/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld +++ b/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld @@ -19,11 +19,12 @@ /* Specify the memory areas (S140 6.x.x) */ MEMORY { - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x100000 + FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 1M FLASH_ISR (rx) : ORIGIN = 0x00026000, LENGTH = 0x001000 FLASH_TEXT (rx) : ORIGIN = 0x00027000, LENGTH = 0x086000 FLASH_FATFS (r) : ORIGIN = 0x000AD000, LENGTH = 0x040000 + FLASH_NVM (r) : ORIGIN = 0x000EC000, LENGTH = 0x001000 FLASH_CONFIG (r): ORIGIN = 0x000ED000, LENGTH = 0x007000 /* 0x2000000 - RAM:ORIGIN is reserved for Softdevice */ diff --git a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h index 1e55cd0260..cc441eb0b0 100644 --- a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h +++ b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h @@ -55,12 +55,6 @@ #define SPI_FLASH_CS_PIN &pin_P0_15 #endif -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -#define CIRCUITPY_INTERNAL_NVM_SIZE (4096) - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_P0_04) #define DEFAULT_I2C_BUS_SDA (&pin_P0_05) diff --git a/ports/nrf/boards/common.ld b/ports/nrf/boards/common.ld index dfb355a76f..fade4b9e1b 100644 --- a/ports/nrf/boards/common.ld +++ b/ports/nrf/boards/common.ld @@ -6,6 +6,10 @@ __fatfs_flash_length = LENGTH(FLASH_FATFS); __config_flash_start_addr = ORIGIN(FLASH_CONFIG); __config_flash_length = LENGTH(FLASH_CONFIG); +/* Flash region for microcontroller.nvm region */ +__nvm_flash_start_addr = ORIGIN(FLASH_NVM); +__nvm_flash_length = LENGTH(FLASH_NVM); + /* define output sections */ SECTIONS { diff --git a/ports/nrf/boards/electronut_labs_blip/mpconfigboard.h b/ports/nrf/boards/electronut_labs_blip/mpconfigboard.h index 21e8c3ef61..6b0813e7d0 100644 --- a/ports/nrf/boards/electronut_labs_blip/mpconfigboard.h +++ b/ports/nrf/boards/electronut_labs_blip/mpconfigboard.h @@ -34,12 +34,6 @@ #define MICROPY_HW_MCU_NAME "nRF52840" #define MICROPY_PY_SYS_PLATFORM "ElectronutLabsPapyr" -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_P0_11) diff --git a/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.h b/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.h index 7f5021fdca..594c3e54c9 100644 --- a/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.h +++ b/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.h @@ -33,12 +33,6 @@ #define MICROPY_HW_MCU_NAME "nRF52840" #define MICROPY_PY_SYS_PLATFORM "ElectronutLabsPapyr" -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_P0_06) diff --git a/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h b/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h index 70ccffc3f3..130c5f3e8b 100644 --- a/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h +++ b/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h @@ -54,12 +54,6 @@ #define SPI_FLASH_CS_PIN &pin_P0_20 #endif -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -#define CIRCUITPY_INTERNAL_NVM_SIZE (4096) - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_P0_11) diff --git a/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.h b/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.h index ed48364942..093a0df3bd 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.h +++ b/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.h @@ -40,12 +40,6 @@ #define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(1, 3) #define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(1, 8) -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 0 #define DEFAULT_UART_BUS_RX (&pin_P0_19) diff --git a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.h b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.h index d4096503d7..2128428b85 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.h +++ b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.h @@ -33,10 +33,4 @@ #define MICROPY_HW_MCU_NAME "nRF52840" #define MICROPY_PY_SYS_PLATFORM "MakerDiary52840MDKDongle" -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 // according to the schematic we do diff --git a/ports/nrf/boards/metro_nrf52840_express/mpconfigboard.h b/ports/nrf/boards/metro_nrf52840_express/mpconfigboard.h index 520eef90d9..99ed5c785b 100644 --- a/ports/nrf/boards/metro_nrf52840_express/mpconfigboard.h +++ b/ports/nrf/boards/metro_nrf52840_express/mpconfigboard.h @@ -54,12 +54,6 @@ #define SPI_FLASH_CS_PIN &pin_P0_20 #endif -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -#define CIRCUITPY_INTERNAL_NVM_SIZE (4096) - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_P0_16) diff --git a/ports/nrf/boards/particle_argon/mpconfigboard.h b/ports/nrf/boards/particle_argon/mpconfigboard.h index a4ecb2bb43..0d74869b1d 100644 --- a/ports/nrf/boards/particle_argon/mpconfigboard.h +++ b/ports/nrf/boards/particle_argon/mpconfigboard.h @@ -53,12 +53,6 @@ #define SPI_FLASH_CS_PIN &pin_P0_17 #endif -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_P0_27) diff --git a/ports/nrf/boards/particle_boron/mpconfigboard.h b/ports/nrf/boards/particle_boron/mpconfigboard.h index 5e817311f9..61af22f580 100644 --- a/ports/nrf/boards/particle_boron/mpconfigboard.h +++ b/ports/nrf/boards/particle_boron/mpconfigboard.h @@ -53,12 +53,6 @@ #define SPI_FLASH_CS_PIN &pin_P0_17 #endif -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_P0_27) diff --git a/ports/nrf/boards/particle_xenon/mpconfigboard.h b/ports/nrf/boards/particle_xenon/mpconfigboard.h index 6c8cc7cef2..c2dfffde85 100644 --- a/ports/nrf/boards/particle_xenon/mpconfigboard.h +++ b/ports/nrf/boards/particle_xenon/mpconfigboard.h @@ -53,12 +53,6 @@ #define SPI_FLASH_CS_PIN &pin_P0_17 #endif -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_P0_27) diff --git a/ports/nrf/boards/pca10056/mpconfigboard.h b/ports/nrf/boards/pca10056/mpconfigboard.h index 48ef7f1c39..eca339a7db 100644 --- a/ports/nrf/boards/pca10056/mpconfigboard.h +++ b/ports/nrf/boards/pca10056/mpconfigboard.h @@ -30,8 +30,6 @@ #define MICROPY_HW_MCU_NAME "nRF52840" #define MICROPY_PY_SYS_PLATFORM "nRF52840-DK" -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - #define MICROPY_HW_LED_STATUS (&pin_P0_13) #define DEFAULT_I2C_BUS_SCL (&pin_P0_27) diff --git a/ports/nrf/boards/pca10059/mpconfigboard.h b/ports/nrf/boards/pca10059/mpconfigboard.h index d5ce212292..eaca1bf210 100644 --- a/ports/nrf/boards/pca10059/mpconfigboard.h +++ b/ports/nrf/boards/pca10059/mpconfigboard.h @@ -29,5 +29,3 @@ #define MICROPY_PY_SYS_PLATFORM "nRF52840-DK" #define MICROPY_HW_LED_STATUS (&pin_P0_06) - -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 diff --git a/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.h b/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.h index a5ed69b2bd..20a99a6953 100644 --- a/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.h +++ b/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.h @@ -30,8 +30,6 @@ #define MICROPY_HW_MCU_NAME "nRF52840" #define MICROPY_PY_SYS_PLATFORM "SFE_NRF52840_Mini" -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - #define DEFAULT_I2C_BUS_SCL (&pin_P0_11) #define DEFAULT_I2C_BUS_SDA (&pin_P0_08) diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index a8e1f19059..76f08b5ed3 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -39,12 +39,21 @@ #include "supervisor/usb.h" #include "shared-bindings/_bleio/Adapter.h" #include "shared-bindings/_bleio/Address.h" +#include "shared-bindings/nvm/ByteArray.h" #define BLE_MIN_CONN_INTERVAL MSEC_TO_UNITS(15, UNIT_0_625_MS) #define BLE_MAX_CONN_INTERVAL MSEC_TO_UNITS(15, UNIT_0_625_MS) #define BLE_SLAVE_LATENCY 0 #define BLE_CONN_SUP_TIMEOUT MSEC_TO_UNITS(4000, UNIT_10_MS) +const nvm_bytearray_obj_t common_hal_bleio_nvm_obj = { + .base = { + .type = &nvm_bytearray_type, + }, + .len = CIRCUITPY_BLE_CONFIG_SIZE, + .start_address = CIRCUITPY_BLE_CONFIG_ADDRESS, +}; + STATIC void softdevice_assert_handler(uint32_t id, uint32_t pc, uint32_t info) { mp_raise_msg_varg(&mp_type_AssertionError, translate("Soft device assert, id: 0x%08lX, pc: 0x%08lX"), id, pc); diff --git a/ports/nrf/common-hal/microcontroller/__init__.c b/ports/nrf/common-hal/microcontroller/__init__.c index a6b1c4ba3b..eea3d43cec 100644 --- a/ports/nrf/common-hal/microcontroller/__init__.c +++ b/ports/nrf/common-hal/microcontroller/__init__.c @@ -76,11 +76,14 @@ const mcu_processor_obj_t common_hal_mcu_processor_obj = { }; #if CIRCUITPY_INTERNAL_NVM_SIZE > 0 + // The singleton nvm.ByteArray object. const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = { .base = { .type = &nvm_bytearray_type, - }, + } + .start_address = CIRCUITPY_INTERNAL_NVM_ADDRESS, + .len = CIRCUITPY_INTERNAL_NVM_SIZE, }; #endif diff --git a/ports/nrf/common-hal/nvm/ByteArray.c b/ports/nrf/common-hal/nvm/ByteArray.c index ee270f79bb..416768101d 100644 --- a/ports/nrf/common-hal/nvm/ByteArray.c +++ b/ports/nrf/common-hal/nvm/ByteArray.c @@ -31,19 +31,12 @@ #include "peripherals/nrf/nvm.h" -// defined in linker -extern uint32_t __fatfs_flash_start_addr[]; -extern uint32_t __fatfs_flash_length[]; - -#define NVM_START_ADDR ((uint32_t)__fatfs_flash_start_addr + \ - (uint32_t)__fatfs_flash_length - CIRCUITPY_INTERNAL_NVM_SIZE) - uint32_t common_hal_nvm_bytearray_get_length(nvm_bytearray_obj_t *self) { - return CIRCUITPY_INTERNAL_NVM_SIZE; + 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 + // 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) { @@ -59,7 +52,7 @@ static void write_page(uint32_t page_addr, uint32_t offset, uint32_t len, uint8_ 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 = NVM_START_ADDR + start_index; + uint32_t address = self->start_address + start_index; uint32_t offset = address % FLASH_PAGE_SIZE; uint32_t page_addr = address - offset; @@ -76,5 +69,5 @@ bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, void common_hal_nvm_bytearray_get_bytes(nvm_bytearray_obj_t *self, uint32_t start_index, uint32_t len, uint8_t* values) { - memcpy(values, (uint8_t *)(NVM_START_ADDR + start_index), len); + memcpy(values, self->start_address + start_index, len); } diff --git a/ports/nrf/common-hal/nvm/ByteArray.h b/ports/nrf/common-hal/nvm/ByteArray.h index a8d09dd43a..c048d55778 100644 --- a/ports/nrf/common-hal/nvm/ByteArray.h +++ b/ports/nrf/common-hal/nvm/ByteArray.h @@ -31,6 +31,8 @@ typedef struct { mp_obj_base_t base; + uint8_t* start_address; + uint32_t len; } nvm_bytearray_obj_t; #endif // MICROPY_INCLUDED_NRF_COMMON_HAL_NVM_BYTEARRAY_H diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index 9c3d02f44d..3cb086f310 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -43,6 +43,10 @@ #include "py/circuitpy_mpconfig.h" +#ifndef CIRCUITPY_INTERNAL_NVM_SIZE +#define CIRCUITPY_INTERNAL_NVM_SIZE (4096) +#endif + #ifndef BOARD_HAS_32KHZ_XTAL // Assume crystal is present, which is the most common case. #define BOARD_HAS_32KHZ_XTAL (1) diff --git a/ports/nrf/peripherals/nrf/nvm.h b/ports/nrf/peripherals/nrf/nvm.h index 4eac3d7283..60a663e81f 100644 --- a/ports/nrf/peripherals/nrf/nvm.h +++ b/ports/nrf/peripherals/nrf/nvm.h @@ -27,8 +27,4 @@ #define FLASH_PAGE_SIZE (4096) -#ifndef CIRCUITPY_INTERNAL_NVM_SIZE -#define CIRCUITPY_INTERNAL_NVM_SIZE (0) -#endif - void nrf_nvm_safe_flash_page_write(uint32_t page_addr, uint8_t *data); diff --git a/ports/nrf/supervisor/internal_flash.c b/ports/nrf/supervisor/internal_flash.c index dcacd4d27f..c43454eb39 100644 --- a/ports/nrf/supervisor/internal_flash.c +++ b/ports/nrf/supervisor/internal_flash.c @@ -67,7 +67,7 @@ uint32_t supervisor_flash_get_block_size(void) { } uint32_t supervisor_flash_get_block_count(void) { - return ((uint32_t) __fatfs_flash_length - CIRCUITPY_INTERNAL_NVM_SIZE) / FILESYSTEM_BLOCK_SIZE ; + return ((uint32_t) __fatfs_flash_length) / FILESYSTEM_BLOCK_SIZE ; } void supervisor_flash_flush(void) { @@ -120,4 +120,3 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32 void supervisor_flash_release_cache(void) { } - diff --git a/ports/nrf/tick.c b/ports/nrf/tick.c index 6d8fd13e0a..1a9e69a8c7 100644 --- a/ports/nrf/tick.c +++ b/ports/nrf/tick.c @@ -43,7 +43,7 @@ void SysTick_Handler(void) { #if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0 filesystem_tick(); #endif -#ifdef CIRCUITPY_AUTORELOAD_DELAY_MS +#if CIRCUITPY_AUTORELOAD_DELAY_MS > 0 autoreload_tick(); #endif #ifdef CIRCUITPY_GAMEPAD_TICKS diff --git a/ports/stm32f4/boards/feather_f405/mpconfigboard.h b/ports/stm32f4/boards/feather_f405/mpconfigboard.h index 831a17573a..908b35a71e 100644 --- a/ports/stm32f4/boards/feather_f405/mpconfigboard.h +++ b/ports/stm32f4/boards/feather_f405/mpconfigboard.h @@ -33,9 +33,6 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) -#define AUTORESET_DELAY_MS 500 -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) - // On-board flash #define SPI_FLASH_MOSI_PIN &pin_PB05 #define SPI_FLASH_MISO_PIN &pin_PB04 diff --git a/ports/stm32f4/boards/pyboard_v11/mpconfigboard.h b/ports/stm32f4/boards/pyboard_v11/mpconfigboard.h index e8441d665c..d793a222f6 100644 --- a/ports/stm32f4/boards/pyboard_v11/mpconfigboard.h +++ b/ports/stm32f4/boards/pyboard_v11/mpconfigboard.h @@ -32,6 +32,3 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) - -#define AUTORESET_DELAY_MS 500 -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) \ No newline at end of file diff --git a/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h b/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h index d5491fe362..5bea089750 100644 --- a/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h +++ b/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h @@ -32,9 +32,3 @@ #define FLASH_SIZE (0x80000) //512K #define FLASH_PAGE_SIZE (0x4000) //16K - -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x2000 - 0xC000) - -#define AUTORESET_DELAY_MS 500 diff --git a/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h b/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h index ebee98f89f..9e23f1db54 100644 --- a/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h +++ b/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h @@ -32,7 +32,3 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) - -#define AUTORESET_DELAY_MS 500 -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) - diff --git a/ports/stm32f4/tick.c b/ports/stm32f4/tick.c index 43521fb516..b417df3059 100644 --- a/ports/stm32f4/tick.c +++ b/ports/stm32f4/tick.c @@ -44,7 +44,7 @@ void SysTick_Handler(void) { #if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0 filesystem_tick(); #endif -#ifdef CIRCUITPY_AUTORELOAD_DELAY_MS +#if CIRCUITPY_AUTORELOAD_DELAY_MS > 0 autoreload_tick(); #endif #ifdef CIRCUITPY_GAMEPAD_TICKS diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index b72d753904..915310f83a 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -296,7 +296,6 @@ $(filter $(SRC_PATTERNS), \ fontio/Glyph.c \ microcontroller/RunMode.c \ math/__init__.c \ - supervisor/__init__.c \ ) SRC_BINDINGS_ENUMS += \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 2cb6178198..91e2e223c2 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -212,7 +212,6 @@ typedef long mp_off_t; #define MP_SSIZE_MAX (0x7fffffff) #endif - // These CIRCUITPY_xxx values should all be defined in the *.mk files as being on or off. // So if any are not defined in *.mk, they'll throw an error here. @@ -661,8 +660,20 @@ void run_background_tasks(void); #define MICROPY_VM_HOOK_LOOP run_background_tasks(); #define MICROPY_VM_HOOK_RETURN run_background_tasks(); +// CIRCUITPY_AUTORELOAD_DELAY_MS = 0 will completely disable autoreload. +#ifndef CIRCUITPY_AUTORELOAD_DELAY_MS #define CIRCUITPY_AUTORELOAD_DELAY_MS 500 +#endif + +#ifndef CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS #define CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS 1000 +#endif + +// Default is no internal flash filesystem. +#ifndef INTERNAL_FLASH_FILESYSTEM_SIZE +#define INTERNAL_FLASH_FILESYSTEM_SIZE (0) +#endif + #define CIRCUITPY_BOOT_OUTPUT_FILE "/boot_out.txt" #endif // __INCLUDED_MPCONFIG_CIRCUITPY_H diff --git a/tools/gen_ld_files.py b/tools/gen_ld_files.py new file mode 100755 index 0000000000..fc80d46c9e --- /dev/null +++ b/tools/gen_ld_files.py @@ -0,0 +1,47 @@ +#! /usr/bin/env python3 +import argparse + +import os +import os.path +import sys +import re +from string import Template + +parser = argparse.ArgumentParser(description='Apply #define values to .template.ld file.') +parser.add_argument('template_files', metavar='TEMPLATE_FILE', type=argparse.FileType('r'), + nargs='+', help="template filename: .template.ld") +parser.add_argument('--defines', type=argparse.FileType('r'), required=True) +parser.add_argument('--out_dir', required=True) + +args = parser.parse_args() + +defines = {} + +# We're looking for lines like this: +# ///DEFINE_VALUE NAME_OF_VALUE +VALUE_LINE_RE = re.compile(r'^([^/].*); ///DEFINE_VALUE (\w+)(.*)$') + +for line in args.defines: + match = VALUE_LINE_RE.match(line.strip()) + if match: + value = match.group(1).strip() + name = match.group(2) + lambda_exp = match.group(3).strip() + # Apply the given lambda to the value if it is present, else just store the value. + defines[match.group(2)] = eval(lambda_exp)(value) if lambda_exp else value + +#print(defines) +fail = False + +for template_file in args.template_files: + ld_template_basename = os.path.basename(template_file.name) + ld_pathname = os.path.join(args.out_dir, ld_template_basename.replace('.template.ld', '.ld')) + with open(ld_pathname, 'w') as output: + try: + output.write(Template(template_file.read()).substitute(defines)) + except KeyError as e: + print("ERROR: {}: No #define for '{}'".format(ld_pathname, e.args[0]), file=sys.stderr) + fail = True + +if fail: + sys.exit(1) From a596213526cdfba0688fbe8228f49c798f1b7d1e Mon Sep 17 00:00:00 2001 From: Hierophect Date: Mon, 21 Oct 2019 16:24:32 -0400 Subject: [PATCH 018/189] non-functional WIP --- ports/stm32f4/common-hal/busio/UART.c | 80 ++++++++++++++++++--------- ports/stm32f4/common-hal/busio/UART.h | 6 +- ports/stm32f4/tick.c | 9 +++ 3 files changed, 67 insertions(+), 28 deletions(-) diff --git a/ports/stm32f4/common-hal/busio/UART.c b/ports/stm32f4/common-hal/busio/UART.c index bb6710473d..0b051dbe49 100644 --- a/ports/stm32f4/common-hal/busio/UART.c +++ b/ports/stm32f4/common-hal/busio/UART.c @@ -38,7 +38,6 @@ #include "tick.h" #include "stm32f4xx_hal.h" - STATIC bool reserved_uart[MAX_UART]; void uart_reset(void) { @@ -46,37 +45,37 @@ void uart_reset(void) { reserved_uart[0] = false; MP_STATE_PORT(cpy_uart_obj_all)[0] = NULL; __HAL_RCC_USART1_CLK_DISABLE(); - HAL_NVIC_DisableIRQ(USART1_IRQn); + //HAL_NVIC_DisableIRQ(USART1_IRQn); #endif #ifdef USART2 reserved_uart[1] = false; MP_STATE_PORT(cpy_uart_obj_all)[1] = NULL; __HAL_RCC_USART2_CLK_DISABLE(); - HAL_NVIC_DisableIRQ(USART2_IRQn); + //HAL_NVIC_DisableIRQ(USART2_IRQn); #endif #ifdef USART3 reserved_uart[2] = false; MP_STATE_PORT(cpy_uart_obj_all)[2] = NULL; __HAL_RCC_USART3_CLK_DISABLE(); - HAL_NVIC_DisableIRQ(USART3_IRQn); + //HAL_NVIC_DisableIRQ(USART3_IRQn); #endif #ifdef UART4 reserved_uart[3] = false; MP_STATE_PORT(cpy_uart_obj_all)[3] = NULL; __HAL_RCC_UART4_CLK_DISABLE(); - HAL_NVIC_DisableIRQ(UART4_IRQn); + //HAL_NVIC_DisableIRQ(UART4_IRQn); #endif #ifdef UART5 reserved_uart[4] = false; MP_STATE_PORT(cpy_uart_obj_all)[4] = NULL; __HAL_RCC_UART5_CLK_DISABLE(); - HAL_NVIC_DisableIRQ(UART5_IRQn); + //HAL_NVIC_DisableIRQ(UART5_IRQn); #endif #ifdef USART6 reserved_uart[5] = false; MP_STATE_PORT(cpy_uart_obj_all)[5] = NULL; __HAL_RCC_USART6_CLK_DISABLE(); - HAL_NVIC_DisableIRQ(USART6_IRQn); + //HAL_NVIC_DisableIRQ(USART6_IRQn); #endif //TODO: this technically needs to go to 10 to support F413. Any way to condense? } @@ -97,20 +96,26 @@ STATIC USART_TypeDef * assign_uart_or_throw(busio_uart_obj_t *self, bool pin_eva } -STATIC void uart_clk_irq_enable(USART_TypeDef * USARTx) { +STATIC void uart_clk_irq_enable(busio_uart_obj_t *self, USART_TypeDef * USARTx) { #ifdef USART1 if(USARTx==USART1) { reserved_uart[0] = true; __HAL_RCC_USART1_CLK_ENABLE(); - //HAL_NVIC_SetPriority(USART1_IRQn, 0, 1); + self->irq = USART1_IRQn; + //HAL_NVIC_SetPriority(USART1_IRQn, 2,1); + NVIC_SetPriority(USART1_IRQn, 7); + NVIC_ClearPendingIRQ(USART1_IRQn); HAL_NVIC_EnableIRQ(USART1_IRQn); } #endif - #ifdef UART2 + #ifdef USART2 if(USARTx==USART2) { reserved_uart[1] = true; __HAL_RCC_USART2_CLK_ENABLE(); - //HAL_NVIC_SetPriority(USART2_IRQn, 0, 1); + self->irq = USART2_IRQn; + //HAL_NVIC_SetPriority(USART2_IRQn, 2,1); + NVIC_SetPriority(USART2_IRQn, 7); + NVIC_ClearPendingIRQ(USART2_IRQn); HAL_NVIC_EnableIRQ(USART2_IRQn); } #endif @@ -118,7 +123,10 @@ STATIC void uart_clk_irq_enable(USART_TypeDef * USARTx) { if(USARTx==USART3) { reserved_uart[2] = true; __HAL_RCC_USART3_CLK_ENABLE(); - //HAL_NVIC_SetPriority(USART3_IRQn, 0, 1); + self->irq = USART3_IRQn; + //HAL_NVIC_SetPriority(USART3_IRQn, 2,1); + NVIC_SetPriority(USART3_IRQn, 7); + NVIC_ClearPendingIRQ(USART3_IRQn); HAL_NVIC_EnableIRQ(USART3_IRQn); } #endif @@ -126,7 +134,10 @@ STATIC void uart_clk_irq_enable(USART_TypeDef * USARTx) { if(USARTx==UART4) { reserved_uart[3] = true; __HAL_RCC_UART4_CLK_ENABLE(); - //HAL_NVIC_SetPriority(UART4_IRQn, 0, 1); + self->irq = UART4_IRQn; + //HAL_NVIC_SetPriority(UART4_IRQn, 2,1); + NVIC_SetPriority(UART4_IRQn, 7); + NVIC_ClearPendingIRQ(UART4_IRQn); HAL_NVIC_EnableIRQ(UART4_IRQn); } #endif @@ -134,7 +145,10 @@ STATIC void uart_clk_irq_enable(USART_TypeDef * USARTx) { if(USARTx==UART5) { reserved_uart[4] = true; __HAL_RCC_UART5_CLK_ENABLE(); - //HAL_NVIC_SetPriority(UART5_IRQn, 0, 1); + self->irq = UART5_IRQn; + //NVIC_SetPriority(UART5_IRQn, 7); + NVIC_SetPriority(UART5_IRQn, 7); + NVIC_ClearPendingIRQ(UART5_IRQn); HAL_NVIC_EnableIRQ(UART5_IRQn); } #endif @@ -142,7 +156,10 @@ STATIC void uart_clk_irq_enable(USART_TypeDef * USARTx) { if(USARTx==USART6) { reserved_uart[5] = true; __HAL_RCC_USART6_CLK_ENABLE(); - //HAL_NVIC_SetPriority(USART6_IRQn, 0, 1); + self->irq = USART6_IRQn; + //NVIC_SetPriority(USART6_IRQn, 7); + NVIC_SetPriority(USART6_IRQn, 7); + NVIC_ClearPendingIRQ(USART6_IRQn); HAL_NVIC_EnableIRQ(USART6_IRQn); } #endif @@ -248,7 +265,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, HAL_GPIO_Init(pin_port(rx->port), &GPIO_InitStruct); } - uart_clk_irq_enable(USARTx); + uart_clk_irq_enable(self,USARTx); self->handle.Instance = USARTx; self->handle.Init.BaudRate = baudrate; @@ -297,6 +314,9 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { reset_pin_number(self->rx->pin->port,self->rx->pin->number); self->tx = mp_const_none; self->rx = mp_const_none; + gc_free(self->rbuf.buf); + self->rbuf.size = 0; + self->rbuf.iput = self->rbuf.iget = 0; } // Read characters. @@ -318,7 +338,8 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t } // Halt reception - HAL_UART_AbortReceive_IT(&self->handle); + //HAL_UART_AbortReceive_IT(&self->handle); + NVIC_DisableIRQ(self->irq); // copy received data rx_bytes = ringbuf_count(&self->rbuf); @@ -327,9 +348,10 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t data[i] = ringbuf_get(&self->rbuf); } - if (HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1) != HAL_OK) { - mp_raise_ValueError(translate("HAL recieve IT start error")); - } + NVIC_EnableIRQ(self->irq); + // if (HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1) != HAL_OK) { + // mp_raise_ValueError(translate("HAL recieve IT re-start error")); + // } if (rx_bytes == 0) { *errcode = EAGAIN; @@ -359,15 +381,18 @@ void HAL_UART_RxCpltCallback(UART_HandleTypeDef *handle) busio_uart_obj_t * context = (busio_uart_obj_t *)MP_STATE_PORT(cpy_uart_obj_all)[i]; if(handle == &context->handle) { ringbuf_put_n(&context->rbuf, &context->rx_char, 1); - HAL_UART_Receive_IT(handle, &context->rx_char, 1); - return; + HAL_StatusTypeDef result = HAL_UART_Receive_IT(handle, &context->rx_char, 1); + if(result!=HAL_OK) { + mp_raise_RuntimeError(translate("UART rx restart error")); + } + break; } } } void HAL_UART_ErrorCallback(UART_HandleTypeDef *UartHandle) { - mp_raise_RuntimeError(translate("UART Callback Error")); + mp_raise_RuntimeError(translate("UART Error Callback hit")); } uint32_t common_hal_busio_uart_get_baudrate(busio_uart_obj_t *self) { @@ -396,16 +421,18 @@ uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) { // Halt reception - HAL_UART_AbortReceive_IT(&self->handle); + //HAL_UART_AbortReceive_IT(&self->handle); + NVIC_DisableIRQ(self->irq); ringbuf_clear(&self->rbuf); - HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1); + NVIC_EnableIRQ(self->irq); + //HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1); } bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) { return true; } -static void call_hal_irq(int uart_num) { +STATIC void call_hal_irq(int uart_num) { //Create casted context pointer busio_uart_obj_t * context = (busio_uart_obj_t *)MP_STATE_PORT(cpy_uart_obj_all)[uart_num-1]; if(context != NULL) { @@ -439,4 +466,3 @@ void UART5_IRQHandler(void) { void USART6_IRQHandler(void) { call_hal_irq(6); } - diff --git a/ports/stm32f4/common-hal/busio/UART.h b/ports/stm32f4/common-hal/busio/UART.h index 3c746f64e2..a8c4b5c42e 100644 --- a/ports/stm32f4/common-hal/busio/UART.h +++ b/ports/stm32f4/common-hal/busio/UART.h @@ -37,6 +37,7 @@ typedef struct { mp_obj_base_t base; UART_HandleTypeDef handle; + IRQn_Type irq; const mcu_uart_tx_obj_t *tx; const mcu_uart_rx_obj_t *rx; @@ -52,5 +53,8 @@ void uart_reset(void); void USART1_IRQHandler(void); void USART2_IRQHandler(void); void USART3_IRQHandler(void); -void UART_IRQHandler(void); +void UART4_IRQHandler(void); +void UART5_IRQHandler(void); +void USART6_IRQHandler(void); +// void UART_IRQHandler(void); #endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_UART_H diff --git a/ports/stm32f4/tick.c b/ports/stm32f4/tick.c index 43521fb516..110af52b6f 100644 --- a/ports/stm32f4/tick.c +++ b/ports/stm32f4/tick.c @@ -62,6 +62,15 @@ uint32_t HAL_GetTick(void) //override ST HAL void tick_init() { uint32_t ticks_per_ms = SystemCoreClock/ 1000; SysTick_Config(ticks_per_ms); // interrupt is enabled + + NVIC_EnableIRQ(SysTick_IRQn); + // Set all peripheral interrupt priorities to the lowest priority by default. + // for (uint16_t i = 0; i < PERIPH_COUNT_IRQn; i++) { + // NVIC_SetPriority(i, (1UL << __NVIC_PRIO_BITS) - 1UL); + // } + // Bump up the systick interrupt so nothing else interferes with timekeeping. + NVIC_SetPriority(SysTick_IRQn, 0); + NVIC_SetPriority(OTG_FS_IRQn, 1); } void tick_delay(uint32_t us) { From ec32731b5019c32f8f1d6562d174a02b0837092e Mon Sep 17 00:00:00 2001 From: Hierophect Date: Mon, 28 Oct 2019 12:21:12 -0400 Subject: [PATCH 019/189] sync tinyusb (again) --- lib/tinyusb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tinyusb b/lib/tinyusb index d3e48da5a1..e413c9efa3 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit d3e48da5a1266a88f5f0fdfe28818c8599b09844 +Subproject commit e413c9efa303d70de019a91aa415384fe80ca78f From 1505da784f228d43df41a773cfe504e7e4da330a Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 28 Oct 2019 18:15:02 -0400 Subject: [PATCH 020/189] wip --- ports/atmel-samd/boards/common.template.ld | 10 +----- ports/atmel-samd/boards/sam32/mpconfigboard.h | 2 +- ports/atmel-samd/ld_defines.c | 7 ++-- ports/atmel-samd/mpconfigport.h | 36 +++++++++++++++++-- ports/atmel-samd/supervisor/internal_flash.c | 2 +- ports/atmel-samd/supervisor/internal_flash.h | 11 +----- py/circuitpy_mpconfig.h | 6 +--- 7 files changed, 41 insertions(+), 33 deletions(-) diff --git a/ports/atmel-samd/boards/common.template.ld b/ports/atmel-samd/boards/common.template.ld index e02bbfab02..aebda87c20 100644 --- a/ports/atmel-samd/boards/common.template.ld +++ b/ports/atmel-samd/boards/common.template.ld @@ -3,15 +3,7 @@ /* Specify the memory areas */ MEMORY { - /* CIRCUITPY_BOOTLOADER_SIZE is size of bootloader, if any. - * SAMD21 Arduino and UF2 bootloaders are 8KiB. SAMD51 UF2 is 6KiB. - * FLASH_SIZE is defined in ASF4. - * RAM_SIZE is defined in mpconfigport.h, from constants from ASF4. - * CIRCUITPY_INTERNAL_CONFIG_SIZE is size of an optional hidden config area, used currently - * for crystalless USB timing calibration. - * CIRCUITPY_INTERNAL_NVM_SIZE is the size of microntroller.nvm. - */ - FLASH (rx) : ORIGIN = 0x00000000 + ${BOOTLOADER_SIZE}, LENGTH = ${FLASH_SIZE} - ${BOOTLOADER_SIZE} - ${CIRCUITPY_INTERNAL_CONFIG_SIZE} - ${CIRCUITPY_INTERNAL_NVM_SIZE} + FLASH (rx) : ORIGIN = 0x00000000 + ${BOOTLOADER_SIZE}, LENGTH = ${CIRCUITPY_FIRMWARE_SIZE} RAM (xrw) : ORIGIN = 0x20000000, LENGTH = ${RAM_SIZE} } diff --git a/ports/atmel-samd/boards/sam32/mpconfigboard.h b/ports/atmel-samd/boards/sam32/mpconfigboard.h index 3c6f52ebcc..bd9f5e3983 100644 --- a/ports/atmel-samd/boards/sam32/mpconfigboard.h +++ b/ports/atmel-samd/boards/sam32/mpconfigboard.h @@ -9,7 +9,7 @@ #define MICROPY_PORT_A (PORT_PA24 | PORT_PA25) #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define MICROPY_PORT_D (0) +#define MICROPY_PORT_D (0) // No microcontroller.nvm #define CIRCUITPY_INTERNAL_NVM_SIZE 0 diff --git a/ports/atmel-samd/ld_defines.c b/ports/atmel-samd/ld_defines.c index 62838ca4b5..d8a7a209bf 100644 --- a/ports/atmel-samd/ld_defines.c +++ b/ports/atmel-samd/ld_defines.c @@ -7,8 +7,7 @@ // This will be post-processed by tools/gen_ld_files.py to extract the name and vlaue. BOOTLOADER_SIZE; ///DEFINE_VALUE BOOTLOADER_SIZE -RAM_SIZE; ///DEFINE_VALUE RAM_SIZE lambda f: f.rstrip("UL") -FLASH_SIZE; ///DEFINE_VALUE FLASH_SIZE lambda f: f.rstrip("UL") -CIRCUITPY_INTERNAL_CONFIG_SIZE; ///DEFINE_VALUE CIRCUITPY_INTERNAL_CONFIG_SIZE -CIRCUITPY_INTERNAL_NVM_SIZE; ///DEFINE_VALUE CIRCUITPY_INTERNAL_NVM_SIZE +RAM_SIZE; ///DEFINE_VALUE RAM_SIZE def noUL(expr): import re; return re.sub( +FLASH_SIZE; ///DEFINE_VALUE FLASH_SIZE lambda expr: expr.rstrip("UL") +CIRCUITPY_FIRMWARE_SIZE; ///DEFINE_VALUE CIRCUITPY_FIRMWARE_SIZE CIRCUITPY_DEFAULT_STACK_SIZE; ///DEFINE_VALUE CIRCUITPY_DEFAULT_STACK_SIZE diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index 21adb10028..3334ce1532 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -32,10 +32,10 @@ #ifdef SAMD21 -// Default is 0, set by py/circuitpy_mpconfig.h #if INTERNAL_FLASH_FILESYSTEM -// 64kB -#define INTERNAL_FLASH_FILESYSTEM_SIZE (64*1024) +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (64*1024) +#else +#define CIRCUITPYINTERNAL_FLASH_FILESYSTEM_SIZE (0) #endif #ifndef CIRCUITPY_INTERNAL_NVM_SIZE @@ -86,6 +86,15 @@ #define CIRCUITPY_INTERNAL_NVM_SIZE (8192) #endif +// If CIRCUITPY is internal, use half of flash for it. +#ifndef CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE + #if INTERNAL_FLASH_FILESYSTEM + #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (FLASH_SIZE/2) + #else + #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (0) + #endif +#endif + // HSRAM_SIZE is defined in the ASF4 include files for each SAMD51 chip. #define RAM_SIZE HSRAM_SIZE #define BOOTLOADER_SIZE (16*1024) @@ -104,6 +113,27 @@ #endif // SAMD51 +// Flash layout, starting at 0x00000000 +// +// bootloader (8 or 16kB) +// firmware +// internal config, used to store crystalless clock calibration info (optional) +// microntroller.nvm (optional) +// internal CIRCUITPY flash filesystem (optional) + +// Bootloader starts at 0x00000000. +#define CIRCUITPY_FIRMWARE_START_ADDR BOOTLOADER_SIZE + +// Total space available for code, after subtracting size of other regions used for non-code. +#define CIRCUITPY_FIRMWARE_SIZE \ + (FLASH_SIZE - BOOTLOADER_SIZE - CIRCUITPY_INTERNAL_CONFIG_SIZE - CIRCUITPY_INTERNAL_NVM_SIZE - \ + CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE) + +#define CIRCUITPY_INTERNAL_CONFIG_START_ADDR (CIRCUITPY_FIRMWARE_START_ADDR + CIRCUITPY_FIRMWARE_SIZE) +#define CIRCUITPY_INTERNAL_NVM_START_ADDR (CIRCUITPY_INTERNAL_CONFIG_START_ADDR + CIRCUITPY_INTERNAL_CONFIG_SIZE) +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR \ + (CIRCUITPY_INTERNAL_NVM_START_ADDR + CIRCUITPY_INTERNAL_NVM_SIZE) + // Turning off audioio, audiobusio, and touchio as necessary // due to limitations of chips is handled in mpconfigboard.mk diff --git a/ports/atmel-samd/supervisor/internal_flash.c b/ports/atmel-samd/supervisor/internal_flash.c index 6dd5ac0a70..a8ff5adfa9 100644 --- a/ports/atmel-samd/supervisor/internal_flash.c +++ b/ports/atmel-samd/supervisor/internal_flash.c @@ -86,7 +86,7 @@ void flash_flush(void) { static int32_t convert_block_to_flash_addr(uint32_t block) { if (0 <= block && block < INTERNAL_FLASH_PART1_NUM_BLOCKS) { // a block in partition 1 - return INTERNAL_FLASH_MEM_SEG1_START_ADDR + block * FILESYSTEM_BLOCK_SIZE; + return CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR + block * FILESYSTEM_BLOCK_SIZE; } // bad block return -1; diff --git a/ports/atmel-samd/supervisor/internal_flash.h b/ports/atmel-samd/supervisor/internal_flash.h index 0939a34548..df8b495ccb 100644 --- a/ports/atmel-samd/supervisor/internal_flash.h +++ b/ports/atmel-samd/supervisor/internal_flash.h @@ -32,16 +32,7 @@ #include "sam.h" -#ifdef SAMD51 -#define TOTAL_INTERNAL_FLASH_SIZE (FLASH_SIZE / 2) -#endif - -#ifdef SAMD21 -#define TOTAL_INTERNAL_FLASH_SIZE 0x010000 -#endif - -#define INTERNAL_FLASH_MEM_SEG1_START_ADDR (FLASH_SIZE - TOTAL_INTERNAL_FLASH_SIZE - CIRCUITPY_INTERNAL_NVM_SIZE) -#define INTERNAL_FLASH_PART1_NUM_BLOCKS (TOTAL_INTERNAL_FLASH_SIZE / FILESYSTEM_BLOCK_SIZE) +#define INTERNAL_FLASH_PART1_NUM_BLOCKS (CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE) #define INTERNAL_FLASH_SYSTICK_MASK (0x1ff) // 512ms #define INTERNAL_FLASH_IDLE_TICK(tick) (((tick) & INTERNAL_FLASH_SYSTICK_MASK) == 2) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 91e2e223c2..227376ead0 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -167,6 +167,7 @@ typedef long mp_off_t; #define mp_import_stat mp_vfs_import_stat #define mp_builtin_open_obj mp_vfs_open_obj + // extra built in names to add to the global namespace #define MICROPY_PORT_BUILTINS \ { MP_OBJ_NEW_QSTR(MP_QSTR_help), (mp_obj_t)&mp_builtin_help_obj }, \ @@ -669,11 +670,6 @@ void run_background_tasks(void); #define CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS 1000 #endif -// Default is no internal flash filesystem. -#ifndef INTERNAL_FLASH_FILESYSTEM_SIZE -#define INTERNAL_FLASH_FILESYSTEM_SIZE (0) -#endif - #define CIRCUITPY_BOOT_OUTPUT_FILE "/boot_out.txt" #endif // __INCLUDED_MPCONFIG_CIRCUITPY_H From 33deb6752b8723d66036d2e433eddf0ad22d27ce Mon Sep 17 00:00:00 2001 From: Hierophect Date: Tue, 29 Oct 2019 09:41:52 -0400 Subject: [PATCH 021/189] Add harder resets to UART --- ports/stm32f4/common-hal/busio/UART.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ports/stm32f4/common-hal/busio/UART.c b/ports/stm32f4/common-hal/busio/UART.c index 0b051dbe49..1e03b5886d 100644 --- a/ports/stm32f4/common-hal/busio/UART.c +++ b/ports/stm32f4/common-hal/busio/UART.c @@ -100,6 +100,8 @@ STATIC void uart_clk_irq_enable(busio_uart_obj_t *self, USART_TypeDef * USARTx) #ifdef USART1 if(USARTx==USART1) { reserved_uart[0] = true; + __HAL_RCC_USART1_FORCE_RESET(); + __HAL_RCC_USART1_RELEASE_RESET(); __HAL_RCC_USART1_CLK_ENABLE(); self->irq = USART1_IRQn; //HAL_NVIC_SetPriority(USART1_IRQn, 2,1); @@ -111,6 +113,8 @@ STATIC void uart_clk_irq_enable(busio_uart_obj_t *self, USART_TypeDef * USARTx) #ifdef USART2 if(USARTx==USART2) { reserved_uart[1] = true; + __HAL_RCC_USART2_FORCE_RESET(); + __HAL_RCC_USART2_RELEASE_RESET(); __HAL_RCC_USART2_CLK_ENABLE(); self->irq = USART2_IRQn; //HAL_NVIC_SetPriority(USART2_IRQn, 2,1); @@ -122,6 +126,8 @@ STATIC void uart_clk_irq_enable(busio_uart_obj_t *self, USART_TypeDef * USARTx) #ifdef USART3 if(USARTx==USART3) { reserved_uart[2] = true; + __HAL_RCC_USART3_FORCE_RESET(); + __HAL_RCC_USART3_RELEASE_RESET(); __HAL_RCC_USART3_CLK_ENABLE(); self->irq = USART3_IRQn; //HAL_NVIC_SetPriority(USART3_IRQn, 2,1); @@ -133,6 +139,8 @@ STATIC void uart_clk_irq_enable(busio_uart_obj_t *self, USART_TypeDef * USARTx) #ifdef UART4 if(USARTx==UART4) { reserved_uart[3] = true; + __HAL_RCC_UART4_FORCE_RESET(); + __HAL_RCC_UART4_RELEASE_RESET(); __HAL_RCC_UART4_CLK_ENABLE(); self->irq = UART4_IRQn; //HAL_NVIC_SetPriority(UART4_IRQn, 2,1); @@ -144,6 +152,8 @@ STATIC void uart_clk_irq_enable(busio_uart_obj_t *self, USART_TypeDef * USARTx) #ifdef UART5 if(USARTx==UART5) { reserved_uart[4] = true; + __HAL_RCC_UART5_FORCE_RESET(); + __HAL_RCC_UART5_RELEASE_RESET(); __HAL_RCC_UART5_CLK_ENABLE(); self->irq = UART5_IRQn; //NVIC_SetPriority(UART5_IRQn, 7); @@ -155,6 +165,8 @@ STATIC void uart_clk_irq_enable(busio_uart_obj_t *self, USART_TypeDef * USARTx) #ifdef USART6 if(USARTx==USART6) { reserved_uart[5] = true; + __HAL_RCC_USART6_FORCE_RESET(); + __HAL_RCC_USART6_RELEASE_RESET(); __HAL_RCC_USART6_CLK_ENABLE(); self->irq = USART6_IRQn; //NVIC_SetPriority(USART6_IRQn, 7); From a8070a4185ab35e7373bfc231ebc0ad459392b3f Mon Sep 17 00:00:00 2001 From: Hierophect Date: Wed, 30 Oct 2019 16:59:53 -0400 Subject: [PATCH 022/189] Revise IRQ managment, add restart on failure --- ports/stm32f4/common-hal/busio/UART.c | 119 +++++++++++++++----------- ports/stm32f4/common-hal/busio/UART.h | 7 ++ 2 files changed, 74 insertions(+), 52 deletions(-) diff --git a/ports/stm32f4/common-hal/busio/UART.c b/ports/stm32f4/common-hal/busio/UART.c index 1e03b5886d..ca0d5cd9f4 100644 --- a/ports/stm32f4/common-hal/busio/UART.c +++ b/ports/stm32f4/common-hal/busio/UART.c @@ -38,6 +38,11 @@ #include "tick.h" #include "stm32f4xx_hal.h" +bool iflag; +int errflag; +bool rxflag; +bool bsyflag; + STATIC bool reserved_uart[MAX_UART]; void uart_reset(void) { @@ -45,37 +50,31 @@ void uart_reset(void) { reserved_uart[0] = false; MP_STATE_PORT(cpy_uart_obj_all)[0] = NULL; __HAL_RCC_USART1_CLK_DISABLE(); - //HAL_NVIC_DisableIRQ(USART1_IRQn); #endif #ifdef USART2 reserved_uart[1] = false; MP_STATE_PORT(cpy_uart_obj_all)[1] = NULL; __HAL_RCC_USART2_CLK_DISABLE(); - //HAL_NVIC_DisableIRQ(USART2_IRQn); #endif #ifdef USART3 reserved_uart[2] = false; MP_STATE_PORT(cpy_uart_obj_all)[2] = NULL; __HAL_RCC_USART3_CLK_DISABLE(); - //HAL_NVIC_DisableIRQ(USART3_IRQn); #endif #ifdef UART4 reserved_uart[3] = false; MP_STATE_PORT(cpy_uart_obj_all)[3] = NULL; __HAL_RCC_UART4_CLK_DISABLE(); - //HAL_NVIC_DisableIRQ(UART4_IRQn); #endif #ifdef UART5 reserved_uart[4] = false; MP_STATE_PORT(cpy_uart_obj_all)[4] = NULL; __HAL_RCC_UART5_CLK_DISABLE(); - //HAL_NVIC_DisableIRQ(UART5_IRQn); #endif #ifdef USART6 reserved_uart[5] = false; MP_STATE_PORT(cpy_uart_obj_all)[5] = NULL; __HAL_RCC_USART6_CLK_DISABLE(); - //HAL_NVIC_DisableIRQ(USART6_IRQn); #endif //TODO: this technically needs to go to 10 to support F413. Any way to condense? } @@ -104,10 +103,6 @@ STATIC void uart_clk_irq_enable(busio_uart_obj_t *self, USART_TypeDef * USARTx) __HAL_RCC_USART1_RELEASE_RESET(); __HAL_RCC_USART1_CLK_ENABLE(); self->irq = USART1_IRQn; - //HAL_NVIC_SetPriority(USART1_IRQn, 2,1); - NVIC_SetPriority(USART1_IRQn, 7); - NVIC_ClearPendingIRQ(USART1_IRQn); - HAL_NVIC_EnableIRQ(USART1_IRQn); } #endif #ifdef USART2 @@ -117,10 +112,6 @@ STATIC void uart_clk_irq_enable(busio_uart_obj_t *self, USART_TypeDef * USARTx) __HAL_RCC_USART2_RELEASE_RESET(); __HAL_RCC_USART2_CLK_ENABLE(); self->irq = USART2_IRQn; - //HAL_NVIC_SetPriority(USART2_IRQn, 2,1); - NVIC_SetPriority(USART2_IRQn, 7); - NVIC_ClearPendingIRQ(USART2_IRQn); - HAL_NVIC_EnableIRQ(USART2_IRQn); } #endif #ifdef USART3 @@ -130,10 +121,6 @@ STATIC void uart_clk_irq_enable(busio_uart_obj_t *self, USART_TypeDef * USARTx) __HAL_RCC_USART3_RELEASE_RESET(); __HAL_RCC_USART3_CLK_ENABLE(); self->irq = USART3_IRQn; - //HAL_NVIC_SetPriority(USART3_IRQn, 2,1); - NVIC_SetPriority(USART3_IRQn, 7); - NVIC_ClearPendingIRQ(USART3_IRQn); - HAL_NVIC_EnableIRQ(USART3_IRQn); } #endif #ifdef UART4 @@ -143,10 +130,6 @@ STATIC void uart_clk_irq_enable(busio_uart_obj_t *self, USART_TypeDef * USARTx) __HAL_RCC_UART4_RELEASE_RESET(); __HAL_RCC_UART4_CLK_ENABLE(); self->irq = UART4_IRQn; - //HAL_NVIC_SetPriority(UART4_IRQn, 2,1); - NVIC_SetPriority(UART4_IRQn, 7); - NVIC_ClearPendingIRQ(UART4_IRQn); - HAL_NVIC_EnableIRQ(UART4_IRQn); } #endif #ifdef UART5 @@ -156,10 +139,6 @@ STATIC void uart_clk_irq_enable(busio_uart_obj_t *self, USART_TypeDef * USARTx) __HAL_RCC_UART5_RELEASE_RESET(); __HAL_RCC_UART5_CLK_ENABLE(); self->irq = UART5_IRQn; - //NVIC_SetPriority(UART5_IRQn, 7); - NVIC_SetPriority(UART5_IRQn, 7); - NVIC_ClearPendingIRQ(UART5_IRQn); - HAL_NVIC_EnableIRQ(UART5_IRQn); } #endif #ifdef USART6 @@ -169,10 +148,6 @@ STATIC void uart_clk_irq_enable(busio_uart_obj_t *self, USART_TypeDef * USARTx) __HAL_RCC_USART6_RELEASE_RESET(); __HAL_RCC_USART6_CLK_ENABLE(); self->irq = USART6_IRQn; - //NVIC_SetPriority(USART6_IRQn, 7); - NVIC_SetPriority(USART6_IRQn, 7); - NVIC_ClearPendingIRQ(USART6_IRQn); - HAL_NVIC_EnableIRQ(USART6_IRQn); } #endif } @@ -308,13 +283,25 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, if (self->tx != NULL) { claim_pin(tx); } - self->baudrate = baudrate; self->timeout_ms = timeout * 1000; - if (HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1) != HAL_OK) { - mp_raise_ValueError(translate("HAL recieve IT start error")); + //start the interrupt series + if ((HAL_UART_GetState(&self->handle) & HAL_UART_STATE_BUSY_RX) == HAL_UART_STATE_BUSY_RX) { + mp_raise_ValueError(translate("Could not start interrupt, RX busy")); } + HAL_NVIC_DisableIRQ(self->irq); //prevent handle lock contention + + HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1); + + HAL_NVIC_SetPriority(self->irq, UART_IRQPRI, UART_IRQSUB_PRI); + HAL_NVIC_EnableIRQ(self->irq); + + mp_printf(&mp_plat_print, "Started and inited\n"); + iflag = 0; + errflag = 0; + rxflag = 0; + bsyflag = 0; } bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { @@ -322,6 +309,7 @@ bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { } void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { + mp_printf(&mp_plat_print, "De-init UART\n"); reset_pin_number(self->tx->pin->port,self->tx->pin->number); reset_pin_number(self->rx->pin->port,self->rx->pin->number); self->tx = mp_const_none; @@ -343,6 +331,10 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t // Wait for all bytes received or timeout, same as nrf while ( (ringbuf_count(&self->rbuf) < len) && (ticks_ms - start_ticks < self->timeout_ms) ) { RUN_BACKGROUND_TASKS; + //restart if it failed in the callback + if(errflag != HAL_OK) { + errflag = HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1); + } // Allow user to break out of a timeout with a KeyboardInterrupt. if ( mp_hal_is_interrupted() ) { return 0; @@ -350,21 +342,23 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t } // Halt reception - //HAL_UART_AbortReceive_IT(&self->handle); - NVIC_DisableIRQ(self->irq); + HAL_NVIC_DisableIRQ(self->irq); // copy received data rx_bytes = ringbuf_count(&self->rbuf); + //Used for debuggings + //mp_printf(&mp_plat_print, "Read: count:%d, buffer location%p, if:%der:%drx:%dbsy:%d\n", rx_bytes, &self->rbuf,iflag,errflag,rxflag,bsyflag); + iflag = 0; + errflag = 0; + rxflag = 0; + bsyflag = 0; rx_bytes = MIN(rx_bytes, len); for ( uint16_t i = 0; i < rx_bytes; i++ ) { data[i] = ringbuf_get(&self->rbuf); } - NVIC_EnableIRQ(self->irq); - // if (HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1) != HAL_OK) { - // mp_raise_ValueError(translate("HAL recieve IT re-start error")); - // } - + HAL_NVIC_EnableIRQ(self->irq); + if (rx_bytes == 0) { *errcode = EAGAIN; return MP_STREAM_ERROR; @@ -383,28 +377,50 @@ size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, } else { mp_raise_ValueError(translate("UART write error")); } + mp_printf(&mp_plat_print, "Send\n"); return 0; } void HAL_UART_RxCpltCallback(UART_HandleTypeDef *handle) { + rxflag = 1; for(int i=0; i<7; i++) { //get context pointer and cast it as struct pointer busio_uart_obj_t * context = (busio_uart_obj_t *)MP_STATE_PORT(cpy_uart_obj_all)[i]; if(handle == &context->handle) { - ringbuf_put_n(&context->rbuf, &context->rx_char, 1); - HAL_StatusTypeDef result = HAL_UART_Receive_IT(handle, &context->rx_char, 1); - if(result!=HAL_OK) { - mp_raise_RuntimeError(translate("UART rx restart error")); + //check if transaction is ongoing + if((HAL_UART_GetState(handle) & HAL_UART_STATE_BUSY_RX) == HAL_UART_STATE_BUSY_RX) { + bsyflag = 1; + return; } - break; + ringbuf_put_n(&context->rbuf, &context->rx_char, 1); + errflag = HAL_UART_Receive_IT(handle, &context->rx_char, 1); + + return; } } } void HAL_UART_ErrorCallback(UART_HandleTypeDef *UartHandle) { - mp_raise_RuntimeError(translate("UART Error Callback hit")); + if (__HAL_UART_GET_FLAG(UartHandle, UART_FLAG_PE) != RESET) { + __HAL_UART_CLEAR_PEFLAG(UartHandle); + } else if (__HAL_UART_GET_FLAG(UartHandle, UART_FLAG_FE) != RESET) { + __HAL_UART_CLEAR_FEFLAG(UartHandle); + } else if (__HAL_UART_GET_FLAG(UartHandle, UART_FLAG_NE) != RESET) { + __HAL_UART_CLEAR_NEFLAG(UartHandle); + } else if (__HAL_UART_GET_FLAG(UartHandle, UART_FLAG_ORE) != RESET) { + __HAL_UART_CLEAR_OREFLAG(UartHandle); + } + //restart serial read after an error + for(int i=0; i<7; i++) { + busio_uart_obj_t * context = (busio_uart_obj_t *)MP_STATE_PORT(cpy_uart_obj_all)[i]; + if(UartHandle == &context->handle) { + HAL_UART_Receive_IT(UartHandle, &context->rx_char, 1); + return; + } + } + } uint32_t common_hal_busio_uart_get_baudrate(busio_uart_obj_t *self) { @@ -432,12 +448,11 @@ uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { } void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) { + mp_printf(&mp_plat_print, "Clear RX Buffer\n"); // Halt reception - //HAL_UART_AbortReceive_IT(&self->handle); - NVIC_DisableIRQ(self->irq); + HAL_NVIC_DisableIRQ(self->irq); ringbuf_clear(&self->rbuf); - NVIC_EnableIRQ(self->irq); - //HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1); + HAL_NVIC_EnableIRQ(self->irq); } bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) { @@ -445,12 +460,12 @@ bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) { } STATIC void call_hal_irq(int uart_num) { + iflag = 1; //Create casted context pointer busio_uart_obj_t * context = (busio_uart_obj_t *)MP_STATE_PORT(cpy_uart_obj_all)[uart_num-1]; if(context != NULL) { + HAL_NVIC_ClearPendingIRQ(context->irq); HAL_UART_IRQHandler(&context->handle); - } else { - mp_raise_ValueError(translate("UART IRQ bad handle supplied")); } } diff --git a/ports/stm32f4/common-hal/busio/UART.h b/ports/stm32f4/common-hal/busio/UART.h index a8c4b5c42e..467030598a 100644 --- a/ports/stm32f4/common-hal/busio/UART.h +++ b/ports/stm32f4/common-hal/busio/UART.h @@ -34,6 +34,13 @@ #include "py/obj.h" #include "py/ringbuf.h" +#ifndef UART_IRQPRI +#define UART_IRQPRI 1 +#endif +#ifndef UART_IRQSUB_PRI +#define UART_IRQSUB_PRI 0 +#endif + typedef struct { mp_obj_base_t base; UART_HandleTypeDef handle; From c78d79938de97838bb86ea63204fc31ffefb596f Mon Sep 17 00:00:00 2001 From: Hierophect Date: Wed, 30 Oct 2019 17:07:16 -0400 Subject: [PATCH 023/189] remove debug output --- ports/stm32f4/common-hal/busio/UART.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/stm32f4/common-hal/busio/UART.c b/ports/stm32f4/common-hal/busio/UART.c index ca0d5cd9f4..b785154402 100644 --- a/ports/stm32f4/common-hal/busio/UART.c +++ b/ports/stm32f4/common-hal/busio/UART.c @@ -297,7 +297,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, HAL_NVIC_SetPriority(self->irq, UART_IRQPRI, UART_IRQSUB_PRI); HAL_NVIC_EnableIRQ(self->irq); - mp_printf(&mp_plat_print, "Started and inited\n"); + //mp_printf(&mp_plat_print, "Started and inited\n"); iflag = 0; errflag = 0; rxflag = 0; @@ -309,7 +309,7 @@ bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { } void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { - mp_printf(&mp_plat_print, "De-init UART\n"); + //mp_printf(&mp_plat_print, "De-init UART\n"); reset_pin_number(self->tx->pin->port,self->tx->pin->number); reset_pin_number(self->rx->pin->port,self->rx->pin->number); self->tx = mp_const_none; @@ -377,7 +377,7 @@ size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, } else { mp_raise_ValueError(translate("UART write error")); } - mp_printf(&mp_plat_print, "Send\n"); + //mp_printf(&mp_plat_print, "Send\n"); return 0; } @@ -448,7 +448,7 @@ uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { } void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) { - mp_printf(&mp_plat_print, "Clear RX Buffer\n"); + //mp_printf(&mp_plat_print, "Clear RX Buffer\n"); // Halt reception HAL_NVIC_DisableIRQ(self->irq); ringbuf_clear(&self->rbuf); From e605ce63176a6794e98c59457619cde620b93a4e Mon Sep 17 00:00:00 2001 From: Hierophect Date: Fri, 1 Nov 2019 14:30:28 -0400 Subject: [PATCH 024/189] Debugging additions --- ports/stm32f4/common-hal/busio/UART.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ports/stm32f4/common-hal/busio/UART.c b/ports/stm32f4/common-hal/busio/UART.c index b785154402..34875324b3 100644 --- a/ports/stm32f4/common-hal/busio/UART.c +++ b/ports/stm32f4/common-hal/busio/UART.c @@ -49,31 +49,43 @@ void uart_reset(void) { #ifdef USART1 reserved_uart[0] = false; MP_STATE_PORT(cpy_uart_obj_all)[0] = NULL; + __HAL_RCC_USART1_FORCE_RESET(); + __HAL_RCC_USART1_RELEASE_RESET(); __HAL_RCC_USART1_CLK_DISABLE(); #endif #ifdef USART2 reserved_uart[1] = false; MP_STATE_PORT(cpy_uart_obj_all)[1] = NULL; + __HAL_RCC_USART2_FORCE_RESET(); + __HAL_RCC_USART2_RELEASE_RESET(); __HAL_RCC_USART2_CLK_DISABLE(); #endif #ifdef USART3 reserved_uart[2] = false; MP_STATE_PORT(cpy_uart_obj_all)[2] = NULL; + __HAL_RCC_USART3_FORCE_RESET(); + __HAL_RCC_USART3_RELEASE_RESET(); __HAL_RCC_USART3_CLK_DISABLE(); #endif #ifdef UART4 reserved_uart[3] = false; MP_STATE_PORT(cpy_uart_obj_all)[3] = NULL; + __HAL_RCC_UART4_FORCE_RESET(); + __HAL_RCC_UART4_RELEASE_RESET(); __HAL_RCC_UART4_CLK_DISABLE(); #endif #ifdef UART5 reserved_uart[4] = false; MP_STATE_PORT(cpy_uart_obj_all)[4] = NULL; + __HAL_RCC_UART5_FORCE_RESET(); + __HAL_RCC_UART5_RELEASE_RESET(); __HAL_RCC_UART5_CLK_DISABLE(); #endif #ifdef USART6 reserved_uart[5] = false; MP_STATE_PORT(cpy_uart_obj_all)[5] = NULL; + __HAL_RCC_USART6_FORCE_RESET(); + __HAL_RCC_USART6_RELEASE_RESET(); __HAL_RCC_USART6_CLK_DISABLE(); #endif //TODO: this technically needs to go to 10 to support F413. Any way to condense? @@ -302,6 +314,14 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, errflag = 0; rxflag = 0; bsyflag = 0; + + //interrupt debuggery + GPIO_InitStruct.Pin = pin_mask(7); + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(pin_port(2), &GPIO_InitStruct); + HAL_GPIO_WritePin(pin_port(2),pin_mask(7),0); } bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { @@ -466,6 +486,7 @@ STATIC void call_hal_irq(int uart_num) { if(context != NULL) { HAL_NVIC_ClearPendingIRQ(context->irq); HAL_UART_IRQHandler(&context->handle); + HAL_GPIO_TogglePin(pin_port(2),pin_mask(7)); } } From 8d0cc71aee6fb65669d7ef1ba64d55acf8cb47f1 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Fri, 1 Nov 2019 17:00:01 -0400 Subject: [PATCH 025/189] Add write protections, fix edge case read halt --- ports/stm32f4/common-hal/busio/UART.c | 58 ++++++++------------------- 1 file changed, 16 insertions(+), 42 deletions(-) diff --git a/ports/stm32f4/common-hal/busio/UART.c b/ports/stm32f4/common-hal/busio/UART.c index 34875324b3..3873c1a5ad 100644 --- a/ports/stm32f4/common-hal/busio/UART.c +++ b/ports/stm32f4/common-hal/busio/UART.c @@ -38,12 +38,8 @@ #include "tick.h" #include "stm32f4xx_hal.h" -bool iflag; -int errflag; -bool rxflag; -bool bsyflag; - STATIC bool reserved_uart[MAX_UART]; +int errflag; //Used to restart read halts void uart_reset(void) { #ifdef USART1 @@ -88,7 +84,6 @@ void uart_reset(void) { __HAL_RCC_USART6_RELEASE_RESET(); __HAL_RCC_USART6_CLK_DISABLE(); #endif - //TODO: this technically needs to go to 10 to support F413. Any way to condense? } STATIC USART_TypeDef * assign_uart_or_throw(busio_uart_obj_t *self, bool pin_eval, @@ -302,26 +297,14 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, if ((HAL_UART_GetState(&self->handle) & HAL_UART_STATE_BUSY_RX) == HAL_UART_STATE_BUSY_RX) { mp_raise_ValueError(translate("Could not start interrupt, RX busy")); } + + //start the recieve interrupt chain HAL_NVIC_DisableIRQ(self->irq); //prevent handle lock contention - HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1); - HAL_NVIC_SetPriority(self->irq, UART_IRQPRI, UART_IRQSUB_PRI); HAL_NVIC_EnableIRQ(self->irq); - //mp_printf(&mp_plat_print, "Started and inited\n"); - iflag = 0; - errflag = 0; - rxflag = 0; - bsyflag = 0; - - //interrupt debuggery - GPIO_InitStruct.Pin = pin_mask(7); - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(pin_port(2), &GPIO_InitStruct); - HAL_GPIO_WritePin(pin_port(2),pin_mask(7),0); + errflag = HAL_OK; } bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { @@ -329,7 +312,6 @@ bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { } void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { - //mp_printf(&mp_plat_print, "De-init UART\n"); reset_pin_number(self->tx->pin->port,self->tx->pin->number); reset_pin_number(self->rx->pin->port,self->rx->pin->number); self->tx = mp_const_none; @@ -339,7 +321,6 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { self->rbuf.iput = self->rbuf.iget = 0; } -// 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 == NULL) { mp_raise_ValueError(translate("No RX pin")); @@ -363,20 +344,14 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t // Halt reception HAL_NVIC_DisableIRQ(self->irq); - // copy received data rx_bytes = ringbuf_count(&self->rbuf); - //Used for debuggings - //mp_printf(&mp_plat_print, "Read: count:%d, buffer location%p, if:%der:%drx:%dbsy:%d\n", rx_bytes, &self->rbuf,iflag,errflag,rxflag,bsyflag); - iflag = 0; - errflag = 0; - rxflag = 0; - bsyflag = 0; + //Used for debugging + //mp_printf(&mp_plat_print, "Read: count:%d, buffer location%p, er:%d\n", rx_bytes, &self->rbuf,errflag); rx_bytes = MIN(rx_bytes, len); for ( uint16_t i = 0; i < rx_bytes; i++ ) { data[i] = ringbuf_get(&self->rbuf); } - HAL_NVIC_EnableIRQ(self->irq); if (rx_bytes == 0) { @@ -392,25 +367,27 @@ size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, mp_raise_ValueError(translate("No TX pin")); } - if (HAL_UART_Transmit(&self->handle, (uint8_t *)data, len, 500) == HAL_OK) { - return len; - } else { + HAL_NVIC_DisableIRQ(self->irq); + + if (HAL_UART_Transmit(&self->handle, (uint8_t *)data, len, self->timeout_ms) != HAL_OK) { mp_raise_ValueError(translate("UART write error")); } - //mp_printf(&mp_plat_print, "Send\n"); - return 0; + + HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1); + HAL_NVIC_SetPriority(self->irq, UART_IRQPRI, UART_IRQSUB_PRI); + HAL_NVIC_EnableIRQ(self->irq); + + return len; } void HAL_UART_RxCpltCallback(UART_HandleTypeDef *handle) { - rxflag = 1; for(int i=0; i<7; i++) { //get context pointer and cast it as struct pointer busio_uart_obj_t * context = (busio_uart_obj_t *)MP_STATE_PORT(cpy_uart_obj_all)[i]; if(handle == &context->handle) { //check if transaction is ongoing if((HAL_UART_GetState(handle) & HAL_UART_STATE_BUSY_RX) == HAL_UART_STATE_BUSY_RX) { - bsyflag = 1; return; } ringbuf_put_n(&context->rbuf, &context->rx_char, 1); @@ -468,7 +445,6 @@ uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { } void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) { - //mp_printf(&mp_plat_print, "Clear RX Buffer\n"); // Halt reception HAL_NVIC_DisableIRQ(self->irq); ringbuf_clear(&self->rbuf); @@ -476,17 +452,15 @@ void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) { } bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) { - return true; + return __HAL_UART_GET_FLAG(&self->handle,UART_FLAG_TXE); } STATIC void call_hal_irq(int uart_num) { - iflag = 1; //Create casted context pointer busio_uart_obj_t * context = (busio_uart_obj_t *)MP_STATE_PORT(cpy_uart_obj_all)[uart_num-1]; if(context != NULL) { HAL_NVIC_ClearPendingIRQ(context->irq); HAL_UART_IRQHandler(&context->handle); - HAL_GPIO_TogglePin(pin_port(2),pin_mask(7)); } } From 1a7060af25957bfd4238ee847f7818a1a2293561 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Tue, 5 Nov 2019 16:23:59 -0500 Subject: [PATCH 026/189] Add us delay --- .../common-hal/microcontroller/__init__.c | 26 +++++++++++++++---- ports/stm32f4/mphalport.h | 2 -- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/ports/stm32f4/common-hal/microcontroller/__init__.c b/ports/stm32f4/common-hal/microcontroller/__init__.c index 4a6fdc3883..af7718724d 100644 --- a/ports/stm32f4/common-hal/microcontroller/__init__.c +++ b/ports/stm32f4/common-hal/microcontroller/__init__.c @@ -42,14 +42,30 @@ // This routine should work even when interrupts are disabled. Used by OneWire // for precise timing. void common_hal_mcu_delay_us(uint32_t delay) { - //TODO: implement equivalent of mp_hal_delay_us(delay); - //this is fairly annoying in the STM32 HAL + // sys freq is always a multiple of 2MHz, so division here won't lose precision + const uint32_t ucount = HAL_RCC_GetSysClockFreq() / 2000000 * delay / 2; + for (uint32_t count = 0; ++count <= ucount;) { } -void common_hal_mcu_disable_interrupts() { +volatile uint32_t nesting_count = 0; +void common_hal_mcu_disable_interrupts(void) { + __disable_irq(); + __DMB(); + nesting_count++; } -void common_hal_mcu_enable_interrupts() { +void common_hal_mcu_enable_interrupts(void) { + if (nesting_count == 0) { + // This is very very bad because it means there was mismatched disable/enables so we + // "HardFault". + HardFault_Handler(); + } + nesting_count--; + if (nesting_count > 0) { + return; + } + __DMB(); + __enable_irq(); } void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) { @@ -58,7 +74,7 @@ void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) { } void common_hal_mcu_reset(void) { - filesystem_flush(); + filesystem_flush(); //TODO: implement as part of flash improvements NVIC_SystemReset(); } diff --git a/ports/stm32f4/mphalport.h b/ports/stm32f4/mphalport.h index 131f2751dc..d184138f78 100644 --- a/ports/stm32f4/mphalport.h +++ b/ports/stm32f4/mphalport.h @@ -33,8 +33,6 @@ #include "lib/utils/interrupt_char.h" #include "py/mpconfig.h" -//extern nrfx_uarte_t serial_instance; - extern volatile uint64_t ticks_ms; #define mp_hal_ticks_ms() ((mp_uint_t) ticks_ms) From 8a098c154dd235cb43e053aeb813e4124c409fff Mon Sep 17 00:00:00 2001 From: Hierophect Date: Tue, 5 Nov 2019 16:25:30 -0500 Subject: [PATCH 027/189] Fix unsaved file --- ports/stm32f4/peripherals/stm32f4/periph.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ports/stm32f4/peripherals/stm32f4/periph.h b/ports/stm32f4/peripherals/stm32f4/periph.h index 389b27a517..990cf05332 100644 --- a/ports/stm32f4/peripherals/stm32f4/periph.h +++ b/ports/stm32f4/peripherals/stm32f4/periph.h @@ -101,7 +101,6 @@ typedef struct { .pin = spi_pin, \ } -<<<<<<< HEAD // UART // TODO: these objects should be condensed into a single 'periph_pin' unless we // find a compelling reason to store more unique data in them. @@ -123,7 +122,8 @@ typedef struct { .uart_index = index, \ .altfn_index = alt, \ .pin = uart_pin, \ -======= +} + //Timers typedef struct { uint8_t tim_index:4; @@ -138,7 +138,6 @@ typedef struct { .altfn_index = alt, \ .channel_index = channel, \ .pin = tim_pin, \ ->>>>>>> upstream/master } //Starter Lines From 3f8b4727f5492cd5d4c18dd10a033f19de92d643 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Mon, 11 Nov 2019 14:58:45 -0500 Subject: [PATCH 028/189] Revise us delay to include interrupt/non-interrupt versions --- .../common-hal/microcontroller/__init__.c | 36 +++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/ports/stm32f4/common-hal/microcontroller/__init__.c b/ports/stm32f4/common-hal/microcontroller/__init__.c index af7718724d..1ac8f474cb 100644 --- a/ports/stm32f4/common-hal/microcontroller/__init__.c +++ b/ports/stm32f4/common-hal/microcontroller/__init__.c @@ -39,15 +39,39 @@ #include "supervisor/filesystem.h" #include "supervisor/shared/safe_mode.h" -// This routine should work even when interrupts are disabled. Used by OneWire -// for precise timing. +#include "stm32f4xx_hal.h" + +//tested divisor value for busy loop in us delay +#define LOOP_TICKS 12 + +STATIC uint32_t get_us(void) { + uint32_t ticks_per_us = HAL_RCC_GetSysClockFreq()/1000000; + uint32_t micros, sys_cycles; + do { + micros = ticks_ms; + sys_cycles = SysTick->VAL; //counts backwards + } while (micros != ticks_ms); //try again if ticks_ms rolled over + return (micros * 1000) + (ticks_per_us * 1000 - sys_cycles) / ticks_per_us; +} + void common_hal_mcu_delay_us(uint32_t delay) { - // sys freq is always a multiple of 2MHz, so division here won't lose precision - const uint32_t ucount = HAL_RCC_GetSysClockFreq() / 2000000 * delay / 2; - for (uint32_t count = 0; ++count <= ucount;) { + if (__get_PRIMASK() == 0x00000000) { + //by default use ticks_ms + uint32_t start = get_us(); + while (get_us()-start < delay) { + __asm__ __volatile__("nop"); + } + } else { + //when SysTick is disabled, approximate with busy loop + const uint32_t ucount = HAL_RCC_GetSysClockFreq() / 1000000 * delay / LOOP_TICKS; + (void)start; + for (uint32_t count = 0; ++count <= ucount;) { + } + } } volatile uint32_t nesting_count = 0; + void common_hal_mcu_disable_interrupts(void) { __disable_irq(); __DMB(); @@ -58,7 +82,7 @@ void common_hal_mcu_enable_interrupts(void) { if (nesting_count == 0) { // This is very very bad because it means there was mismatched disable/enables so we // "HardFault". - HardFault_Handler(); + asm("bkpt"); } nesting_count--; if (nesting_count > 0) { From c38086fc4a14bc4d93d63ffe35451efdf95a0ed2 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Mon, 11 Nov 2019 15:04:22 -0500 Subject: [PATCH 029/189] fix typo --- ports/stm32f4/common-hal/microcontroller/__init__.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/stm32f4/common-hal/microcontroller/__init__.c b/ports/stm32f4/common-hal/microcontroller/__init__.c index 1ac8f474cb..c7493a4d60 100644 --- a/ports/stm32f4/common-hal/microcontroller/__init__.c +++ b/ports/stm32f4/common-hal/microcontroller/__init__.c @@ -64,7 +64,6 @@ void common_hal_mcu_delay_us(uint32_t delay) { } else { //when SysTick is disabled, approximate with busy loop const uint32_t ucount = HAL_RCC_GetSysClockFreq() / 1000000 * delay / LOOP_TICKS; - (void)start; for (uint32_t count = 0; ++count <= ucount;) { } } From e076f14ea351381190ce08d931a2b4000a7454a3 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Mon, 11 Nov 2019 15:32:47 -0500 Subject: [PATCH 030/189] text fixes --- ports/stm32f4/common-hal/busio/UART.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/stm32f4/common-hal/busio/UART.c b/ports/stm32f4/common-hal/busio/UART.c index 3873c1a5ad..8e08fd3bd7 100644 --- a/ports/stm32f4/common-hal/busio/UART.c +++ b/ports/stm32f4/common-hal/busio/UART.c @@ -94,7 +94,7 @@ STATIC USART_TypeDef * assign_uart_or_throw(busio_uart_obj_t *self, bool pin_eva return mcu_uart_banks[uart_index]; } else { if (uart_taken) { - mp_raise_ValueError(translate("Hardware busy, try alternative pins")); + mp_raise_ValueError(translate("Hardware in use, try alternative pins")); } else { mp_raise_ValueError(translate("Invalid UART pin selection")); } @@ -229,7 +229,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, (self->tx->uart_index-1), uart_taken); } else { //both pins cannot be empty - mp_raise_ValueError(translate("You must supply at least one UART pin")); + mp_raise_ValueError(translate("Supply at least one UART pin")); } //Other errors @@ -298,7 +298,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_raise_ValueError(translate("Could not start interrupt, RX busy")); } - //start the recieve interrupt chain + //start the receive interrupt chain HAL_NVIC_DisableIRQ(self->irq); //prevent handle lock contention HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1); HAL_NVIC_SetPriority(self->irq, UART_IRQPRI, UART_IRQSUB_PRI); From 14b70806a5aacd3a5346940e6a07d32464d73506 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Mon, 11 Nov 2019 15:47:47 -0500 Subject: [PATCH 031/189] de-init check --- ports/stm32f4/common-hal/busio/UART.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/stm32f4/common-hal/busio/UART.c b/ports/stm32f4/common-hal/busio/UART.c index 8e08fd3bd7..c5e2edfa34 100644 --- a/ports/stm32f4/common-hal/busio/UART.c +++ b/ports/stm32f4/common-hal/busio/UART.c @@ -312,6 +312,8 @@ bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { } void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { + if(common_hal_busio_uart_deinited(self)) return; + reset_pin_number(self->tx->pin->port,self->tx->pin->number); reset_pin_number(self->rx->pin->port,self->rx->pin->number); self->tx = mp_const_none; From bbc366b85b3a29834def291805ca24c593f12915 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Tue, 12 Nov 2019 11:26:14 -0500 Subject: [PATCH 032/189] Style overhaul, extra error checks --- ports/stm32f4/common-hal/busio/UART.c | 391 +++++++++++++-------- ports/stm32f4/common-hal/busio/UART.h | 9 +- ports/stm32f4/mpconfigport.h | 4 +- ports/stm32f4/peripherals/stm32f4/periph.h | 2 - ports/stm32f4/supervisor/port.c | 12 +- ports/stm32f4/tick.c | 4 - 6 files changed, 254 insertions(+), 168 deletions(-) diff --git a/ports/stm32f4/common-hal/busio/UART.c b/ports/stm32f4/common-hal/busio/UART.c index c5e2edfa34..c4ab237cd1 100644 --- a/ports/stm32f4/common-hal/busio/UART.c +++ b/ports/stm32f4/common-hal/busio/UART.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Damien P. George + * Copyright (c) 2019 Lucian Copeland 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 @@ -38,57 +38,26 @@ #include "tick.h" #include "stm32f4xx_hal.h" +#define ALL_UARTS 0xFFFF + STATIC bool reserved_uart[MAX_UART]; int errflag; //Used to restart read halts +STATIC void uart_clock_enable(uint16_t mask); +STATIC void uart_clock_disable(uint16_t mask); +STATIC void uart_assign_irq(busio_uart_obj_t* self, USART_TypeDef* USARTx); + void uart_reset(void) { - #ifdef USART1 - reserved_uart[0] = false; - MP_STATE_PORT(cpy_uart_obj_all)[0] = NULL; - __HAL_RCC_USART1_FORCE_RESET(); - __HAL_RCC_USART1_RELEASE_RESET(); - __HAL_RCC_USART1_CLK_DISABLE(); - #endif - #ifdef USART2 - reserved_uart[1] = false; - MP_STATE_PORT(cpy_uart_obj_all)[1] = NULL; - __HAL_RCC_USART2_FORCE_RESET(); - __HAL_RCC_USART2_RELEASE_RESET(); - __HAL_RCC_USART2_CLK_DISABLE(); - #endif - #ifdef USART3 - reserved_uart[2] = false; - MP_STATE_PORT(cpy_uart_obj_all)[2] = NULL; - __HAL_RCC_USART3_FORCE_RESET(); - __HAL_RCC_USART3_RELEASE_RESET(); - __HAL_RCC_USART3_CLK_DISABLE(); - #endif - #ifdef UART4 - reserved_uart[3] = false; - MP_STATE_PORT(cpy_uart_obj_all)[3] = NULL; - __HAL_RCC_UART4_FORCE_RESET(); - __HAL_RCC_UART4_RELEASE_RESET(); - __HAL_RCC_UART4_CLK_DISABLE(); - #endif - #ifdef UART5 - reserved_uart[4] = false; - MP_STATE_PORT(cpy_uart_obj_all)[4] = NULL; - __HAL_RCC_UART5_FORCE_RESET(); - __HAL_RCC_UART5_RELEASE_RESET(); - __HAL_RCC_UART5_CLK_DISABLE(); - #endif - #ifdef USART6 - reserved_uart[5] = false; - MP_STATE_PORT(cpy_uart_obj_all)[5] = NULL; - __HAL_RCC_USART6_FORCE_RESET(); - __HAL_RCC_USART6_RELEASE_RESET(); - __HAL_RCC_USART6_CLK_DISABLE(); - #endif + for (uint8_t i = 0; i < MAX_UART; i++) { + reserved_uart[i] = false; + MP_STATE_PORT(cpy_uart_obj_all)[i] = NULL; + } + uart_clock_disable(ALL_UARTS); } -STATIC USART_TypeDef * assign_uart_or_throw(busio_uart_obj_t *self, bool pin_eval, +STATIC USART_TypeDef * assign_uart_or_throw(busio_uart_obj_t* self, bool pin_eval, int uart_index, bool uart_taken) { - if(pin_eval) { + if (pin_eval) { //assign a root pointer pointer for IRQ MP_STATE_PORT(cpy_uart_obj_all)[uart_index] = self; return mcu_uart_banks[uart_index]; @@ -101,66 +70,8 @@ STATIC USART_TypeDef * assign_uart_or_throw(busio_uart_obj_t *self, bool pin_eva } } - -STATIC void uart_clk_irq_enable(busio_uart_obj_t *self, USART_TypeDef * USARTx) { - #ifdef USART1 - if(USARTx==USART1) { - reserved_uart[0] = true; - __HAL_RCC_USART1_FORCE_RESET(); - __HAL_RCC_USART1_RELEASE_RESET(); - __HAL_RCC_USART1_CLK_ENABLE(); - self->irq = USART1_IRQn; - } - #endif - #ifdef USART2 - if(USARTx==USART2) { - reserved_uart[1] = true; - __HAL_RCC_USART2_FORCE_RESET(); - __HAL_RCC_USART2_RELEASE_RESET(); - __HAL_RCC_USART2_CLK_ENABLE(); - self->irq = USART2_IRQn; - } - #endif - #ifdef USART3 - if(USARTx==USART3) { - reserved_uart[2] = true; - __HAL_RCC_USART3_FORCE_RESET(); - __HAL_RCC_USART3_RELEASE_RESET(); - __HAL_RCC_USART3_CLK_ENABLE(); - self->irq = USART3_IRQn; - } - #endif - #ifdef UART4 - if(USARTx==UART4) { - reserved_uart[3] = true; - __HAL_RCC_UART4_FORCE_RESET(); - __HAL_RCC_UART4_RELEASE_RESET(); - __HAL_RCC_UART4_CLK_ENABLE(); - self->irq = UART4_IRQn; - } - #endif - #ifdef UART5 - if(USARTx==UART5) { - reserved_uart[4] = true; - __HAL_RCC_UART5_FORCE_RESET(); - __HAL_RCC_UART5_RELEASE_RESET(); - __HAL_RCC_UART5_CLK_ENABLE(); - self->irq = UART5_IRQn; - } - #endif - #ifdef USART6 - if(USARTx==USART6) { - reserved_uart[5] = true; - __HAL_RCC_USART6_FORCE_RESET(); - __HAL_RCC_USART6_RELEASE_RESET(); - __HAL_RCC_USART6_CLK_ENABLE(); - self->irq = USART6_IRQn; - } - #endif -} - -void common_hal_busio_uart_construct(busio_uart_obj_t *self, - const mcu_pin_obj_t * tx, const mcu_pin_obj_t * rx, uint32_t baudrate, +void common_hal_busio_uart_construct(busio_uart_obj_t* self, + const mcu_pin_obj_t* tx, const mcu_pin_obj_t* rx, uint32_t baudrate, uint8_t bits, uart_parity_t parity, uint8_t stop, mp_float_t timeout, uint16_t receiver_buffer_size) { @@ -170,18 +81,19 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, uint8_t tx_len = sizeof(mcu_uart_tx_list)/sizeof(*mcu_uart_tx_list); uint8_t rx_len = sizeof(mcu_uart_rx_list)/sizeof(*mcu_uart_rx_list); bool uart_taken = false; + uint8_t uart_index = 0; //origin 0 corrected //Can have both pins, or either if ((tx != mp_const_none) && (rx != mp_const_none)) { //normal find loop if both pins exist - for(uint i=0; itx!=NULL && self->rx!=NULL), - self->tx->uart_index-1, uart_taken); - } else if (tx==mp_const_none) { + uart_index = self->tx->uart_index - 1; + USARTx = assign_uart_or_throw(self, (self->tx != NULL && self->rx != NULL), + uart_index, uart_taken); + } else if (tx == mp_const_none) { //If there is no tx, run only rx - for(uint i=0; irx!=NULL), - self->rx->uart_index-1, uart_taken); - } else if (rx==mp_const_none) { + uart_index = self->rx->uart_index - 1; + USARTx = assign_uart_or_throw(self, (self->rx != NULL), + uart_index, uart_taken); + } else if (rx == mp_const_none) { //If there is no rx, run only tx - for(uint i=0; itx!=NULL), - (self->tx->uart_index-1), uart_taken); + uart_index = self->tx->uart_index - 1; + USARTx = assign_uart_or_throw(self, (self->tx != NULL), + uart_index, uart_taken); } else { //both pins cannot be empty mp_raise_ValueError(translate("Supply at least one UART pin")); @@ -239,10 +154,13 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, if ( bits != 8 && bits != 9 ) { mp_raise_ValueError(translate("Invalid word/bit length")); } + if ( USARTx == NULL) { //this can only be hit if the periph file is wrong + mp_raise_ValueError(translate("Internal define error")); + } //GPIO Init GPIO_InitTypeDef GPIO_InitStruct = {0}; - if (self->tx!=NULL) { + if (self->tx != NULL) { GPIO_InitStruct.Pin = pin_mask(tx->number); GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_PULLUP; @@ -250,7 +168,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, GPIO_InitStruct.Alternate = self->tx->altfn_index; HAL_GPIO_Init(pin_port(tx->port), &GPIO_InitStruct); } - if (self->rx!=NULL) { + if (self->rx != NULL) { GPIO_InitStruct.Pin = pin_mask(rx->number); GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_PULLUP; @@ -259,14 +177,17 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, HAL_GPIO_Init(pin_port(rx->port), &GPIO_InitStruct); } - uart_clk_irq_enable(self,USARTx); + //reserve uart and enable the peripheral + reserved_uart[uart_index] = true; + uart_clock_enable(1 << (uart_index)); + uart_assign_irq(self, USARTx); self->handle.Instance = USARTx; self->handle.Init.BaudRate = baudrate; self->handle.Init.WordLength = (bits == 9) ? UART_WORDLENGTH_9B : UART_WORDLENGTH_8B; - self->handle.Init.StopBits = (stop>1) ? UART_STOPBITS_2 : UART_STOPBITS_1; - self->handle.Init.Parity = (parity==PARITY_ODD) ? UART_PARITY_ODD : - (parity==PARITY_EVEN) ? UART_PARITY_EVEN : + self->handle.Init.StopBits = (stop > 1) ? UART_STOPBITS_2 : UART_STOPBITS_1; + self->handle.Init.Parity = (parity == PARITY_ODD) ? UART_PARITY_ODD : + (parity == PARITY_EVEN) ? UART_PARITY_EVEN : UART_PARITY_NONE; self->handle.Init.Mode = (self->tx != NULL && self->rx != NULL) ? UART_MODE_TX_RX : (self->tx != NULL) ? UART_MODE_TX : @@ -312,7 +233,7 @@ bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { } void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { - if(common_hal_busio_uart_deinited(self)) return; + if (common_hal_busio_uart_deinited(self)) return; reset_pin_number(self->tx->pin->port,self->tx->pin->number); reset_pin_number(self->rx->pin->port,self->rx->pin->number); @@ -335,7 +256,7 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t while ( (ringbuf_count(&self->rbuf) < len) && (ticks_ms - start_ticks < self->timeout_ms) ) { RUN_BACKGROUND_TASKS; //restart if it failed in the callback - if(errflag != HAL_OK) { + if (errflag != HAL_OK) { errflag = HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1); } // Allow user to break out of a timeout with a KeyboardInterrupt. @@ -348,10 +269,8 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t HAL_NVIC_DisableIRQ(self->irq); // copy received data rx_bytes = ringbuf_count(&self->rbuf); - //Used for debugging - //mp_printf(&mp_plat_print, "Read: count:%d, buffer location%p, er:%d\n", rx_bytes, &self->rbuf,errflag); rx_bytes = MIN(rx_bytes, len); - for ( uint16_t i = 0; i < rx_bytes; i++ ) { + for (uint16_t i = 0; i < rx_bytes; i++) { data[i] = ringbuf_get(&self->rbuf); } HAL_NVIC_EnableIRQ(self->irq); @@ -368,28 +287,27 @@ size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, if (self->tx == NULL) { mp_raise_ValueError(translate("No TX pin")); } + bool write_err = false; //write error shouldn't disable interrupts HAL_NVIC_DisableIRQ(self->irq); - - if (HAL_UART_Transmit(&self->handle, (uint8_t *)data, len, self->timeout_ms) != HAL_OK) { - mp_raise_ValueError(translate("UART write error")); + if (HAL_UART_Transmit(&self->handle, (uint8_t*)data, len, self->timeout_ms) != HAL_OK) { + write_err = true; } - HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1); - HAL_NVIC_SetPriority(self->irq, UART_IRQPRI, UART_IRQSUB_PRI); HAL_NVIC_EnableIRQ(self->irq); + if (write_err) mp_raise_ValueError(translate("UART write error")); return len; } void HAL_UART_RxCpltCallback(UART_HandleTypeDef *handle) { - for(int i=0; i<7; i++) { + for (int i = 0; i < 7; i++) { //get context pointer and cast it as struct pointer - busio_uart_obj_t * context = (busio_uart_obj_t *)MP_STATE_PORT(cpy_uart_obj_all)[i]; - if(handle == &context->handle) { + busio_uart_obj_t * context = (busio_uart_obj_t*)MP_STATE_PORT(cpy_uart_obj_all)[i]; + if (handle == &context->handle) { //check if transaction is ongoing - if((HAL_UART_GetState(handle) & HAL_UART_STATE_BUSY_RX) == HAL_UART_STATE_BUSY_RX) { + if ((HAL_UART_GetState(handle) & HAL_UART_STATE_BUSY_RX) == HAL_UART_STATE_BUSY_RX) { return; } ringbuf_put_n(&context->rbuf, &context->rx_char, 1); @@ -412,9 +330,9 @@ void HAL_UART_ErrorCallback(UART_HandleTypeDef *UartHandle) __HAL_UART_CLEAR_OREFLAG(UartHandle); } //restart serial read after an error - for(int i=0; i<7; i++) { + for (int i = 0; i < 7; i++) { busio_uart_obj_t * context = (busio_uart_obj_t *)MP_STATE_PORT(cpy_uart_obj_all)[i]; - if(UartHandle == &context->handle) { + if (UartHandle == &context->handle) { HAL_UART_Receive_IT(UartHandle, &context->rx_char, 1); return; } @@ -431,11 +349,11 @@ void common_hal_busio_uart_set_baudrate(busio_uart_obj_t *self, uint32_t baudrat if (baudrate == self->baudrate) return; //Otherwise de-init and set new rate - if(HAL_UART_DeInit(&self->handle) != HAL_OK) { + if (HAL_UART_DeInit(&self->handle) != HAL_OK) { mp_raise_ValueError(translate("UART De-init error")); } self->handle.Init.BaudRate = baudrate; - if(HAL_UART_Init(&self->handle) != HAL_OK) { + if (HAL_UART_Init(&self->handle) != HAL_OK) { mp_raise_ValueError(translate("UART Re-init error")); } @@ -454,13 +372,13 @@ void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) { } bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) { - return __HAL_UART_GET_FLAG(&self->handle,UART_FLAG_TXE); + return __HAL_UART_GET_FLAG(&self->handle, UART_FLAG_TXE); } STATIC void call_hal_irq(int uart_num) { //Create casted context pointer - busio_uart_obj_t * context = (busio_uart_obj_t *)MP_STATE_PORT(cpy_uart_obj_all)[uart_num-1]; - if(context != NULL) { + busio_uart_obj_t * context = (busio_uart_obj_t*)MP_STATE_PORT(cpy_uart_obj_all)[uart_num - 1]; + if (context != NULL) { HAL_NVIC_ClearPendingIRQ(context->irq); HAL_UART_IRQHandler(&context->handle); } @@ -490,3 +408,182 @@ void UART5_IRQHandler(void) { void USART6_IRQHandler(void) { call_hal_irq(6); } + +STATIC void uart_clock_enable(uint16_t mask) { + #ifdef USART1 + if (mask & (1 << 0)) { + __HAL_RCC_USART1_FORCE_RESET(); + __HAL_RCC_USART1_RELEASE_RESET(); + __HAL_RCC_USART1_CLK_ENABLE(); + } + #endif + #ifdef USART2 + if (mask & (1 << 1)) { + __HAL_RCC_USART2_FORCE_RESET(); + __HAL_RCC_USART2_RELEASE_RESET(); + __HAL_RCC_USART2_CLK_ENABLE(); + } + #endif + #ifdef USART3 + if (mask & (1 << 2)) { + __HAL_RCC_USART3_FORCE_RESET(); + __HAL_RCC_USART3_RELEASE_RESET(); + __HAL_RCC_USART3_CLK_ENABLE(); + } + #endif + #ifdef UART4 + if (mask & (1 << 3)) { + __HAL_RCC_UART4_FORCE_RESET(); + __HAL_RCC_UART4_RELEASE_RESET(); + __HAL_RCC_UART4_CLK_ENABLE(); + } + #endif + #ifdef UART5 + if (mask & (1 << 4)) { + __HAL_RCC_UART5_FORCE_RESET(); + __HAL_RCC_UART5_RELEASE_RESET(); + __HAL_RCC_UART5_CLK_ENABLE(); + } + #endif + #ifdef USART6 + if (mask & (1 << 5)) { + __HAL_RCC_USART6_FORCE_RESET(); + __HAL_RCC_USART6_RELEASE_RESET(); + __HAL_RCC_USART6_CLK_ENABLE(); + } + #endif + #ifdef UART7 + if (mask & (1 << 6)) { + __HAL_RCC_UART7_FORCE_RESET(); + __HAL_RCC_UART7_RELEASE_RESET(); + __HAL_RCC_UART7_CLK_ENABLE(); + } + #endif + #ifdef UART8 + if (mask & (1 << 7)) { + __HAL_RCC_UART8_FORCE_RESET(); + __HAL_RCC_UART8_RELEASE_RESET(); + __HAL_RCC_UART8_CLK_ENABLE(); + } + #endif + #ifdef UART9 + if (mask & (1 << 8)) { + __HAL_RCC_UART9_FORCE_RESET(); + __HAL_RCC_UART9_RELEASE_RESET(); + __HAL_RCC_UART9_CLK_ENABLE(); + } + #endif + #ifdef UART10 + if (mask & (1 << 9)) { + __HAL_RCC_UART10_FORCE_RESET(); + __HAL_RCC_UART10_RELEASE_RESET(); + __HAL_RCC_UART10_CLK_ENABLE(); + } + #endif +} + +STATIC void uart_clock_disable(uint16_t mask) { + #ifdef USART1 + if (mask & (1 << 0)) { + __HAL_RCC_USART1_FORCE_RESET(); + __HAL_RCC_USART1_RELEASE_RESET(); + __HAL_RCC_USART1_CLK_DISABLE(); + } + #endif + #ifdef USART2 + if (mask & (1 << 1)) { + __HAL_RCC_USART2_FORCE_RESET(); + __HAL_RCC_USART2_RELEASE_RESET(); + __HAL_RCC_USART2_CLK_DISABLE(); + } + #endif + #ifdef USART3 + if (mask & (1 << 2)) { + __HAL_RCC_USART3_FORCE_RESET(); + __HAL_RCC_USART3_RELEASE_RESET(); + __HAL_RCC_USART3_CLK_DISABLE(); + } + #endif + #ifdef UART4 + if (mask & (1 << 3)) { + __HAL_RCC_UART4_FORCE_RESET(); + __HAL_RCC_UART4_RELEASE_RESET(); + __HAL_RCC_UART4_CLK_DISABLE(); + } + #endif + #ifdef UART5 + if (mask & (1 << 4)) { + __HAL_RCC_UART5_FORCE_RESET(); + __HAL_RCC_UART5_RELEASE_RESET(); + __HAL_RCC_UART5_CLK_DISABLE(); + } + #endif + #ifdef USART6 + if (mask & (1 << 5)) { + __HAL_RCC_USART6_FORCE_RESET(); + __HAL_RCC_USART6_RELEASE_RESET(); + __HAL_RCC_USART6_CLK_DISABLE(); + } + #endif + #ifdef UART7 + if (mask & (1 << 6)) { + __HAL_RCC_UART7_FORCE_RESET(); + __HAL_RCC_UART7_RELEASE_RESET(); + __HAL_RCC_UART7_CLK_DISABLE(); + } + #endif + #ifdef UART8 + if (mask & (1 << 7)) { + __HAL_RCC_UART8_FORCE_RESET(); + __HAL_RCC_UART8_RELEASE_RESET(); + __HAL_RCC_UART8_CLK_DISABLE(); + } + #endif + #ifdef UART9 + if (mask & (1 << 8)) { + __HAL_RCC_UART9_FORCE_RESET(); + __HAL_RCC_UART9_RELEASE_RESET(); + __HAL_RCC_UART9_CLK_DISABLE(); + } + #endif + #ifdef UART10 + if (mask & (1 << 9)) { + __HAL_RCC_UART10_FORCE_RESET(); + __HAL_RCC_UART10_RELEASE_RESET(); + __HAL_RCC_UART10_CLK_DISABLE(); + } + #endif +} + +STATIC void uart_assign_irq(busio_uart_obj_t *self, USART_TypeDef * USARTx) { + #ifdef USART1 + if (USARTx == USART1) self->irq = USART1_IRQn; + #endif + #ifdef USART2 + if (USARTx == USART2) self->irq = USART2_IRQn; + #endif + #ifdef USART3 + if (USARTx == USART3) self->irq = USART3_IRQn; + #endif + #ifdef UART4 + if (USARTx == UART4) self->irq = UART4_IRQn; + #endif + #ifdef UART5 + if (USARTx == UART5) self->irq = UART5_IRQn; + #endif + #ifdef USART6 + if (USARTx == USART6) self->irq = USART6_IRQn; + #endif + #ifdef UART7 + if (USARTx == UART7) self->irq = UART7_IRQn; + #endif + #ifdef UART8 + if (USARTx == UART8) self->irq = UART8_IRQn; + #endif + #ifdef UART9 + if (USARTx == UART9) self->irq = UART9_IRQn; + #endif + #ifdef UART10 + if (USARTx == UART10) self->irq = UART10_IRQn; + #endif +} diff --git a/ports/stm32f4/common-hal/busio/UART.h b/ports/stm32f4/common-hal/busio/UART.h index 467030598a..cde5fadd00 100644 --- a/ports/stm32f4/common-hal/busio/UART.h +++ b/ports/stm32f4/common-hal/busio/UART.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Scott Shawcroft + * Copyright (c) 2019 Lucian Copeland 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 @@ -57,11 +57,4 @@ typedef struct { void uart_reset(void); -void USART1_IRQHandler(void); -void USART2_IRQHandler(void); -void USART3_IRQHandler(void); -void UART4_IRQHandler(void); -void UART5_IRQHandler(void); -void USART6_IRQHandler(void); -// void UART_IRQHandler(void); #endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_BUSIO_UART_H diff --git a/ports/stm32f4/mpconfigport.h b/ports/stm32f4/mpconfigport.h index 6d9fe43765..7737bda8d4 100644 --- a/ports/stm32f4/mpconfigport.h +++ b/ports/stm32f4/mpconfigport.h @@ -39,8 +39,10 @@ #include "py/circuitpy_mpconfig.h" +#define MAX_UART 10 //how many UART are implemented + #define MICROPY_PORT_ROOT_POINTERS \ - void *cpy_uart_obj_all[6]; \ + void *cpy_uart_obj_all[MAX_UART]; \ CIRCUITPY_COMMON_ROOT_POINTERS #endif // __INCLUDED_MPCONFIGPORT_H diff --git a/ports/stm32f4/peripherals/stm32f4/periph.h b/ports/stm32f4/peripherals/stm32f4/periph.h index 990cf05332..4b00ce1d92 100644 --- a/ports/stm32f4/peripherals/stm32f4/periph.h +++ b/ports/stm32f4/peripherals/stm32f4/periph.h @@ -33,8 +33,6 @@ #include "stm32f4xx_hal.h" #include "stm32f4/pins.h" -#define MAX_UART 6 //how many UART are implemented - // I2C // TODO: these objects should be condensed into a single 'periph_pin' unless we // find a compelling reason to store more unique data in them. diff --git a/ports/stm32f4/supervisor/port.c b/ports/stm32f4/supervisor/port.c index 8f27c5ad29..df5a70cd12 100644 --- a/ports/stm32f4/supervisor/port.c +++ b/ports/stm32f4/supervisor/port.c @@ -42,12 +42,12 @@ #include "stm32f4xx_hal.h" safe_mode_t port_init(void) { - HAL_Init(); + HAL_Init(); __HAL_RCC_SYSCFG_CLK_ENABLE(); __HAL_RCC_PWR_CLK_ENABLE(); - stm32f4_peripherals_clocks_init(); - stm32f4_peripherals_gpio_init(); + stm32f4_peripherals_clocks_init(); + stm32f4_peripherals_gpio_init(); tick_init(); board_init(); @@ -56,7 +56,7 @@ safe_mode_t port_init(void) { } void reset_port(void) { - reset_all_pins(); + reset_all_pins(); i2c_reset(); spi_reset(); uart_reset(); @@ -68,7 +68,7 @@ void reset_to_bootloader(void) { } void reset_cpu(void) { - NVIC_SystemReset(); + NVIC_SystemReset(); } uint32_t *port_stack_get_limit(void) { @@ -90,7 +90,7 @@ uint32_t port_get_saved_word(void) { } void HardFault_Handler(void) { - reset_into_safe_mode(HARD_CRASH); + reset_into_safe_mode(HARD_CRASH); while (true) { asm("nop;"); } diff --git a/ports/stm32f4/tick.c b/ports/stm32f4/tick.c index 110af52b6f..688f71dbd4 100644 --- a/ports/stm32f4/tick.c +++ b/ports/stm32f4/tick.c @@ -64,10 +64,6 @@ void tick_init() { SysTick_Config(ticks_per_ms); // interrupt is enabled NVIC_EnableIRQ(SysTick_IRQn); - // Set all peripheral interrupt priorities to the lowest priority by default. - // for (uint16_t i = 0; i < PERIPH_COUNT_IRQn; i++) { - // NVIC_SetPriority(i, (1UL << __NVIC_PRIO_BITS) - 1UL); - // } // Bump up the systick interrupt so nothing else interferes with timekeeping. NVIC_SetPriority(SysTick_IRQn, 0); NVIC_SetPriority(OTG_FS_IRQn, 1); From e40bd07fcff59a2871fc30b803c1cfa640fa5220 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Tue, 12 Nov 2019 13:03:13 -0500 Subject: [PATCH 033/189] fix conflicting definitions on discovery boards --- ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.h | 2 +- ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.h | 2 +- ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.c | 4 ++-- ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.h b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.h index c755623982..e87e798574 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.h +++ b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.h @@ -43,7 +43,7 @@ extern const mcu_spi_nss_obj_t mcu_spi_nss_list[6]; //UART extern USART_TypeDef * mcu_uart_banks[MAX_UART]; -bool mcu_uart_has_usart[MAX_UART]; +extern bool mcu_uart_has_usart[MAX_UART]; extern const mcu_uart_tx_obj_t mcu_uart_tx_list[12]; extern const mcu_uart_rx_obj_t mcu_uart_rx_list[12]; diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.h b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.h index dda68f40ec..d657d73b68 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.h +++ b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.h @@ -43,7 +43,7 @@ extern const mcu_spi_nss_obj_t mcu_spi_nss_list[12]; //UART extern USART_TypeDef * mcu_uart_banks[MAX_UART]; -bool mcu_uart_has_usart[MAX_UART]; +extern bool mcu_uart_has_usart[MAX_UART]; extern const mcu_uart_tx_obj_t mcu_uart_tx_list[7]; extern const mcu_uart_rx_obj_t mcu_uart_rx_list[7]; diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.c b/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.c index 19ef806dda..f5effa80ed 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.c +++ b/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.c @@ -122,8 +122,8 @@ const mcu_spi_nss_obj_t mcu_spi_nss_list[12] = { //UART -USART_TypeDef * mcu_uart_banks[6] = {USART1, USART2, USART3, NULL, NULL, USART6}; -bool mcu_uart_has_usart[6] = {true, true, true, false, false, true}; +USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, USART3, NULL, NULL, USART6}; +bool mcu_uart_has_usart[MAX_UART] = {true, true, true, false, false, true}; const mcu_uart_tx_obj_t mcu_uart_tx_list[11] = { UART(2, 7, &pin_PA02), diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.h b/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.h index 7a3eaa66ef..e0141e6dab 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.h +++ b/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.h @@ -44,7 +44,7 @@ extern const mcu_spi_nss_obj_t mcu_spi_nss_list[12]; //UART extern USART_TypeDef * mcu_uart_banks[MAX_UART]; -bool mcu_uart_has_usart[MAX_UART]; +extern bool mcu_uart_has_usart[MAX_UART]; extern const mcu_uart_tx_obj_t mcu_uart_tx_list[11]; extern const mcu_uart_rx_obj_t mcu_uart_rx_list[12]; From 67ff1c92f0d1d6a93c5f1fdf6d5e07c66d39df0a Mon Sep 17 00:00:00 2001 From: Thea Flowers Date: Tue, 12 Nov 2019 13:29:35 -0800 Subject: [PATCH 034/189] Allow boards to change the "CircuitPython" text in their USB interface description. In cases where more than one board is connected to a single computer it can become pretty hard to figure out which board you're actually talking to. For example, if you have several MIDI-compatible boards they all show up as "CircuitPython MIDI". This change allows boards to replace the "CircuitPython" part of their USB descriptors with more specific text, for example, "CircuitPython Feather" or just "Feather". This will let folks more easily tell boards apart. The new option is named `USB_INTERFACE_NAME` and is available in `mkconfigboard.mk`. For example: ``` USB_INTERFACE_NAME = "Feather" ``` --- supervisor/supervisor.mk | 5 +++++ tools/gen_usb_descriptor.py | 28 ++++++++++++++++------------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index ad0f716fbf..b2e4eb1dcf 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -91,6 +91,10 @@ else CFLAGS += -DUSB_AVAILABLE endif +ifndef USB_INTERFACE_NAME +USB_INTERFACE_NAME = "CircuitPython" +endif + ifndef USB_DEVICES USB_DEVICES = "CDC,MSC,AUDIO,HID" endif @@ -145,6 +149,7 @@ USB_DESCRIPTOR_ARGS = \ --vid $(USB_VID)\ --pid $(USB_PID)\ --serial_number_length $(USB_SERIAL_NUMBER_LENGTH)\ + --interface_name $(USB_INTERFACE_NAME)\ --devices $(USB_DEVICES)\ --hid_devices $(USB_HID_DEVICES)\ --msc_max_packet_size $(USB_MSC_MAX_PACKET_SIZE)\ diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py index 21a480f99e..5e25528f90 100644 --- a/tools/gen_usb_descriptor.py +++ b/tools/gen_usb_descriptor.py @@ -8,6 +8,7 @@ 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' @@ -32,6 +33,9 @@ parser.add_argument('--devices', type=lambda l: tuple(l.split(',')), default=DEF help='devices to include in descriptor (AUDIO includes MIDI support)') parser.add_argument('--hid_devices', type=lambda l: tuple(l.split(',')), default=DEFAULT_HID_DEVICES, help='HID devices to include in HID report descriptor') +parser.add_argument('--interface_name', type=str, + help='The name/prefix to use in the interface descriptions', + default=DEFAULT_INTERFACE_NAME) parser.add_argument('--msc_max_packet_size', type=int, default=64, help='Max packet size for MSC') parser.add_argument('--no-renumber_endpoints', dest='renumber_endpoints', action='store_false', @@ -151,7 +155,7 @@ cdc_comm_interface = standard.InterfaceDescriptor( bInterfaceClass=cdc.CDC_CLASS_COMM, # Communications Device Class bInterfaceSubClass=cdc.CDC_SUBCLASS_ACM, # Abstract control model bInterfaceProtocol=cdc.CDC_PROTOCOL_NONE, - iInterface=StringIndex.index("CircuitPython CDC control"), + iInterface=StringIndex.index("{} CDC control".format(args.interface_name)), subdescriptors=[ cdc.Header( description="CDC comm", @@ -172,7 +176,7 @@ cdc_comm_interface = standard.InterfaceDescriptor( cdc_data_interface = standard.InterfaceDescriptor( description="CDC data", bInterfaceClass=cdc.CDC_CLASS_DATA, - iInterface=StringIndex.index("CircuitPython CDC data"), + iInterface=StringIndex.index("{} CDC data".format(args.interface_name)), subdescriptors=[ standard.EndpointDescriptor( description="CDC data out", @@ -192,7 +196,7 @@ msc_interfaces = [ bInterfaceClass=msc.MSC_CLASS, bInterfaceSubClass=msc.MSC_SUBCLASS_TRANSPARENT, bInterfaceProtocol=msc.MSC_PROTOCOL_BULK, - iInterface=StringIndex.index("CircuitPython Mass Storage"), + iInterface=StringIndex.index("{} Mass Storage".format(args.interface_name)), subdescriptors=[ standard.EndpointDescriptor( description="MSC in", @@ -256,7 +260,7 @@ hid_interfaces = [ bInterfaceClass=hid.HID_CLASS, bInterfaceSubClass=hid.HID_SUBCLASS_NOBOOT, bInterfaceProtocol=hid.HID_PROTOCOL_NONE, - iInterface=StringIndex.index("CircuitPython HID"), + iInterface=StringIndex.index("{} HID".format(args.interface_name)), subdescriptors=[ hid.HIDDescriptor( description="HID", @@ -272,9 +276,9 @@ hid_interfaces = [ # USB OUT -> midi_in_jack_emb -> midi_out_jack_ext -> CircuitPython midi_in_jack_emb = midi.InJackDescriptor( - description="MIDI PC -> CircuitPython", + description="MIDI PC -> {}".format(args.interface_name), bJackType=midi.JACK_TYPE_EMBEDDED, - iJack=StringIndex.index("CircuitPython usb_midi.ports[0]")) + 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, @@ -287,10 +291,10 @@ midi_in_jack_ext = midi.InJackDescriptor( bJackType=midi.JACK_TYPE_EXTERNAL, iJack=0) midi_out_jack_emb = midi.OutJackDescriptor( - description="MIDI PC <- CircuitPython", + description="MIDI PC <- {}".format(args.interface_name), bJackType=midi.JACK_TYPE_EMBEDDED, input_pins=[(midi_in_jack_ext, 1)], - iJack=StringIndex.index("CircuitPython usb_midi.ports[1]")) + iJack=StringIndex.index("{} usb_midi.ports[1]".format(args.interface_name))) audio_midi_interface = standard.InterfaceDescriptor( @@ -298,7 +302,7 @@ audio_midi_interface = standard.InterfaceDescriptor( bInterfaceClass=audio.AUDIO_CLASS_DEVICE, bInterfaceSubClass=audio.AUDIO_SUBCLASS_MIDI_STREAMING, bInterfaceProtocol=audio.AUDIO_PROTOCOL_V1, - iInterface=StringIndex.index("CircuitPython MIDI"), + iInterface=StringIndex.index("{} MIDI".format(args.interface_name)), subdescriptors=[ midi.Header( jacks_and_elements=[ @@ -309,12 +313,12 @@ audio_midi_interface = standard.InterfaceDescriptor( ], ), standard.EndpointDescriptor( - description="MIDI data out to CircuitPython", + description="MIDI data out to {}".format(args.interface_name), bEndpointAddress=args.midi_ep_num_out | standard.EndpointDescriptor.DIRECTION_OUT, bmAttributes=standard.EndpointDescriptor.TYPE_BULK), midi.DataEndpointDescriptor(baAssocJack=[midi_in_jack_emb]), standard.EndpointDescriptor( - description="MIDI data in from CircuitPython", + 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), @@ -334,7 +338,7 @@ audio_control_interface = standard.InterfaceDescriptor( bInterfaceClass=audio.AUDIO_CLASS_DEVICE, bInterfaceSubClass=audio.AUDIO_SUBCLASS_CONTROL, bInterfaceProtocol=audio.AUDIO_PROTOCOL_V1, - iInterface=StringIndex.index("CircuitPython Audio"), + iInterface=StringIndex.index("{} Audio".format(args.interface_name)), subdescriptors=[ cs_ac_interface, ]) From 6e96b1945e611ae1fc746ac35e6adbd4545620a1 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Wed, 13 Nov 2019 13:18:43 -0500 Subject: [PATCH 035/189] Raise clock speed, adjust divisors --- ports/stm32f4/peripherals/stm32f4/stm32f405xx/clocks.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/clocks.c b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/clocks.c index 74eeb4b244..c259f54fa1 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/clocks.c +++ b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/clocks.c @@ -48,7 +48,7 @@ void stm32f4_peripherals_clocks_init(void) { RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; RCC_OscInitStruct.PLL.PLLM = 12; RCC_OscInitStruct.PLL.PLLN = 336; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4; + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; RCC_OscInitStruct.PLL.PLLQ = 7; HAL_RCC_OscConfig(&RCC_OscInitStruct); @@ -57,7 +57,7 @@ void stm32f4_peripherals_clocks_init(void) { RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5); } From 8584c1e824e66adb4172fd27d753bc4c2fc05171 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 13 Nov 2019 21:34:20 -0500 Subject: [PATCH 036/189] Fix start_scan timeout default value --- shared-bindings/_bleio/Adapter.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index a64167e5a7..24a70f4084 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -201,7 +201,7 @@ STATIC mp_obj_t bleio_adapter_stop_advertising(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_stop_advertising_obj, bleio_adapter_stop_advertising); -//| .. method:: start_scan(prefixes=b"", \*, buffer_size=512, extended=False, timeout=None, interval=0.1, window=0.1, minimum_rssi=-80) +//| .. method:: start_scan(prefixes=b"", \*, buffer_size=512, extended=False, timeout=None, interval=0.1, window=0.1, minimum_rssi=-80, active=True) //| //| Starts a BLE scan and returns an iterator of results. Advertisements and scan responses are //| filtered and returned separately. @@ -227,7 +227,7 @@ STATIC mp_obj_t bleio_adapter_start_scan(size_t n_args, const mp_obj_t *pos_args { MP_QSTR_prefixes, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, { MP_QSTR_buffer_size, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 512} }, { MP_QSTR_extended, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, - { MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, { MP_QSTR_interval, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, { MP_QSTR_window, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, { MP_QSTR_minimum_rssi, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = -80} }, @@ -239,7 +239,7 @@ STATIC mp_obj_t bleio_adapter_start_scan(size_t n_args, const mp_obj_t *pos_args mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); mp_float_t timeout = 0; - if (args[ARG_timeout].u_obj != MP_OBJ_NULL) { + if (args[ARG_timeout].u_obj != mp_const_none) { timeout = mp_obj_get_float(args[ARG_timeout].u_obj); } @@ -306,7 +306,7 @@ const mp_obj_property_t bleio_adapter_connected_obj = { //| .. attribute:: connections //| -//| Tuple of active connections including those initiated through +//| Tuple of active connections including those initiated through //| :py:meth:`_bleio.Adapter.connect`. (read-only) //| STATIC mp_obj_t bleio_adapter_get_connections(mp_obj_t self) { From 6cce2d6d145896e02e78fffa26edb60f7d0d6a69 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Fri, 15 Nov 2019 12:28:16 -0500 Subject: [PATCH 037/189] Implement Neopixel write, add defaults to f405 --- .../feather_stm32f405_express/mpconfigboard.h | 2 + .../boards/feather_stm32f405_express/pins.c | 1 + .../stm32f4/common-hal/microcontroller/Pin.h | 4 + .../common-hal/neopixel_write/__init__.c | 89 +++++++++++++++++++ ports/stm32f4/mpconfigport.mk | 1 + 5 files changed, 97 insertions(+) create mode 100644 ports/stm32f4/common-hal/neopixel_write/__init__.c diff --git a/ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.h b/ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.h index 67ddc885ae..e2295dc5e7 100644 --- a/ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.h +++ b/ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.h @@ -35,6 +35,8 @@ #define AUTORESET_DELAY_MS 500 #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) +#define MICROPY_HW_NEOPIXEL &pin_PC00 + // On-board flash #define SPI_FLASH_MOSI_PIN &pin_PB05 #define SPI_FLASH_MISO_PIN &pin_PB04 diff --git a/ports/stm32f4/boards/feather_stm32f405_express/pins.c b/ports/stm32f4/boards/feather_stm32f405_express/pins.c index 4aa1f362ad..180fdd0937 100644 --- a/ports/stm32f4/boards/feather_stm32f405_express/pins.c +++ b/ports/stm32f4/boards/feather_stm32f405_express/pins.c @@ -26,6 +26,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB10) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PC00) }, { 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) }, diff --git a/ports/stm32f4/common-hal/microcontroller/Pin.h b/ports/stm32f4/common-hal/microcontroller/Pin.h index 0c3fb375f7..c42b0801fc 100644 --- a/ports/stm32f4/common-hal/microcontroller/Pin.h +++ b/ports/stm32f4/common-hal/microcontroller/Pin.h @@ -31,6 +31,10 @@ #include "peripherals/stm32f4/pins.h" +#ifdef MICROPY_HW_NEOPIXEL +extern bool neopixel_in_use; +#endif + void reset_all_pins(void); // reset_pin_number takes the pin number instead of the pointer so that objects don't // need to store a full pointer. diff --git a/ports/stm32f4/common-hal/neopixel_write/__init__.c b/ports/stm32f4/common-hal/neopixel_write/__init__.c new file mode 100644 index 0000000000..c5d810ae9b --- /dev/null +++ b/ports/stm32f4/common-hal/neopixel_write/__init__.c @@ -0,0 +1,89 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland 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 "py/mphal.h" +#include "shared-bindings/neopixel_write/__init__.h" + +#include "tick.h" +#include "common-hal/microcontroller/Pin.h" +#include "stm32f4xx_hal.h" +#include "stm32f4xx_ll_gpio.h" + +uint64_t next_start_tick_ms = 0; +uint32_t next_start_tick_us = 1000; + +void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout, uint8_t *pixels, + uint32_t numBytes) { + uint8_t *p = pixels, *end = p + numBytes, pix = *p++, mask = 0x80; + uint32_t start = 0; + uint32_t cyc = 0; + + //assumes 800_000Hz frequency + uint32_t sys_freq = HAL_RCC_GetSysClockFreq(); + uint32_t interval = sys_freq/800000; // cycles per interval (1.25 us). 210@168MHz + uint32_t t0 = interval - (sys_freq/2500000); // 0.4 us + uint32_t t1 = interval - (sys_freq/1250000); // 0.8 us + + // This must be called while interrupts are on in case we're waiting for a + // future ms tick. + wait_until(next_start_tick_ms, next_start_tick_us); + + __disable_irq(); + // Enable DWT in debug core. Useable when interrupts disabled, as opposed to Systick->VAL + //ITM->LAR = 0xC5ACCE55; //is this required? + CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; + DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; + DWT->CYCCNT = 0; + + GPIO_TypeDef * p_port = pin_port(digitalinout->pin->port); + uint32_t p_mask = pin_mask(digitalinout->pin->number); + + for(;;) { + LL_GPIO_SetOutputPin(p_port, p_mask); + cyc = (pix & mask) ? t1 : t0; + start = DWT->CYCCNT; + while(DWT->CYCCNT - start < cyc); + LL_GPIO_ResetOutputPin(p_port, p_mask); + if(!(mask >>= 1)) { //max has shifted all the way + if(p >= end) break; + pix = *p++; + mask = 0x80; + } + while(DWT->CYCCNT - start < interval); //wait for interval to finish + } + + // Enable interrupts again + __enable_irq(); + + // Update the next start. + current_tick(&next_start_tick_ms, &next_start_tick_us); + if (next_start_tick_us < 100) { + next_start_tick_ms += 1; + next_start_tick_us = 100 - next_start_tick_us; + } else { + next_start_tick_us -= 100; + } +} diff --git a/ports/stm32f4/mpconfigport.mk b/ports/stm32f4/mpconfigport.mk index bce68f99f4..928d53e67c 100644 --- a/ports/stm32f4/mpconfigport.mk +++ b/ports/stm32f4/mpconfigport.mk @@ -26,6 +26,7 @@ CIRCUITPY_STORAGE = 1 CIRCUITPY_RANDOM = 1 CIRCUITPY_USB_HID = 1 CIRCUITPY_USB_MIDI = 1 +CIRCUITPY_NEOPIXEL_WRITE = 1 #ifeq ($(MCU_SUB_VARIANT), stm32f412zx) #endif From de5691acf5060d6e2182da4c84095a007f6da606 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Fri, 15 Nov 2019 12:47:00 -0500 Subject: [PATCH 038/189] Add never_reset and reset to pin common hal, adjust files --- ports/atmel-samd/common-hal/microcontroller/Pin.c | 8 ++++++++ ports/nrf/common-hal/microcontroller/Pin.c | 8 ++++++++ ports/stm32f4/common-hal/microcontroller/Pin.c | 8 ++++++++ shared-bindings/microcontroller/Pin.h | 2 ++ shared-module/displayio/Display.c | 2 +- shared-module/displayio/EPaperDisplay.c | 2 +- shared-module/displayio/FourWire.c | 13 +++++++------ shared-module/displayio/I2CDisplay.c | 5 +++-- supervisor/shared/rgb_led_status.c | 8 ++++---- 9 files changed, 42 insertions(+), 14 deletions(-) diff --git a/ports/atmel-samd/common-hal/microcontroller/Pin.c b/ports/atmel-samd/common-hal/microcontroller/Pin.c index 6f3cbc7598..9719ea5b11 100644 --- a/ports/atmel-samd/common-hal/microcontroller/Pin.c +++ b/ports/atmel-samd/common-hal/microcontroller/Pin.c @@ -158,6 +158,14 @@ void reset_pin_number(uint8_t pin_number) { #endif } +void common_hal_never_reset_pin(const mcu_pin_obj_t* pin) { + never_reset_pin_number(pin->number); +} + +void common_hal_reset_pin(const mcu_pin_obj_t* pin) { + reset_pin_number(pin->number); +} + void claim_pin(const mcu_pin_obj_t* pin) { #ifdef MICROPY_HW_NEOPIXEL if (pin == MICROPY_HW_NEOPIXEL) { diff --git a/ports/nrf/common-hal/microcontroller/Pin.c b/ports/nrf/common-hal/microcontroller/Pin.c index ce55317e54..b7931a2e16 100644 --- a/ports/nrf/common-hal/microcontroller/Pin.c +++ b/ports/nrf/common-hal/microcontroller/Pin.c @@ -125,6 +125,14 @@ void never_reset_pin_number(uint8_t pin_number) { never_reset_pins[nrf_pin_port(pin_number)] |= 1 << nrf_relative_pin_number(pin_number); } +void common_hal_never_reset_pin(const mcu_pin_obj_t* pin) { + never_reset_pin_number(pin->number); +} + +void common_hal_reset_pin(const mcu_pin_obj_t* pin) { + reset_pin_number(pin->number); +} + void claim_pin(const mcu_pin_obj_t* pin) { // Set bit in claimed_pins bitmask. claimed_pins[nrf_pin_port(pin->number)] |= 1 << nrf_relative_pin_number(pin->number); diff --git a/ports/stm32f4/common-hal/microcontroller/Pin.c b/ports/stm32f4/common-hal/microcontroller/Pin.c index 5761d7fb15..7e737e21b4 100644 --- a/ports/stm32f4/common-hal/microcontroller/Pin.c +++ b/ports/stm32f4/common-hal/microcontroller/Pin.c @@ -72,6 +72,14 @@ void never_reset_pin_number(uint8_t pin_port, uint8_t pin_number) { never_reset_pins[pin_port] |= 1<port, pin->number); +} + +void common_hal_reset_pin(const mcu_pin_obj_t* pin) { + reset_pin_number(pin->port, pin->number); +} + void claim_pin(const mcu_pin_obj_t* pin) { // Set bit in claimed_pins bitmask. claimed_pins[pin->port] |= 1<number; diff --git a/shared-bindings/microcontroller/Pin.h b/shared-bindings/microcontroller/Pin.h index ed831b2589..2d15dd5c58 100644 --- a/shared-bindings/microcontroller/Pin.h +++ b/shared-bindings/microcontroller/Pin.h @@ -37,5 +37,7 @@ void assert_pin(mp_obj_t obj, bool none_ok); void assert_pin_free(const mcu_pin_obj_t* pin); bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t* pin); +void common_hal_never_reset_pin(const mcu_pin_obj_t* pin); +void common_hal_reset_pin(const mcu_pin_obj_t* pin); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_MICROCONTROLLER_PIN_H diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 06b81f2f84..862d2cf598 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -113,7 +113,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t* self, if (result != PWMOUT_OK) { self->backlight_inout.base.type = &digitalio_digitalinout_type; common_hal_digitalio_digitalinout_construct(&self->backlight_inout, backlight_pin); - never_reset_pin_number(backlight_pin->number); + common_hal_never_reset_pin(backlight_pin); } else { self->backlight_pwm.base.type = &pulseio_pwmout_type; common_hal_pulseio_pwmout_never_reset(&self->backlight_pwm); diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index efbd9f3ddb..df1d5162b7 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -82,7 +82,7 @@ void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t* if (busy_pin != NULL) { self->busy.base.type = &digitalio_digitalinout_type; common_hal_digitalio_digitalinout_construct(&self->busy, busy_pin); - never_reset_pin_number(busy_pin->number); + common_hal_never_reset_pin(busy_pin); } // Clear the color memory if it isn't in use. diff --git a/shared-module/displayio/FourWire.c b/shared-module/displayio/FourWire.c index fcc4c1a20a..92d4507dde 100644 --- a/shared-module/displayio/FourWire.c +++ b/shared-module/displayio/FourWire.c @@ -31,6 +31,7 @@ #include "py/gc.h" #include "shared-bindings/busio/SPI.h" #include "shared-bindings/digitalio/DigitalInOut.h" +#include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/time/__init__.h" #include "shared-module/displayio/display_core.h" @@ -61,12 +62,12 @@ void common_hal_displayio_fourwire_construct(displayio_fourwire_obj_t* self, self->reset.base.type = &digitalio_digitalinout_type; common_hal_digitalio_digitalinout_construct(&self->reset, reset); common_hal_digitalio_digitalinout_switch_to_output(&self->reset, true, DRIVE_MODE_PUSH_PULL); - never_reset_pin_number(reset->number); + common_hal_never_reset_pin(reset); common_hal_displayio_fourwire_reset(self); } - never_reset_pin_number(command->number); - never_reset_pin_number(chip_select->number); + common_hal_never_reset_pin(command); + common_hal_never_reset_pin(chip_select); } void common_hal_displayio_fourwire_deinit(displayio_fourwire_obj_t* self) { @@ -74,9 +75,9 @@ void common_hal_displayio_fourwire_deinit(displayio_fourwire_obj_t* self) { common_hal_busio_spi_deinit(self->bus); } - reset_pin_number(self->command.pin->number); - reset_pin_number(self->chip_select.pin->number); - reset_pin_number(self->reset.pin->number); + common_hal_reset_pin(self->command.pin); + common_hal_reset_pin(self->chip_select.pin); + common_hal_reset_pin(self->reset.pin); } bool common_hal_displayio_fourwire_reset(mp_obj_t obj) { diff --git a/shared-module/displayio/I2CDisplay.c b/shared-module/displayio/I2CDisplay.c index 0307410d14..280476f195 100644 --- a/shared-module/displayio/I2CDisplay.c +++ b/shared-module/displayio/I2CDisplay.c @@ -33,6 +33,7 @@ #include "py/runtime.h" #include "shared-bindings/busio/I2C.h" #include "shared-bindings/digitalio/DigitalInOut.h" +#include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/time/__init__.h" #include "shared-module/displayio/display_core.h" @@ -48,7 +49,7 @@ void common_hal_displayio_i2cdisplay_construct(displayio_i2cdisplay_obj_t* self, self->reset.base.type = &digitalio_digitalinout_type; common_hal_digitalio_digitalinout_construct(&self->reset, reset); common_hal_digitalio_digitalinout_switch_to_output(&self->reset, true, DRIVE_MODE_PUSH_PULL); - never_reset_pin_number(reset->number); + common_hal_never_reset_pin(reset); common_hal_displayio_i2cdisplay_reset(self); } @@ -72,7 +73,7 @@ void common_hal_displayio_i2cdisplay_deinit(displayio_i2cdisplay_obj_t* self) { common_hal_busio_i2c_deinit(self->bus); } - reset_pin_number(self->reset.pin->number); + common_hal_reset_pin(self->reset.pin); } bool common_hal_displayio_i2cdisplay_reset(mp_obj_t obj) { diff --git a/supervisor/shared/rgb_led_status.c b/supervisor/shared/rgb_led_status.c index 05df4c628a..90c78fbbe7 100644 --- a/supervisor/shared/rgb_led_status.c +++ b/supervisor/shared/rgb_led_status.c @@ -117,7 +117,7 @@ void rgb_led_status_init() { mp_const_none); #else if (!common_hal_busio_spi_deinited(&status_apa102)) { - // This may call us recursively if reset_pin_number() is called, + // This may call us recursively if common_hal_reset_pin() is called, // The rgb_led_status_init_in_progress guard will prevent further recursion. common_hal_busio_spi_deinit(&status_apa102); } @@ -181,11 +181,11 @@ void rgb_led_status_init() { void reset_status_led() { #ifdef MICROPY_HW_NEOPIXEL - reset_pin_number(MICROPY_HW_NEOPIXEL->number); + common_hal_reset_pin(MICROPY_HW_NEOPIXEL); #endif #if defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK) - reset_pin_number(MICROPY_HW_APA102_MOSI->number); - reset_pin_number(MICROPY_HW_APA102_SCK->number); + common_hal_reset_pin(MICROPY_HW_APA102_MOSI); + common_hal_reset_pin(MICROPY_HW_APA102_SCK); #endif #if defined(CP_RGB_STATUS_LED) // TODO: Support sharing status LED with user. From 8ff1bc0132bafe4b81adb8fce4e4d2f7844e12ef Mon Sep 17 00:00:00 2001 From: Hierophect Date: Fri, 15 Nov 2019 12:49:47 -0500 Subject: [PATCH 039/189] add missing include --- supervisor/shared/rgb_led_status.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/shared/rgb_led_status.c b/supervisor/shared/rgb_led_status.c index 90c78fbbe7..940cbf1f27 100644 --- a/supervisor/shared/rgb_led_status.c +++ b/supervisor/shared/rgb_led_status.c @@ -25,7 +25,7 @@ */ #include "mphalport.h" -#include "common-hal/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/Pin.h" #include "rgb_led_status.h" #ifdef MICROPY_HW_NEOPIXEL From 2c6781f74d0c8b53c0bdcd7f0b954ac831167937 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Fri, 15 Nov 2019 12:59:52 -0500 Subject: [PATCH 040/189] move neopixel_in_use flag to shared-bindings --- ports/atmel-samd/common-hal/microcontroller/Pin.h | 3 --- ports/nrf/common-hal/microcontroller/Pin.h | 3 --- shared-bindings/microcontroller/Pin.h | 4 ++++ 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ports/atmel-samd/common-hal/microcontroller/Pin.h b/ports/atmel-samd/common-hal/microcontroller/Pin.h index 14887207aa..090d7a512a 100644 --- a/ports/atmel-samd/common-hal/microcontroller/Pin.h +++ b/ports/atmel-samd/common-hal/microcontroller/Pin.h @@ -31,9 +31,6 @@ #include "peripherals/samd/pins.h" -#ifdef MICROPY_HW_NEOPIXEL -extern bool neopixel_in_use; -#endif #ifdef MICROPY_HW_APA102_MOSI extern bool apa102_sck_in_use; extern bool apa102_mosi_in_use; diff --git a/ports/nrf/common-hal/microcontroller/Pin.h b/ports/nrf/common-hal/microcontroller/Pin.h index 735ed90cca..5a1fd39616 100644 --- a/ports/nrf/common-hal/microcontroller/Pin.h +++ b/ports/nrf/common-hal/microcontroller/Pin.h @@ -31,9 +31,6 @@ #include "peripherals/nrf/pins.h" -#ifdef MICROPY_HW_NEOPIXEL -extern bool neopixel_in_use; -#endif #ifdef MICROPY_HW_APA102_MOSI extern bool apa102_sck_in_use; extern bool apa102_mosi_in_use; diff --git a/shared-bindings/microcontroller/Pin.h b/shared-bindings/microcontroller/Pin.h index 2d15dd5c58..8762e44127 100644 --- a/shared-bindings/microcontroller/Pin.h +++ b/shared-bindings/microcontroller/Pin.h @@ -30,6 +30,10 @@ #include "common-hal/microcontroller/Pin.h" #include "py/obj.h" +#ifdef MICROPY_HW_NEOPIXEL +extern bool neopixel_in_use; +#endif + // Type object used in Python. Should be shared between ports. extern const mp_obj_type_t mcu_pin_type; From 81223c76bd0c9be22032c09f034dccd84c7c74f7 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Fri, 15 Nov 2019 13:04:25 -0500 Subject: [PATCH 041/189] revert error --- ports/atmel-samd/common-hal/microcontroller/Pin.h | 3 +++ ports/nrf/common-hal/microcontroller/Pin.h | 3 +++ shared-bindings/microcontroller/Pin.h | 4 ---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ports/atmel-samd/common-hal/microcontroller/Pin.h b/ports/atmel-samd/common-hal/microcontroller/Pin.h index 090d7a512a..14887207aa 100644 --- a/ports/atmel-samd/common-hal/microcontroller/Pin.h +++ b/ports/atmel-samd/common-hal/microcontroller/Pin.h @@ -31,6 +31,9 @@ #include "peripherals/samd/pins.h" +#ifdef MICROPY_HW_NEOPIXEL +extern bool neopixel_in_use; +#endif #ifdef MICROPY_HW_APA102_MOSI extern bool apa102_sck_in_use; extern bool apa102_mosi_in_use; diff --git a/ports/nrf/common-hal/microcontroller/Pin.h b/ports/nrf/common-hal/microcontroller/Pin.h index 5a1fd39616..735ed90cca 100644 --- a/ports/nrf/common-hal/microcontroller/Pin.h +++ b/ports/nrf/common-hal/microcontroller/Pin.h @@ -31,6 +31,9 @@ #include "peripherals/nrf/pins.h" +#ifdef MICROPY_HW_NEOPIXEL +extern bool neopixel_in_use; +#endif #ifdef MICROPY_HW_APA102_MOSI extern bool apa102_sck_in_use; extern bool apa102_mosi_in_use; diff --git a/shared-bindings/microcontroller/Pin.h b/shared-bindings/microcontroller/Pin.h index 8762e44127..2d15dd5c58 100644 --- a/shared-bindings/microcontroller/Pin.h +++ b/shared-bindings/microcontroller/Pin.h @@ -30,10 +30,6 @@ #include "common-hal/microcontroller/Pin.h" #include "py/obj.h" -#ifdef MICROPY_HW_NEOPIXEL -extern bool neopixel_in_use; -#endif - // Type object used in Python. Should be shared between ports. extern const mp_obj_type_t mcu_pin_type; From 98fd372d5b602e29b89102c500e4d8e79f9c4d28 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Fri, 15 Nov 2019 13:19:37 -0500 Subject: [PATCH 042/189] Add missing define --- ports/stm32f4/common-hal/microcontroller/Pin.c | 11 +++++++++++ ports/stm32f4/common-hal/microcontroller/Pin.h | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/ports/stm32f4/common-hal/microcontroller/Pin.c b/ports/stm32f4/common-hal/microcontroller/Pin.c index 7e737e21b4..9380bf139a 100644 --- a/ports/stm32f4/common-hal/microcontroller/Pin.c +++ b/ports/stm32f4/common-hal/microcontroller/Pin.c @@ -31,6 +31,17 @@ #include "stm32f4/pins.h" #include "stm32f4xx_hal.h" +#ifdef MICROPY_HW_NEOPIXEL +bool neopixel_in_use; +#endif +#ifdef MICROPY_HW_APA102_MOSI +bool apa102_sck_in_use; +bool apa102_mosi_in_use; +#endif +#ifdef SPEAKER_ENABLE_PIN +bool speaker_enable_in_use; +#endif + #if MCU_PACKAGE == 144 #define GPIO_PORT_COUNT 7 GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG}; diff --git a/ports/stm32f4/common-hal/microcontroller/Pin.h b/ports/stm32f4/common-hal/microcontroller/Pin.h index c42b0801fc..c4c9be6a81 100644 --- a/ports/stm32f4/common-hal/microcontroller/Pin.h +++ b/ports/stm32f4/common-hal/microcontroller/Pin.h @@ -34,6 +34,10 @@ #ifdef MICROPY_HW_NEOPIXEL extern bool neopixel_in_use; #endif +#ifdef MICROPY_HW_APA102_MOSI +extern bool apa102_sck_in_use; +extern bool apa102_mosi_in_use; +#endif void reset_all_pins(void); // reset_pin_number takes the pin number instead of the pointer so that objects don't From 51078cc38f9ae1eb1bd7044ea3a0da1fbac3f3d6 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Fri, 15 Nov 2019 17:17:05 -0500 Subject: [PATCH 043/189] timing tweaks with testing --- .../common-hal/neopixel_write/__init__.c | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/ports/stm32f4/common-hal/neopixel_write/__init__.c b/ports/stm32f4/common-hal/neopixel_write/__init__.c index c5d810ae9b..fd46825d03 100644 --- a/ports/stm32f4/common-hal/neopixel_write/__init__.c +++ b/ports/stm32f4/common-hal/neopixel_write/__init__.c @@ -35,6 +35,11 @@ uint64_t next_start_tick_ms = 0; uint32_t next_start_tick_us = 1000; +//sysclock divisors +#define MAGIC_800_INT 900000 // ~1.11 us -> 1.2 field +#define MAGIC_800_T0H 2800000 // ~0.36 us -> 0.44 field +#define MAGIC_800_T1H 1350000 // ~0.74 us -> 0.84 field + void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout, uint8_t *pixels, uint32_t numBytes) { uint8_t *p = pixels, *end = p + numBytes, pix = *p++, mask = 0x80; @@ -42,32 +47,34 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout uint32_t cyc = 0; //assumes 800_000Hz frequency + //Theoretical values here are 800_000 -> 1.25us, 2500000->0.4us, 1250000->0.8us + //But they don't work, possibly due to bad optimization? Use tested magic values instead uint32_t sys_freq = HAL_RCC_GetSysClockFreq(); - uint32_t interval = sys_freq/800000; // cycles per interval (1.25 us). 210@168MHz - uint32_t t0 = interval - (sys_freq/2500000); // 0.4 us - uint32_t t1 = interval - (sys_freq/1250000); // 0.8 us + uint32_t interval = sys_freq/MAGIC_800_INT; + uint32_t t0 = (sys_freq/MAGIC_800_T0H); + uint32_t t1 = (sys_freq/MAGIC_800_T1H); // This must be called while interrupts are on in case we're waiting for a // future ms tick. wait_until(next_start_tick_ms, next_start_tick_us); + GPIO_TypeDef * p_port = pin_port(digitalinout->pin->port); + uint32_t p_mask = pin_mask(digitalinout->pin->number); + __disable_irq(); // Enable DWT in debug core. Useable when interrupts disabled, as opposed to Systick->VAL - //ITM->LAR = 0xC5ACCE55; //is this required? + //ITM->LAR = 0xC5ACCE55; //this should be required but isn't CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; DWT->CYCCNT = 0; - GPIO_TypeDef * p_port = pin_port(digitalinout->pin->port); - uint32_t p_mask = pin_mask(digitalinout->pin->number); - for(;;) { + start = DWT->CYCCNT; LL_GPIO_SetOutputPin(p_port, p_mask); cyc = (pix & mask) ? t1 : t0; - start = DWT->CYCCNT; while(DWT->CYCCNT - start < cyc); LL_GPIO_ResetOutputPin(p_port, p_mask); - if(!(mask >>= 1)) { //max has shifted all the way + if(!(mask >>= 1)) { if(p >= end) break; pix = *p++; mask = 0x80; From e7df288a344f45e46a7bc49a98c01faf994cbbc2 Mon Sep 17 00:00:00 2001 From: Cedar Grove Maker Studios Date: Sat, 16 Nov 2019 16:40:40 -0800 Subject: [PATCH 044/189] add USB interface description ... to "StringCarM0Ex" --- ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk index 17de6ac742..6dc71978c5 100644 --- a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk @@ -3,6 +3,7 @@ USB_VID = 0x239A USB_PID = 0x8060 USB_PRODUCT = "StringCar M0 Express" USB_MANUFACTURER = "Cedar Grove Studios" +USB_INTERFACE_NAME = "StringCarM0Ex" CHIP_VARIANT = SAMD21E18A CHIP_FAMILY = samd21 From c449748663e9b756336d09606c5f45d830bf1c07 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 Nov 2019 20:21:18 -0600 Subject: [PATCH 045/189] locale: commit results of running "make translate" --- locale/ID.po | 231 ++++++-------- locale/circuitpython.pot | 129 +------- locale/de_DE.po | 230 ++++++-------- locale/en_US.po | 129 +------- locale/en_x_pirate.po | 141 +-------- locale/es.po | 226 ++++++-------- locale/fil.po | 229 ++++++-------- locale/fr.po | 230 ++++++-------- locale/it_IT.po | 230 ++++++-------- locale/ko.po | 642 +++++++++++++++++++++------------------ locale/pl.po | 226 ++++++-------- locale/pt_BR.po | 208 +++++-------- locale/zh_Latn_pinyin.po | 228 ++++++-------- 13 files changed, 1231 insertions(+), 1848 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 9c70789af6..26011a9025 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-10-21 19:50-0700\n" +"POT-Creation-Date: 2019-11-17 20:11-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -438,10 +438,6 @@ msgstr "" msgid "Cannot transfer without MOSI and MISO pins." msgstr "" -#: extmod/moductypes.c -msgid "Cannot unambiguously get sizeof scalar" -msgstr "tidak dapat mendapatkan ukuran scalar secara tidak ambigu" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "" @@ -554,10 +550,6 @@ msgstr "" msgid "EXTINT channel already in use" msgstr "Channel EXTINT sedang digunakan" -#: extmod/modure.c -msgid "Error in regex" -msgstr "Error pada regex" - #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c @@ -762,14 +754,10 @@ msgstr "" msgid "Group full" msgstr "" -#: extmod/vfs_posix_file.c py/objstringio.c +#: py/objstringio.c msgid "I/O operation on closed file" msgstr "operasi I/O pada file tertutup" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "operasi I2C tidak didukung" - #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1108,7 +1096,7 @@ msgstr "" msgid "Read-only" msgstr "" -#: extmod/vfs_fat.c py/moduerrno.c +#: py/moduerrno.c msgid "Read-only filesystem" msgstr "sistem file (filesystem) bersifat Read-only" @@ -1138,7 +1126,7 @@ msgid "Running in safe mode! Not running saved code.\n" msgstr "" "Berjalan di mode aman(safe mode)! tidak menjalankan kode yang tersimpan.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA atau SCL membutuhkan pull up" @@ -1170,10 +1158,6 @@ msgstr "" msgid "Slices not supported" msgstr "" -#: extmod/modure.c -msgid "Splitting with sub-captures" -msgstr "Memisahkan dengan menggunakan sub-captures" - #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "" @@ -1408,19 +1392,6 @@ msgstr "" msgid "__new__ arg must be a user-type" msgstr "" -#: extmod/modubinascii.c extmod/moduhashlib.c -msgid "a bytes-like object is required" -msgstr "sebuah objek menyerupai byte (bytes-like) dibutuhkan" - -#: lib/embed/abort_.c -msgid "abort() called" -msgstr "abort() dipanggil" - -#: extmod/machine_mem.c -#, c-format -msgid "address %08x is not aligned to %d bytes" -msgstr "alamat %08x tidak selaras dengan %d bytes" - #: shared-bindings/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "" @@ -1478,10 +1449,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits harus memilki nilai 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -1513,10 +1480,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "buffers harus mempunyai panjang yang sama" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1747,10 +1710,6 @@ msgstr "" msgid "complex values not supported" msgstr "" -#: extmod/moduzlib.c -msgid "compression header" -msgstr "kompresi header" - #: py/parse.c msgid "constant must be an integer" msgstr "" @@ -1793,10 +1752,6 @@ msgstr "" msgid "empty" msgstr "" -#: extmod/moduheapq.c extmod/modutimeq.c -msgid "empty heap" -msgstr "heap kosong" - #: py/objstr.c msgid "empty separator" msgstr "" @@ -1867,10 +1822,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "bit pertama(firstbit) harus berupa MSB" - #: py/objint.c msgid "float too big" msgstr "" @@ -1939,10 +1890,6 @@ msgstr "" msgid "graphic must be 2048 bytes long" msgstr "" -#: extmod/moduheapq.c -msgid "heap must be a list" -msgstr "heap harus berupa sebuah list" - #: py/compile.c msgid "identifier redefined as global" msgstr "identifier didefinisi ulang sebagai global" @@ -1959,10 +1906,6 @@ msgstr "" msgid "incomplete format key" msgstr "" -#: extmod/modubinascii.c -msgid "incorrect padding" -msgstr "lapisan (padding) tidak benar" - #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -1989,38 +1932,10 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "perangkat I2C tidak valid" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "perangkat SPI tidak valid" - -#: lib/netutils/netutils.c -msgid "invalid arguments" -msgstr "argumen-argumen tidak valid" - -#: extmod/modussl_axtls.c -msgid "invalid cert" -msgstr "cert tidak valid" - -#: extmod/uos_dupterm.c -msgid "invalid dupterm index" -msgstr "indeks dupterm tidak valid" - -#: extmod/modframebuf.c -msgid "invalid format" -msgstr "format tidak valid" - #: py/objstr.c msgid "invalid format specifier" msgstr "" -#: extmod/modussl_axtls.c -msgid "invalid key" -msgstr "key tidak valid" - #: py/compile.c msgid "invalid micropython decorator" msgstr "micropython decorator tidak valid" @@ -2149,10 +2064,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "harus menentukan semua pin sck/mosi/miso" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -2219,10 +2130,6 @@ msgstr "" msgid "non-default argument follows default argument" msgstr "argumen non-default mengikuti argumen standar(default)" -#: extmod/modubinascii.c -msgid "non-hex digit found" -msgstr "digit non-hex ditemukan" - #: py/compile.c msgid "non-keyword arg after */**" msgstr "non-keyword arg setelah */**" @@ -2289,10 +2196,6 @@ msgstr "" msgid "object with buffer protocol required" msgstr "" -#: extmod/modubinascii.c -msgid "odd-length string" -msgstr "panjang data string memiliki keganjilan (odd-length)" - #: py/objstr.c py/objstrunicode.c #, fuzzy msgid "offset out of bounds" @@ -2381,10 +2284,6 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: extmod/modutimeq.c -msgid "queue overflow" -msgstr "antrian meluap (overflow)" - #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "" @@ -2497,18 +2396,6 @@ msgstr "" msgid "string not supported; use bytes or bytearray" msgstr "" -#: extmod/moductypes.c -msgid "struct: cannot index" -msgstr "struct: tidak bisa melakukan index" - -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct: index keluar dari jangkauan" - -#: extmod/moductypes.c -msgid "struct: no fields" -msgstr "struct: tidak ada fields" - #: py/objstr.c msgid "substring not found" msgstr "" @@ -2517,14 +2404,6 @@ msgstr "" msgid "super() can't find self" msgstr "super() tidak dapat menemukan dirinya sendiri" -#: extmod/modujson.c -msgid "syntax error in JSON" -msgstr "sintaksis error pada JSON" - -#: extmod/moductypes.c -msgid "syntax error in uctypes descriptor" -msgstr "sintaksis error pada pendeskripsi uctypes" - #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" msgstr "" @@ -2742,6 +2621,9 @@ msgstr "" #~ msgid "Cannot set STA config" #~ msgstr "Tidak dapat mengatur konfigurasi STA" +#~ msgid "Cannot unambiguously get sizeof scalar" +#~ msgstr "tidak dapat mendapatkan ukuran scalar secara tidak ambigu" + #~ msgid "Cannot update i/f status" #~ msgstr "Tidak dapat memperbarui status i/f" @@ -2761,11 +2643,14 @@ msgstr "" #~ msgid "Error in ffi_prep_cif" #~ msgstr "Errod pada ffi_prep_cif" +#~ msgid "Error in regex" +#~ msgstr "Error pada regex" + #, fuzzy #~ msgid "Failed to acquire mutex" #~ msgstr "Gagal untuk mendapatkan mutex, status: 0x%08lX" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to add characteristic, err 0x%04x" #~ msgstr "Gagal untuk menambahkan karakteristik, status: 0x%08lX" @@ -2773,7 +2658,7 @@ msgstr "" #~ msgid "Failed to add service" #~ msgstr "Gagal untuk menambahkan layanan, status: 0x%08lX" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to add service, err 0x%04x" #~ msgstr "Gagal untuk menambahkan layanan, status: 0x%08lX" @@ -2789,7 +2674,7 @@ msgstr "" #~ msgid "Failed to continue scanning" #~ msgstr "Gagal untuk melanjutkan scanning, status: 0x%08lX" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to continue scanning, err 0x%04x" #~ msgstr "Gagal untuk melanjutkan scanning, status: 0x%08lX" @@ -2813,7 +2698,7 @@ msgstr "" #~ msgid "Failed to start advertising" #~ msgstr "Gagal untuk memulai advertisement, status: 0x%08lX" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to start advertising, err 0x%04x" #~ msgstr "Gagal untuk memulai advertisement, status: 0x%08lX" @@ -2825,13 +2710,16 @@ msgstr "" #~ msgid "Failed to stop advertising" #~ msgstr "Gagal untuk memberhentikan advertisement, status: 0x%08lX" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Gagal untuk memberhentikan advertisement, status: 0x%08lX" #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 tidak mendukung pull up" +#~ msgid "I2C operation not supported" +#~ msgstr "operasi I2C tidak didukung" + #~ msgid "Invalid bit clock pin" #~ msgstr "Bit clock pada pin tidak valid" @@ -2878,10 +2766,13 @@ msgstr "" #~ msgid "STA required" #~ msgstr "STA dibutuhkan" -#, fuzzy, c-format +#, fuzzy #~ msgid "Soft device assert, id: 0x%08lX, pc: 0x%08lX" #~ msgstr "Dukungan soft device, id: 0x%08lX, pc: 0x%08l" +#~ msgid "Splitting with sub-captures" +#~ msgstr "Memisahkan dengan menggunakan sub-captures" + #~ msgid "UART(%d) does not exist" #~ msgstr "UART(%d) tidak ada" @@ -2902,9 +2793,24 @@ msgstr "" #~ msgid "[addrinfo error %d]" #~ msgstr "[addrinfo error %d]" +#~ msgid "a bytes-like object is required" +#~ msgstr "sebuah objek menyerupai byte (bytes-like) dibutuhkan" + +#~ msgid "abort() called" +#~ msgstr "abort() dipanggil" + +#~ msgid "address %08x is not aligned to %d bytes" +#~ msgstr "alamat %08x tidak selaras dengan %d bytes" + +#~ msgid "bits must be 8" +#~ msgstr "bits harus memilki nilai 8" + #~ msgid "buffer too long" #~ msgstr "buffer terlalu panjang" +#~ msgid "buffers must be the same length" +#~ msgstr "buffers harus mempunyai panjang yang sama" + #~ msgid "can query only one param" #~ msgstr "hanya bisa melakukan query satu param" @@ -2920,33 +2826,69 @@ msgstr "" #~ msgid "can't set STA config" #~ msgstr "tidak bisa mendapatkan konfigurasi STA" +#~ msgid "compression header" +#~ msgstr "kompresi header" + #~ msgid "either pos or kw args are allowed" #~ msgstr "hanya antar pos atau kw args yang diperbolehkan" +#~ msgid "empty heap" +#~ msgstr "heap kosong" + #~ msgid "expecting a pin" #~ msgstr "mengharapkan sebuah pin" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" +#~ msgid "firstbit must be MSB" +#~ msgstr "bit pertama(firstbit) harus berupa MSB" + #~ msgid "flash location must be below 1MByte" #~ msgstr "alokasi flash harus dibawah 1MByte" #~ msgid "frequency can only be either 80Mhz or 160MHz" #~ msgstr "frekuensi hanya bisa didefinisikan 80Mhz atau 160Mhz" +#~ msgid "heap must be a list" +#~ msgstr "heap harus berupa sebuah list" + #~ msgid "impossible baudrate" #~ msgstr "baudrate tidak memungkinkan" +#~ msgid "incorrect padding" +#~ msgstr "lapisan (padding) tidak benar" + +#~ msgid "invalid I2C peripheral" +#~ msgstr "perangkat I2C tidak valid" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "perangkat SPI tidak valid" + #~ msgid "invalid alarm" #~ msgstr "alarm tidak valid" +#~ msgid "invalid arguments" +#~ msgstr "argumen-argumen tidak valid" + #~ msgid "invalid buffer length" #~ msgstr "panjang buffer tidak valid" +#~ msgid "invalid cert" +#~ msgstr "cert tidak valid" + #~ msgid "invalid data bits" #~ msgstr "bit data tidak valid" +#~ msgid "invalid dupterm index" +#~ msgstr "indeks dupterm tidak valid" + +#~ msgid "invalid format" +#~ msgstr "format tidak valid" + +#~ msgid "invalid key" +#~ msgstr "key tidak valid" + #~ msgid "invalid pin" #~ msgstr "pin tidak valid" @@ -2959,19 +2901,46 @@ msgstr "" #~ msgid "memory allocation failed, allocating %u bytes for native code" #~ msgstr "alokasi memori gagal, mengalokasikan %u byte untuk kode native" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "harus menentukan semua pin sck/mosi/miso" + #, fuzzy #~ msgid "name must be a string" #~ msgstr "keyword harus berupa string" +#~ msgid "non-hex digit found" +#~ msgstr "digit non-hex ditemukan" + #~ msgid "not a valid ADC Channel: %d" #~ msgstr "tidak valid channel ADC: %d" +#~ msgid "odd-length string" +#~ msgstr "panjang data string memiliki keganjilan (odd-length)" + #~ msgid "pin does not have IRQ capabilities" #~ msgstr "pin tidak memiliki kemampuan IRQ" +#~ msgid "queue overflow" +#~ msgstr "antrian meluap (overflow)" + #~ msgid "scan failed" #~ msgstr "scan gagal" +#~ msgid "struct: cannot index" +#~ msgstr "struct: tidak bisa melakukan index" + +#~ msgid "struct: index out of range" +#~ msgstr "struct: index keluar dari jangkauan" + +#~ msgid "struct: no fields" +#~ msgstr "struct: tidak ada fields" + +#~ msgid "syntax error in JSON" +#~ msgstr "sintaksis error pada JSON" + +#~ msgid "syntax error in uctypes descriptor" +#~ msgstr "sintaksis error pada pendeskripsi uctypes" + #~ msgid "unknown config param" #~ msgstr "konfigurasi param tidak diketahui" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 34aa3ff0aa..ee9f5344a1 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-10-21 19:50-0700\n" +"POT-Creation-Date: 2019-11-17 20:17-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -428,10 +428,6 @@ msgstr "" msgid "Cannot transfer without MOSI and MISO pins." msgstr "" -#: extmod/moductypes.c -msgid "Cannot unambiguously get sizeof scalar" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "" @@ -543,10 +539,6 @@ msgstr "" msgid "EXTINT channel already in use" msgstr "" -#: extmod/modure.c -msgid "Error in regex" -msgstr "" - #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c @@ -748,14 +740,10 @@ msgstr "" msgid "Group full" msgstr "" -#: extmod/vfs_posix_file.c py/objstringio.c +#: py/objstringio.c msgid "I/O operation on closed file" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "" - #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1091,7 +1079,7 @@ msgstr "" msgid "Read-only" msgstr "" -#: extmod/vfs_fat.c py/moduerrno.c +#: py/moduerrno.c msgid "Read-only filesystem" msgstr "" @@ -1119,7 +1107,7 @@ msgstr "" msgid "Running in safe mode! Not running saved code.\n" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "" @@ -1151,10 +1139,6 @@ msgstr "" msgid "Slices not supported" msgstr "" -#: extmod/modure.c -msgid "Splitting with sub-captures" -msgstr "" - #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "" @@ -1376,19 +1360,6 @@ msgstr "" msgid "__new__ arg must be a user-type" msgstr "" -#: extmod/modubinascii.c extmod/moduhashlib.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/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "" @@ -1446,10 +1417,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -1480,10 +1447,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1714,10 +1677,6 @@ msgstr "" msgid "complex values not supported" msgstr "" -#: extmod/moduzlib.c -msgid "compression header" -msgstr "" - #: py/parse.c msgid "constant must be an integer" msgstr "" @@ -1760,10 +1719,6 @@ msgstr "" msgid "empty" msgstr "" -#: extmod/moduheapq.c extmod/modutimeq.c -msgid "empty heap" -msgstr "" - #: py/objstr.c msgid "empty separator" msgstr "" @@ -1834,10 +1789,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "" - #: py/objint.c msgid "float too big" msgstr "" @@ -1906,10 +1857,6 @@ msgstr "" 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 "" @@ -1926,10 +1873,6 @@ msgstr "" msgid "incomplete format key" msgstr "" -#: extmod/modubinascii.c -msgid "incorrect padding" -msgstr "" - #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -1956,38 +1899,10 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -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 "" -#: extmod/modussl_axtls.c -msgid "invalid key" -msgstr "" - #: py/compile.c msgid "invalid micropython decorator" msgstr "" @@ -2116,10 +2031,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -2186,10 +2097,6 @@ msgstr "" 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 "" @@ -2256,10 +2163,6 @@ msgstr "" msgid "object with buffer protocol required" msgstr "" -#: extmod/modubinascii.c -msgid "odd-length string" -msgstr "" - #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "" @@ -2347,10 +2250,6 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: extmod/modutimeq.c -msgid "queue overflow" -msgstr "" - #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "" @@ -2463,18 +2362,6 @@ msgstr "" msgid "string not supported; use bytes or bytearray" msgstr "" -#: extmod/moductypes.c -msgid "struct: cannot index" -msgstr "" - -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "" - -#: extmod/moductypes.c -msgid "struct: no fields" -msgstr "" - #: py/objstr.c msgid "substring not found" msgstr "" @@ -2483,14 +2370,6 @@ msgstr "" 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 "" diff --git a/locale/de_DE.po b/locale/de_DE.po index afe97ff9f8..90ec37a361 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-10-21 19:50-0700\n" +"POT-Creation-Date: 2019-11-17 20:11-0600\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -432,10 +432,6 @@ msgstr "" msgid "Cannot transfer without MOSI and MISO pins." msgstr "Übertragung ohne MOSI- und MISO-Pins nicht möglich." -#: extmod/moductypes.c -msgid "Cannot unambiguously get sizeof scalar" -msgstr "sizeof scalar kann nicht eindeutig bestimmt werden" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Kann nicht ohne MOSI-Pin schreiben." @@ -547,10 +543,6 @@ msgstr "Drive mode wird nicht verwendet, wenn die Richtung input ist." msgid "EXTINT channel already in use" msgstr "EXTINT Kanal ist schon in Benutzung" -#: extmod/modure.c -msgid "Error in regex" -msgstr "Fehler in regex" - #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c @@ -736,7 +728,9 @@ msgstr "" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." -msgstr "Die aufgezeichnete Frequenz liegt über der Leistungsgrenze. Aufnahme angehalten." +msgstr "" +"Die aufgezeichnete Frequenz liegt über der Leistungsgrenze. Aufnahme " +"angehalten." #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c @@ -752,14 +746,10 @@ msgstr "Gruppe schon benutzt" msgid "Group full" msgstr "Gruppe voll" -#: extmod/vfs_posix_file.c py/objstringio.c +#: py/objstringio.c msgid "I/O operation on closed file" msgstr "Lese/Schreibe-operation an geschlossener Datei" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "I2C-operation nicht unterstützt" - #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1112,7 +1102,7 @@ msgstr "Bereich außerhalb der Grenzen" msgid "Read-only" msgstr "Nur lesen möglich, da Schreibgeschützt" -#: extmod/vfs_fat.c py/moduerrno.c +#: py/moduerrno.c msgid "Read-only filesystem" msgstr "Schreibgeschützte Dateisystem" @@ -1140,7 +1130,7 @@ msgstr "Sicherheitsmodus aktiv! Automatisches Neuladen ist deaktiviert.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Sicherheitsmodus aktiv! Gespeicherter Code wird nicht ausgeführt\n" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA oder SCL brauchen pull up" @@ -1172,10 +1162,6 @@ msgstr "Slice und Wert (value) haben unterschiedliche Längen." msgid "Slices not supported" msgstr "Slices werden nicht unterstützt" -#: extmod/modure.c -msgid "Splitting with sub-captures" -msgstr "Splitting mit sub-captures" - #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "Die Stackgröße sollte mindestens 256 sein" @@ -1422,19 +1408,6 @@ msgstr "__init__() sollte None zurückgeben, nicht '%s'" msgid "__new__ arg must be a user-type" msgstr "__new__ arg muss user-type sein" -#: extmod/modubinascii.c extmod/moduhashlib.c -msgid "a bytes-like object is required" -msgstr "ein Byte-ähnliches Objekt ist erforderlich" - -#: lib/embed/abort_.c -msgid "abort() called" -msgstr "abort() wurde aufgerufen" - -#: extmod/machine_mem.c -#, c-format -msgid "address %08x is not aligned to %d bytes" -msgstr "Addresse %08x ist nicht an %d bytes ausgerichtet" - #: shared-bindings/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "Adresse außerhalb der Grenzen" @@ -1492,10 +1465,6 @@ msgstr "Der binäre Operator %q ist nicht implementiert" msgid "bits must be 7, 8 or 9" msgstr "bits muss 7, 8 oder 9 sein" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits müssen 8 sein" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "Es müssen 8 oder 16 bits_per_sample sein" @@ -1526,10 +1495,6 @@ msgstr "Puffersegmente müssen gleich lang sein" msgid "buffer too small" msgstr "Der Puffer ist zu klein" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "Buffer müssen gleich lang sein" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1761,10 +1726,6 @@ msgstr "Komplexe Division durch null" msgid "complex values not supported" msgstr "Komplexe Zahlen nicht unterstützt" -#: extmod/moduzlib.c -msgid "compression header" -msgstr "kompression header" - #: py/parse.c msgid "constant must be an integer" msgstr "constant muss ein integer sein" @@ -1807,10 +1768,6 @@ msgstr "Division durch Null" msgid "empty" msgstr "leer" -#: extmod/moduheapq.c extmod/modutimeq.c -msgid "empty heap" -msgstr "leerer heap" - #: py/objstr.c msgid "empty separator" msgstr "leeres Trennzeichen" @@ -1881,10 +1838,6 @@ msgstr "Das Dateisystem muss eine Mount-Methode bereitstellen" msgid "first argument to super() must be type" msgstr "Das erste Argument für super() muss type sein" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "Erstes Bit muss das höchstwertigste Bit (MSB) sein" - #: py/objint.c msgid "float too big" msgstr "float zu groß" @@ -1954,10 +1907,6 @@ msgstr "Generator ignoriert GeneratorExit" msgid "graphic must be 2048 bytes long" msgstr "graphic muss 2048 Byte lang sein" -#: extmod/moduheapq.c -msgid "heap must be a list" -msgstr "heap muss eine Liste sein" - #: py/compile.c msgid "identifier redefined as global" msgstr "Bezeichner als global neu definiert" @@ -1974,10 +1923,6 @@ msgstr "unvollständiges Format" msgid "incomplete format key" msgstr "unvollständiger Formatschlüssel" -#: extmod/modubinascii.c -msgid "incorrect padding" -msgstr "padding ist inkorrekt" - #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -2004,38 +1949,10 @@ msgstr "integer erforderlich" msgid "interval must be in range %s-%s" msgstr "Das Intervall muss im Bereich %s-%s sein" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "ungültige I2C Schnittstelle" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "ungültige SPI Schnittstelle" - -#: lib/netutils/netutils.c -msgid "invalid arguments" -msgstr "ungültige argumente" - -#: extmod/modussl_axtls.c -msgid "invalid cert" -msgstr "ungültiges cert" - -#: extmod/uos_dupterm.c -msgid "invalid dupterm index" -msgstr "ungültiger dupterm index" - -#: extmod/modframebuf.c -msgid "invalid format" -msgstr "ungültiges Format" - #: py/objstr.c msgid "invalid format specifier" msgstr "ungültiger Formatbezeichner" -#: extmod/modussl_axtls.c -msgid "invalid key" -msgstr "ungültiger Schlüssel" - #: py/compile.c msgid "invalid micropython decorator" msgstr "ungültiger micropython decorator" @@ -2170,10 +2087,6 @@ msgstr "Mehrfache Vererbung nicht unterstützt" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "sck/mosi/miso müssen alle spezifiziert sein" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "muss Schlüsselwortargument für key function verwenden" @@ -2240,10 +2153,6 @@ msgstr "" msgid "non-default argument follows default argument" msgstr "ein non-default argument folgt auf ein default argument" -#: extmod/modubinascii.c -msgid "non-hex digit found" -msgstr "eine nicht-hex zahl wurde gefunden" - #: py/compile.c msgid "non-keyword arg after */**" msgstr "" @@ -2310,10 +2219,6 @@ msgstr "Objekt vom Typ '%s' hat keine len()" msgid "object with buffer protocol required" msgstr "Objekt mit Pufferprotokoll (buffer protocol) erforderlich" -#: extmod/modubinascii.c -msgid "odd-length string" -msgstr "String mit ungerader Länge" - #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "offset außerhalb der Grenzen" @@ -2403,10 +2308,6 @@ msgstr "pow() drittes Argument darf nicht 0 sein" msgid "pow() with 3 arguments requires integers" msgstr "" -#: extmod/modutimeq.c -msgid "queue overflow" -msgstr "Warteschlangenüberlauf" - #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "rawbuf hat nicht die gleiche Größe wie buf" @@ -2522,18 +2423,6 @@ msgid "string not supported; use bytes or bytearray" msgstr "" "Zeichenfolgen werden nicht unterstützt; Verwenden Sie bytes oder bytearray" -#: extmod/moductypes.c -msgid "struct: cannot index" -msgstr "struct: kann nicht indexieren" - -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct: index außerhalb gültigen Bereichs" - -#: extmod/moductypes.c -msgid "struct: no fields" -msgstr "struct: keine Felder" - #: py/objstr.c msgid "substring not found" msgstr "substring nicht gefunden" @@ -2542,14 +2431,6 @@ msgstr "substring nicht gefunden" msgid "super() can't find self" msgstr "super() kann self nicht finden" -#: extmod/modujson.c -msgid "syntax error in JSON" -msgstr "Syntaxfehler in JSON" - -#: extmod/moductypes.c -msgid "syntax error in uctypes descriptor" -msgstr "Syntaxfehler in uctypes Deskriptor" - #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" msgstr "threshold muss im Intervall 0-65536 liegen" @@ -2785,6 +2666,9 @@ msgstr "" #~ msgid "Cannot set STA config" #~ msgstr "Kann STA Konfiguration nicht setzen" +#~ msgid "Cannot unambiguously get sizeof scalar" +#~ msgstr "sizeof scalar kann nicht eindeutig bestimmt werden" + #~ msgid "Cannot update i/f status" #~ msgstr "Kann i/f Status nicht updaten" @@ -2810,20 +2694,21 @@ msgstr "" #~ msgid "Error in ffi_prep_cif" #~ msgstr "Fehler in ffi_prep_cif" +#~ msgid "Error in regex" +#~ msgstr "Fehler in regex" + #~ msgid "Expected a Peripheral" #~ msgstr "Ein Peripheriegerät wird erwartet" #~ msgid "Failed to acquire mutex" #~ msgstr "Akquirieren des Mutex gescheitert" -#, c-format #~ msgid "Failed to add characteristic, err 0x%04x" #~ msgstr "Hinzufügen des Characteristic ist gescheitert. Status: 0x%04x" #~ msgid "Failed to add service" #~ msgstr "Dienst konnte nicht hinzugefügt werden" -#, c-format #~ msgid "Failed to add service, err 0x%04x" #~ msgstr "Dienst konnte nicht hinzugefügt werden. Status: 0x%04x" @@ -2836,7 +2721,6 @@ msgstr "" #~ msgid "Failed to continue scanning" #~ msgstr "Der Scanvorgang kann nicht fortgesetzt werden" -#, c-format #~ msgid "Failed to continue scanning, err 0x%04x" #~ msgstr "Der Scanvorgang kann nicht fortgesetzt werden. Status: 0x%04x" @@ -2852,18 +2736,15 @@ msgstr "" #~ msgid "Failed to release mutex" #~ msgstr "Loslassen des Mutex gescheitert" -#, c-format #~ msgid "Failed to set device name, err 0x%04x" #~ msgstr "Gerätename konnte nicht gesetzt werden, Status: 0x%04x" #~ msgid "Failed to start advertising" #~ msgstr "Kann advertisement nicht starten" -#, c-format #~ msgid "Failed to start advertising, err 0x%04x" #~ msgstr "Kann advertisement nicht starten. Status: 0x%04x" -#, c-format #~ msgid "Failed to start pairing, error 0x%04x" #~ msgstr "Starten des Koppelns fehlgeschlagen, Status: 0x%04x" @@ -2873,7 +2754,6 @@ msgstr "" #~ msgid "Failed to stop advertising" #~ msgstr "Kann advertisement nicht stoppen" -#, c-format #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Kann advertisement nicht stoppen. Status: 0x%04x" @@ -2884,6 +2764,9 @@ msgstr "" #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 unterstützt pull up nicht" +#~ msgid "I2C operation not supported" +#~ msgstr "I2C-operation nicht unterstützt" + #~ msgid "Invalid bit clock pin" #~ msgstr "Ungültiges bit clock pin" @@ -2942,6 +2825,9 @@ msgstr "" #~ msgid "STA required" #~ msgstr "STA erforderlich" +#~ msgid "Splitting with sub-captures" +#~ msgstr "Splitting mit sub-captures" + #~ msgid "UART(%d) does not exist" #~ msgstr "UART(%d) existiert nicht" @@ -2964,9 +2850,30 @@ msgstr "" #~ msgid "Voice index too high" #~ msgstr "Voice index zu hoch" +#~ msgid "a bytes-like object is required" +#~ msgstr "ein Byte-ähnliches Objekt ist erforderlich" + +#~ msgid "abort() called" +#~ msgstr "abort() wurde aufgerufen" + +#~ msgid "address %08x is not aligned to %d bytes" +#~ msgstr "Addresse %08x ist nicht an %d bytes ausgerichtet" + +#~ msgid "bits must be 8" +#~ msgstr "bits müssen 8 sein" + #~ msgid "buffer too long" #~ msgstr "Buffer zu lang" +#~ msgid "buffers must be the same length" +#~ msgstr "Buffer müssen gleich lang sein" + +#~ msgid "compression header" +#~ msgstr "kompression header" + +#~ msgid "empty heap" +#~ msgstr "leerer heap" + #~ msgid "expected a DigitalInOut" #~ msgstr "erwarte DigitalInOut" @@ -2976,27 +2883,57 @@ msgstr "" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" +#~ msgid "firstbit must be MSB" +#~ msgstr "Erstes Bit muss das höchstwertigste Bit (MSB) sein" + #~ msgid "flash location must be below 1MByte" #~ msgstr "flash location muss unter 1MByte sein" #~ msgid "frequency can only be either 80Mhz or 160MHz" #~ msgstr "Die Frequenz kann nur 80Mhz oder 160Mhz sein" +#~ msgid "heap must be a list" +#~ msgstr "heap muss eine Liste sein" + #~ msgid "impossible baudrate" #~ msgstr "Unmögliche Baudrate" +#~ msgid "incorrect padding" +#~ msgstr "padding ist inkorrekt" + #~ msgid "interval not in range 0.0020 to 10.24" #~ msgstr "Das Interval ist nicht im Bereich 0.0020 bis 10.24" +#~ msgid "invalid I2C peripheral" +#~ msgstr "ungültige I2C Schnittstelle" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "ungültige SPI Schnittstelle" + #~ msgid "invalid alarm" #~ msgstr "ungültiger Alarm" +#~ msgid "invalid arguments" +#~ msgstr "ungültige argumente" + #~ msgid "invalid buffer length" #~ msgstr "ungültige Pufferlänge" +#~ msgid "invalid cert" +#~ msgstr "ungültiges cert" + #~ msgid "invalid data bits" #~ msgstr "ungültige Datenbits" +#~ msgid "invalid dupterm index" +#~ msgstr "ungültiger dupterm index" + +#~ msgid "invalid format" +#~ msgstr "ungültiges Format" + +#~ msgid "invalid key" +#~ msgstr "ungültiger Schlüssel" + #~ msgid "invalid pin" #~ msgstr "ungültiger Pin" @@ -3010,18 +2947,45 @@ msgstr "" #~ msgstr "" #~ "Speicherallozierung fehlgeschlagen, alloziere %u Bytes für nativen Code" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "sck/mosi/miso müssen alle spezifiziert sein" + #~ msgid "name must be a string" #~ msgstr "name muss ein String sein" +#~ msgid "non-hex digit found" +#~ msgstr "eine nicht-hex zahl wurde gefunden" + #~ msgid "not a valid ADC Channel: %d" #~ msgstr "Kein gültiger ADC Kanal: %d" +#~ msgid "odd-length string" +#~ msgstr "String mit ungerader Länge" + #~ msgid "pin does not have IRQ capabilities" #~ msgstr "Pin hat keine IRQ Fähigkeiten" +#~ msgid "queue overflow" +#~ msgstr "Warteschlangenüberlauf" + #~ msgid "scan failed" #~ msgstr "Scan fehlgeschlagen" +#~ msgid "struct: cannot index" +#~ msgstr "struct: kann nicht indexieren" + +#~ msgid "struct: index out of range" +#~ msgstr "struct: index außerhalb gültigen Bereichs" + +#~ msgid "struct: no fields" +#~ msgstr "struct: keine Felder" + +#~ msgid "syntax error in JSON" +#~ msgstr "Syntaxfehler in JSON" + +#~ msgid "syntax error in uctypes descriptor" +#~ msgstr "Syntaxfehler in uctypes Deskriptor" + #~ msgid "too many arguments" #~ msgstr "zu viele Argumente" diff --git a/locale/en_US.po b/locale/en_US.po index b30e17cecc..9b234599a3 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-10-21 19:50-0700\n" +"POT-Creation-Date: 2019-11-17 20:11-0600\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -428,10 +428,6 @@ msgstr "" msgid "Cannot transfer without MOSI and MISO pins." msgstr "" -#: extmod/moductypes.c -msgid "Cannot unambiguously get sizeof scalar" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "" @@ -543,10 +539,6 @@ msgstr "" msgid "EXTINT channel already in use" msgstr "" -#: extmod/modure.c -msgid "Error in regex" -msgstr "" - #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c @@ -748,14 +740,10 @@ msgstr "" msgid "Group full" msgstr "" -#: extmod/vfs_posix_file.c py/objstringio.c +#: py/objstringio.c msgid "I/O operation on closed file" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "" - #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1091,7 +1079,7 @@ msgstr "" msgid "Read-only" msgstr "" -#: extmod/vfs_fat.c py/moduerrno.c +#: py/moduerrno.c msgid "Read-only filesystem" msgstr "" @@ -1119,7 +1107,7 @@ msgstr "" msgid "Running in safe mode! Not running saved code.\n" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "" @@ -1151,10 +1139,6 @@ msgstr "" msgid "Slices not supported" msgstr "" -#: extmod/modure.c -msgid "Splitting with sub-captures" -msgstr "" - #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "" @@ -1376,19 +1360,6 @@ msgstr "" msgid "__new__ arg must be a user-type" msgstr "" -#: extmod/modubinascii.c extmod/moduhashlib.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/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "" @@ -1446,10 +1417,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -1480,10 +1447,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1714,10 +1677,6 @@ msgstr "" msgid "complex values not supported" msgstr "" -#: extmod/moduzlib.c -msgid "compression header" -msgstr "" - #: py/parse.c msgid "constant must be an integer" msgstr "" @@ -1760,10 +1719,6 @@ msgstr "" msgid "empty" msgstr "" -#: extmod/moduheapq.c extmod/modutimeq.c -msgid "empty heap" -msgstr "" - #: py/objstr.c msgid "empty separator" msgstr "" @@ -1834,10 +1789,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "" - #: py/objint.c msgid "float too big" msgstr "" @@ -1906,10 +1857,6 @@ msgstr "" 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 "" @@ -1926,10 +1873,6 @@ msgstr "" msgid "incomplete format key" msgstr "" -#: extmod/modubinascii.c -msgid "incorrect padding" -msgstr "" - #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -1956,38 +1899,10 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -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 "" -#: extmod/modussl_axtls.c -msgid "invalid key" -msgstr "" - #: py/compile.c msgid "invalid micropython decorator" msgstr "" @@ -2116,10 +2031,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -2186,10 +2097,6 @@ msgstr "" 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 "" @@ -2256,10 +2163,6 @@ msgstr "" msgid "object with buffer protocol required" msgstr "" -#: extmod/modubinascii.c -msgid "odd-length string" -msgstr "" - #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "" @@ -2347,10 +2250,6 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: extmod/modutimeq.c -msgid "queue overflow" -msgstr "" - #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "" @@ -2463,18 +2362,6 @@ msgstr "" msgid "string not supported; use bytes or bytearray" msgstr "" -#: extmod/moductypes.c -msgid "struct: cannot index" -msgstr "" - -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "" - -#: extmod/moductypes.c -msgid "struct: no fields" -msgstr "" - #: py/objstr.c msgid "substring not found" msgstr "" @@ -2483,14 +2370,6 @@ msgstr "" 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 "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index f9bb0a4002..9fea903c32 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-10-21 19:50-0700\n" +"POT-Creation-Date: 2019-11-17 20:11-0600\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -432,10 +432,6 @@ msgstr "" msgid "Cannot transfer without MOSI and MISO pins." msgstr "" -#: extmod/moductypes.c -msgid "Cannot unambiguously get sizeof scalar" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "" @@ -547,10 +543,6 @@ msgstr "" msgid "EXTINT channel already in use" msgstr "Avast! EXTINT channel already in use" -#: extmod/modure.c -msgid "Error in regex" -msgstr "" - #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c @@ -752,14 +744,10 @@ msgstr "" msgid "Group full" msgstr "" -#: extmod/vfs_posix_file.c py/objstringio.c +#: py/objstringio.c msgid "I/O operation on closed file" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "" - #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1095,7 +1083,7 @@ msgstr "" msgid "Read-only" msgstr "" -#: extmod/vfs_fat.c py/moduerrno.c +#: py/moduerrno.c msgid "Read-only filesystem" msgstr "" @@ -1123,7 +1111,7 @@ msgstr "Runnin' in safe mode! Auto-reload be off.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Runnin' in safe mode! Nay runnin' saved code.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "" @@ -1155,10 +1143,6 @@ msgstr "" msgid "Slices not supported" msgstr "" -#: extmod/modure.c -msgid "Splitting with sub-captures" -msgstr "" - #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "" @@ -1380,19 +1364,6 @@ msgstr "" msgid "__new__ arg must be a user-type" msgstr "" -#: extmod/modubinascii.c extmod/moduhashlib.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/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "" @@ -1450,10 +1421,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "pieces must be of 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -1484,10 +1451,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "yer buffers must be of the same length" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1718,10 +1681,6 @@ msgstr "" msgid "complex values not supported" msgstr "" -#: extmod/moduzlib.c -msgid "compression header" -msgstr "" - #: py/parse.c msgid "constant must be an integer" msgstr "" @@ -1764,10 +1723,6 @@ msgstr "" msgid "empty" msgstr "" -#: extmod/moduheapq.c extmod/modutimeq.c -msgid "empty heap" -msgstr "" - #: py/objstr.c msgid "empty separator" msgstr "" @@ -1838,10 +1793,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "" - #: py/objint.c msgid "float too big" msgstr "" @@ -1910,10 +1861,6 @@ msgstr "" 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 "" @@ -1930,10 +1877,6 @@ msgstr "" msgid "incomplete format key" msgstr "" -#: extmod/modubinascii.c -msgid "incorrect padding" -msgstr "" - #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -1960,38 +1903,10 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "Belay that! I2C peripheral be invalid" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "Arr! SPI peripheral be invalid" - -#: 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 "" -#: extmod/modussl_axtls.c -msgid "invalid key" -msgstr "" - #: py/compile.c msgid "invalid micropython decorator" msgstr "" @@ -2120,10 +2035,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -2190,10 +2101,6 @@ msgstr "" 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 "" @@ -2260,10 +2167,6 @@ msgstr "" msgid "object with buffer protocol required" msgstr "" -#: extmod/modubinascii.c -msgid "odd-length string" -msgstr "" - #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "" @@ -2351,10 +2254,6 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: extmod/modutimeq.c -msgid "queue overflow" -msgstr "" - #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "" @@ -2467,18 +2366,6 @@ msgstr "" msgid "string not supported; use bytes or bytearray" msgstr "" -#: extmod/moductypes.c -msgid "struct: cannot index" -msgstr "" - -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "" - -#: extmod/moductypes.c -msgid "struct: no fields" -msgstr "" - #: py/objstr.c msgid "substring not found" msgstr "" @@ -2487,14 +2374,6 @@ msgstr "" 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 "" @@ -2710,3 +2589,15 @@ msgstr "" #~ msgid "Invalid clock pin" #~ msgstr "Avast! Clock pin be invalid" + +#~ msgid "bits must be 8" +#~ msgstr "pieces must be of 8" + +#~ msgid "buffers must be the same length" +#~ msgstr "yer buffers must be of the same length" + +#~ msgid "invalid I2C peripheral" +#~ msgstr "Belay that! I2C peripheral be invalid" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "Arr! SPI peripheral be invalid" diff --git a/locale/es.po b/locale/es.po index 8bcfcedbe3..2c029edd54 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-10-21 19:50-0700\n" +"POT-Creation-Date: 2019-11-17 20:11-0600\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -436,10 +436,6 @@ msgstr "Cannot subclass slice" msgid "Cannot transfer without MOSI and MISO pins." msgstr "No se puede transmitir sin pines MOSI y MISO." -#: extmod/moductypes.c -msgid "Cannot unambiguously get sizeof scalar" -msgstr "No se puede obtener inequívocamente sizeof escalar" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "No se puede escribir sin pin MOSI." @@ -551,10 +547,6 @@ msgstr "Modo Drive no se usa cuando la dirección es input." msgid "EXTINT channel already in use" msgstr "El canal EXTINT ya está siendo utilizado" -#: extmod/modure.c -msgid "Error in regex" -msgstr "Error en regex" - #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c @@ -757,14 +749,10 @@ msgstr "" msgid "Group full" msgstr "Group lleno" -#: extmod/vfs_posix_file.c py/objstringio.c +#: py/objstringio.c msgid "I/O operation on closed file" msgstr "Operación I/O en archivo cerrado" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "operación I2C no soportada" - #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1116,7 +1104,7 @@ msgstr "address fuera de límites" msgid "Read-only" msgstr "Solo-lectura" -#: extmod/vfs_fat.c py/moduerrno.c +#: py/moduerrno.c msgid "Read-only filesystem" msgstr "Sistema de archivos de solo-Lectura" @@ -1145,7 +1133,7 @@ msgstr "Ejecutando en modo seguro! La auto-recarga esta deshabilitada.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Ejecutando en modo seguro! No se esta ejecutando el código guardado.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA o SCL necesitan una pull up" @@ -1177,10 +1165,6 @@ msgstr "Slice y value tienen diferentes longitudes" msgid "Slices not supported" msgstr "Rebanadas no soportadas" -#: extmod/modure.c -msgid "Splitting with sub-captures" -msgstr "Dividiendo con sub-capturas" - #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "El tamaño de la pila debe ser de al menos 256" @@ -1423,19 +1407,6 @@ msgstr "__init__() deberia devolver None, no '%s'" msgid "__new__ arg must be a user-type" msgstr "__new__ arg debe ser un user-type" -#: extmod/modubinascii.c extmod/moduhashlib.c -msgid "a bytes-like object is required" -msgstr "se requiere un objeto bytes-like" - -#: lib/embed/abort_.c -msgid "abort() called" -msgstr "se llamó abort()" - -#: extmod/machine_mem.c -#, c-format -msgid "address %08x is not aligned to %d bytes" -msgstr "la dirección %08x no esta alineada a %d bytes" - #: shared-bindings/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "address fuera de límites" @@ -1493,10 +1464,6 @@ msgstr "operacion binaria %q no implementada" msgid "bits must be 7, 8 or 9" msgstr "bits deben ser 7, 8 ó 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits debe ser 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample debe ser 8 ó 16" @@ -1527,10 +1494,6 @@ msgstr "Las secciones del buffer necesitan tener longitud igual" msgid "buffer too small" msgstr "buffer demasiado pequeño" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "los buffers deben de tener la misma longitud" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "los botones necesitan ser digitalio.DigitalInOut" @@ -1766,10 +1729,6 @@ msgstr "división compleja por cero" msgid "complex values not supported" msgstr "valores complejos no soportados" -#: extmod/moduzlib.c -msgid "compression header" -msgstr "encabezado de compresión" - #: py/parse.c msgid "constant must be an integer" msgstr "constant debe ser un entero" @@ -1814,10 +1773,6 @@ msgstr "división por cero" msgid "empty" msgstr "vacío" -#: extmod/moduheapq.c extmod/modutimeq.c -msgid "empty heap" -msgstr "heap vacío" - #: py/objstr.c msgid "empty separator" msgstr "separator vacío" @@ -1888,10 +1843,6 @@ msgstr "sistema de archivos debe proporcionar método de montaje" msgid "first argument to super() must be type" msgstr "primer argumento para super() debe ser de tipo" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "firstbit debe ser MSB" - #: py/objint.c msgid "float too big" msgstr "" @@ -1960,10 +1911,6 @@ msgstr "generador ignorado GeneratorExit" msgid "graphic must be 2048 bytes long" msgstr "graphic debe ser 2048 bytes de largo" -#: extmod/moduheapq.c -msgid "heap must be a list" -msgstr "heap debe ser una lista" - #: py/compile.c msgid "identifier redefined as global" msgstr "identificador redefinido como global" @@ -1980,10 +1927,6 @@ msgstr "formato incompleto" msgid "incomplete format key" msgstr "" -#: extmod/modubinascii.c -msgid "incorrect padding" -msgstr "relleno (padding) incorrecto" - #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -2010,38 +1953,10 @@ msgstr "Entero requerido" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "periférico I2C inválido" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "periférico SPI inválido" - -#: lib/netutils/netutils.c -msgid "invalid arguments" -msgstr "argumentos inválidos" - -#: extmod/modussl_axtls.c -msgid "invalid cert" -msgstr "certificado inválido" - -#: extmod/uos_dupterm.c -msgid "invalid dupterm index" -msgstr "index dupterm inválido" - -#: extmod/modframebuf.c -msgid "invalid format" -msgstr "formato inválido" - #: py/objstr.c msgid "invalid format specifier" msgstr "especificador de formato inválido" -#: extmod/modussl_axtls.c -msgid "invalid key" -msgstr "llave inválida" - #: py/compile.c msgid "invalid micropython decorator" msgstr "decorador de micropython inválido" @@ -2173,10 +2088,6 @@ msgstr "herencia multiple no soportada" msgid "must raise an object" msgstr "debe hacer un raise de un objeto" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "se deben de especificar sck/mosi/miso" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "debe utilizar argumento de palabra clave para la función clave" @@ -2243,10 +2154,6 @@ msgstr "" msgid "non-default argument follows default argument" msgstr "argumento no predeterminado sigue argumento predeterminado" -#: extmod/modubinascii.c -msgid "non-hex digit found" -msgstr "digito non-hex encontrado" - #: py/compile.c msgid "non-keyword arg after */**" msgstr "no deberia estar/tener agumento por palabra clave despues de */**" @@ -2316,10 +2223,6 @@ msgstr "el objeto de tipo '%s' no tiene len()" msgid "object with buffer protocol required" msgstr "objeto con protocolo de buffer requerido" -#: extmod/modubinascii.c -msgid "odd-length string" -msgstr "string de longitud impar" - #: py/objstr.c py/objstrunicode.c #, fuzzy msgid "offset out of bounds" @@ -2408,10 +2311,6 @@ msgstr "el 3er argumento de pow() no puede ser 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() con 3 argumentos requiere enteros" -#: extmod/modutimeq.c -msgid "queue overflow" -msgstr "desbordamiento de cola(queue)" - #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "rawbuf no es el mismo tamaño que buf" @@ -2528,18 +2427,6 @@ msgstr "índices de string deben ser enteros, no %s" msgid "string not supported; use bytes or bytearray" msgstr "string no soportado; usa bytes o bytearray" -#: extmod/moductypes.c -msgid "struct: cannot index" -msgstr "struct: no se puede indexar" - -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct: index fuera de rango" - -#: extmod/moductypes.c -msgid "struct: no fields" -msgstr "struct: sin campos" - #: py/objstr.c msgid "substring not found" msgstr "substring no encontrado" @@ -2548,14 +2435,6 @@ msgstr "substring no encontrado" msgid "super() can't find self" msgstr "super() no puede encontrar self" -#: extmod/modujson.c -msgid "syntax error in JSON" -msgstr "error de sintaxis en JSON" - -#: extmod/moductypes.c -msgid "syntax error in uctypes descriptor" -msgstr "error de sintaxis en el descriptor uctypes" - #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" msgstr "limite debe ser en el rango 0-65536" @@ -2786,6 +2665,9 @@ msgstr "paso cero" #~ msgid "Cannot set STA config" #~ msgstr "No se puede establecer STA config" +#~ msgid "Cannot unambiguously get sizeof scalar" +#~ msgstr "No se puede obtener inequívocamente sizeof escalar" + #~ msgid "Cannot update i/f status" #~ msgstr "No se puede actualizar i/f status" @@ -2811,11 +2693,14 @@ msgstr "paso cero" #~ msgid "Error in ffi_prep_cif" #~ msgstr "Error en ffi_prep_cif" +#~ msgid "Error in regex" +#~ msgstr "Error en regex" + #, fuzzy #~ msgid "Failed to acquire mutex" #~ msgstr "No se puede adquirir el mutex, status: 0x%08lX" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to add characteristic, err 0x%04x" #~ msgstr "Fallo al añadir caracteristica, err: 0x%08lX" @@ -2823,7 +2708,6 @@ msgstr "paso cero" #~ msgid "Failed to add service" #~ msgstr "No se puede detener el anuncio. status: 0x%02x" -#, c-format #~ msgid "Failed to add service, err 0x%04x" #~ msgstr "Fallo al agregar servicio. err: 0x%02x" @@ -2838,7 +2722,6 @@ msgstr "paso cero" #~ msgid "Failed to continue scanning" #~ msgstr "No se puede iniciar el escaneo. status: 0x%02x" -#, c-format #~ msgid "Failed to continue scanning, err 0x%04x" #~ msgstr "No se puede iniciar el escaneo. err: 0x%02x" @@ -2862,7 +2745,6 @@ msgstr "paso cero" #~ msgid "Failed to start advertising" #~ msgstr "No se puede inicar el anuncio. status: 0x%02x" -#, c-format #~ msgid "Failed to start advertising, err 0x%04x" #~ msgstr "No se puede inicar el anuncio. err: 0x%04x" @@ -2874,7 +2756,6 @@ msgstr "paso cero" #~ msgid "Failed to stop advertising" #~ msgstr "No se puede detener el anuncio. status: 0x%02x" -#, c-format #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "No se puede detener el anuncio. err: 0x%04x" @@ -2884,6 +2765,9 @@ msgstr "paso cero" #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 no soporta pull up." +#~ msgid "I2C operation not supported" +#~ msgstr "operación I2C no soportada" + #~ msgid "Invalid bit clock pin" #~ msgstr "Pin bit clock inválido" @@ -2952,10 +2836,12 @@ msgstr "paso cero" #~ msgid "STA required" #~ msgstr "STA requerido" -#, c-format #~ msgid "Soft device assert, id: 0x%08lX, pc: 0x%08lX" #~ msgstr "Soft device assert, id: 0x%08lX, pc: 0x%08lX" +#~ msgid "Splitting with sub-captures" +#~ msgstr "Dividiendo con sub-capturas" + #~ msgid "Tile indices must be 0 - 255" #~ msgstr "Los índices de Tile deben ser 0 - 255" @@ -2981,12 +2867,27 @@ msgstr "paso cero" #~ msgid "Voice index too high" #~ msgstr "Index de voz demasiado alto" +#~ msgid "a bytes-like object is required" +#~ msgstr "se requiere un objeto bytes-like" + +#~ msgid "abort() called" +#~ msgstr "se llamó abort()" + +#~ msgid "address %08x is not aligned to %d bytes" +#~ msgstr "la dirección %08x no esta alineada a %d bytes" + #~ msgid "bad GATT role" #~ msgstr "mal GATT role" +#~ msgid "bits must be 8" +#~ msgstr "bits debe ser 8" + #~ msgid "buffer too long" #~ msgstr "buffer demasiado largo" +#~ msgid "buffers must be the same length" +#~ msgstr "los buffers deben de tener la misma longitud" + #~ msgid "can query only one param" #~ msgstr "puede consultar solo un param" @@ -3005,9 +2906,15 @@ msgstr "paso cero" #~ msgid "characteristics includes an object that is not a Characteristic" #~ msgstr "characteristics incluye un objeto que no es una Characteristica" +#~ msgid "compression header" +#~ msgstr "encabezado de compresión" + #~ msgid "either pos or kw args are allowed" #~ msgstr "ya sea pos o kw args son permitidos" +#~ msgid "empty heap" +#~ msgstr "heap vacío" + #~ msgid "expected a DigitalInOut" #~ msgstr "se espera un DigitalInOut" @@ -3017,27 +2924,57 @@ msgstr "paso cero" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" +#~ msgid "firstbit must be MSB" +#~ msgstr "firstbit debe ser MSB" + #~ msgid "flash location must be below 1MByte" #~ msgstr "la ubicación de la flash debe estar debajo de 1MByte" #~ msgid "frequency can only be either 80Mhz or 160MHz" #~ msgstr "la frecuencia solo puede ser 80MHz ó 160MHz" +#~ msgid "heap must be a list" +#~ msgstr "heap debe ser una lista" + #~ msgid "impossible baudrate" #~ msgstr "baudrate imposible" +#~ msgid "incorrect padding" +#~ msgstr "relleno (padding) incorrecto" + #~ msgid "interval not in range 0.0020 to 10.24" #~ msgstr "El intervalo está fuera del rango de 0.0020 a 10.24" +#~ msgid "invalid I2C peripheral" +#~ msgstr "periférico I2C inválido" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "periférico SPI inválido" + #~ msgid "invalid alarm" #~ msgstr "alarma inválida" +#~ msgid "invalid arguments" +#~ msgstr "argumentos inválidos" + #~ msgid "invalid buffer length" #~ msgstr "longitud de buffer inválida" +#~ msgid "invalid cert" +#~ msgstr "certificado inválido" + #~ msgid "invalid data bits" #~ msgstr "data bits inválidos" +#~ msgid "invalid dupterm index" +#~ msgstr "index dupterm inválido" + +#~ msgid "invalid format" +#~ msgstr "formato inválido" + +#~ msgid "invalid key" +#~ msgstr "llave inválida" + #~ msgid "invalid pin" #~ msgstr "pin inválido" @@ -3051,18 +2988,30 @@ msgstr "paso cero" #~ msgstr "" #~ "falló la asignación de memoria, asignando %u bytes para código nativo" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "se deben de especificar sck/mosi/miso" + #~ msgid "name must be a string" #~ msgstr "name debe de ser un string" +#~ msgid "non-hex digit found" +#~ msgstr "digito non-hex encontrado" + #~ msgid "not a valid ADC Channel: %d" #~ msgstr "no es un canal ADC válido: %d" +#~ msgid "odd-length string" +#~ msgstr "string de longitud impar" + #~ msgid "pin does not have IRQ capabilities" #~ msgstr "pin sin capacidades IRQ" #~ msgid "position must be 2-tuple" #~ msgstr "posición debe ser 2-tuple" +#~ msgid "queue overflow" +#~ msgstr "desbordamiento de cola(queue)" + #~ msgid "row must be packed and word aligned" #~ msgstr "la fila debe estar empacada y la palabra alineada" @@ -3072,6 +3021,21 @@ msgstr "paso cero" #~ msgid "services includes an object that is not a Service" #~ msgstr "services incluye un objeto que no es servicio" +#~ msgid "struct: cannot index" +#~ msgstr "struct: no se puede indexar" + +#~ msgid "struct: index out of range" +#~ msgstr "struct: index fuera de rango" + +#~ msgid "struct: no fields" +#~ msgstr "struct: sin campos" + +#~ msgid "syntax error in JSON" +#~ msgstr "error de sintaxis en JSON" + +#~ msgid "syntax error in uctypes descriptor" +#~ msgstr "error de sintaxis en el descriptor uctypes" + #~ msgid "tile index out of bounds" #~ msgstr "el indice del tile fuera de limite" diff --git a/locale/fil.po b/locale/fil.po index 2223ee7793..6f51ff315d 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-10-21 19:50-0700\n" +"POT-Creation-Date: 2019-11-17 20:11-0600\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -436,10 +436,6 @@ msgstr "Hindi magawa ang sublcass slice" msgid "Cannot transfer without MOSI and MISO pins." msgstr "Hindi maaaring ilipat kapag walang MOSI at MISO pin." -#: extmod/moductypes.c -msgid "Cannot unambiguously get sizeof scalar" -msgstr "Hindi puedeng hindi sigurado ang get sizeof scalar" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Hindi maaring isulat kapag walang MOSI pin." @@ -555,10 +551,6 @@ msgstr "Drive mode ay hindi ginagamit kapag ang direksyon ay input." msgid "EXTINT channel already in use" msgstr "Ginagamit na ang EXTINT channel" -#: extmod/modure.c -msgid "Error in regex" -msgstr "May pagkakamali sa REGEX" - #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c @@ -765,14 +757,10 @@ msgstr "" msgid "Group full" msgstr "Puno ang group" -#: extmod/vfs_posix_file.c py/objstringio.c +#: py/objstringio.c msgid "I/O operation on closed file" msgstr "I/O operasyon sa saradong file" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "Hindi supportado ang operasyong I2C" - #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1122,7 +1110,7 @@ msgstr "wala sa sakop ang address" msgid "Read-only" msgstr "Basahin-lamang" -#: extmod/vfs_fat.c py/moduerrno.c +#: py/moduerrno.c msgid "Read-only filesystem" msgstr "Basahin-lamang mode" @@ -1151,7 +1139,7 @@ msgstr "Tumatakbo sa safe mode! Awtomatikong pag re-reload ay OFF.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Tumatakbo sa safe mode! Hindi tumatakbo ang nai-save na code.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "Kailangan ng pull up resistors ang SDA o SCL" @@ -1183,10 +1171,6 @@ msgstr "Slice at value iba't ibang haba." msgid "Slices not supported" msgstr "Hindi suportado ang Slices" -#: extmod/modure.c -msgid "Splitting with sub-captures" -msgstr "Binibiyak gamit ang sub-captures" - #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "Ang laki ng stack ay dapat na hindi bababa sa 256" @@ -1428,19 +1412,6 @@ msgstr "__init__() dapat magbalink na None, hindi '%s'" msgid "__new__ arg must be a user-type" msgstr "__new__ arg ay dapat na user-type" -#: extmod/modubinascii.c extmod/moduhashlib.c -msgid "a bytes-like object is required" -msgstr "a bytes-like object ay kailangan" - -#: lib/embed/abort_.c -msgid "abort() called" -msgstr "abort() tinawag" - -#: extmod/machine_mem.c -#, c-format -msgid "address %08x is not aligned to %d bytes" -msgstr "address %08x ay hindi pantay sa %d bytes" - #: shared-bindings/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "wala sa sakop ang address" @@ -1498,10 +1469,6 @@ msgstr "binary op %q hindi implemented" msgid "bits must be 7, 8 or 9" msgstr "bits ay dapat 7, 8 o 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits ay dapat walo (8)" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample ay dapat 8 o 16" @@ -1533,10 +1500,6 @@ msgstr "aarehas na haba dapat ang buffer slices" msgid "buffer too small" msgstr "masyadong maliit ang buffer" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "ang buffers ay dapat parehas sa haba" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1773,10 +1736,6 @@ msgstr "kumplikadong dibisyon sa pamamagitan ng zero" msgid "complex values not supported" msgstr "kumplikadong values hindi sinusuportahan" -#: extmod/moduzlib.c -msgid "compression header" -msgstr "compression header" - #: py/parse.c msgid "constant must be an integer" msgstr "constant ay dapat na integer" @@ -1823,10 +1782,6 @@ msgstr "dibisyon ng zero" msgid "empty" msgstr "walang laman" -#: extmod/moduheapq.c extmod/modutimeq.c -msgid "empty heap" -msgstr "walang laman ang heap" - #: py/objstr.c msgid "empty separator" msgstr "walang laman na separator" @@ -1898,10 +1853,6 @@ msgstr "ang filesystem dapat mag bigay ng mount method" msgid "first argument to super() must be type" msgstr "unang argument ng super() ay dapat type" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "firstbit ay dapat MSB" - #: py/objint.c msgid "float too big" msgstr "masyadong malaki ang float" @@ -1971,10 +1922,6 @@ msgstr "hindi pinansin ng generator ang GeneratorExit" msgid "graphic must be 2048 bytes long" msgstr "graphic ay dapat 2048 bytes ang haba" -#: extmod/moduheapq.c -msgid "heap must be a list" -msgstr "list dapat ang heap" - #: py/compile.c msgid "identifier redefined as global" msgstr "identifier ginawang global" @@ -1991,10 +1938,6 @@ msgstr "hindi kumpleto ang format" msgid "incomplete format key" msgstr "hindi kumpleto ang format key" -#: extmod/modubinascii.c -msgid "incorrect padding" -msgstr "mali ang padding" - #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -2021,38 +1964,10 @@ msgstr "kailangan ng int" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "maling I2C peripheral" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "hindi wastong SPI peripheral" - -#: lib/netutils/netutils.c -msgid "invalid arguments" -msgstr "mali ang mga argumento" - -#: extmod/modussl_axtls.c -msgid "invalid cert" -msgstr "mali ang cert" - -#: extmod/uos_dupterm.c -msgid "invalid dupterm index" -msgstr "mali ang dupterm index" - -#: extmod/modframebuf.c -msgid "invalid format" -msgstr "hindi wastong pag-format" - #: py/objstr.c msgid "invalid format specifier" msgstr "mali ang format specifier" -#: extmod/modussl_axtls.c -msgid "invalid key" -msgstr "mali ang key" - #: py/compile.c msgid "invalid micropython decorator" msgstr "mali ang micropython decorator" @@ -2185,10 +2100,6 @@ msgstr "maraming inhertance hindi sinusuportahan" msgid "must raise an object" msgstr "dapat itaas ang isang object" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "dapat tukuyin lahat ng SCK/MOSI/MISO" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "dapat gumamit ng keyword argument para sa key function" @@ -2255,10 +2166,6 @@ msgstr "" msgid "non-default argument follows default argument" msgstr "non-default argument sumusunod sa default argument" -#: extmod/modubinascii.c -msgid "non-hex digit found" -msgstr "non-hex digit nahanap" - #: py/compile.c msgid "non-keyword arg after */**" msgstr "non-keyword arg sa huli ng */**" @@ -2325,10 +2232,6 @@ msgstr "object na type '%s' walang len()" msgid "object with buffer protocol required" msgstr "object na may buffer protocol kinakailangan" -#: extmod/modubinascii.c -msgid "odd-length string" -msgstr "odd-length string" - #: py/objstr.c py/objstrunicode.c #, fuzzy msgid "offset out of bounds" @@ -2418,10 +2321,6 @@ msgstr "pow() 3rd argument ay hindi maaring 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() na may 3 argumento kailangan ng integers" -#: extmod/modutimeq.c -msgid "queue overflow" -msgstr "puno na ang pila (overflow)" - #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "" @@ -2538,18 +2437,6 @@ msgstr "ang indeks ng string ay dapat na integer, hindi %s" msgid "string not supported; use bytes or bytearray" msgstr "string hindi supportado; gumamit ng bytes o kaya bytearray" -#: extmod/moductypes.c -msgid "struct: cannot index" -msgstr "struct: hindi ma-index" - -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct: index hindi maabot" - -#: extmod/moductypes.c -msgid "struct: no fields" -msgstr "struct: walang fields" - #: py/objstr.c msgid "substring not found" msgstr "substring hindi nahanap" @@ -2558,14 +2445,6 @@ msgstr "substring hindi nahanap" msgid "super() can't find self" msgstr "super() hindi mahanap ang sarili" -#: extmod/modujson.c -msgid "syntax error in JSON" -msgstr "sintaks error sa JSON" - -#: extmod/moductypes.c -msgid "syntax error in uctypes descriptor" -msgstr "may pagkakamali sa sintaks sa uctypes descriptor" - #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" msgstr "ang threshold ay dapat sa range 0-65536" @@ -2797,6 +2676,9 @@ msgstr "zero step" #~ msgid "Cannot set STA config" #~ msgstr "Hindi ma-set ang STA Config" +#~ msgid "Cannot unambiguously get sizeof scalar" +#~ msgstr "Hindi puedeng hindi sigurado ang get sizeof scalar" + #~ msgid "Cannot update i/f status" #~ msgstr "Hindi ma-update i/f status" @@ -2816,11 +2698,14 @@ msgstr "zero step" #~ msgid "Error in ffi_prep_cif" #~ msgstr "Pagkakamali sa ffi_prep_cif" +#~ msgid "Error in regex" +#~ msgstr "May pagkakamali sa REGEX" + #, fuzzy #~ msgid "Failed to acquire mutex" #~ msgstr "Nabigo sa pag kuha ng mutex, status: 0x%08lX" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to add characteristic, err 0x%04x" #~ msgstr "Nabigo sa paglagay ng characteristic, status: 0x%08lX" @@ -2828,7 +2713,7 @@ msgstr "zero step" #~ msgid "Failed to add service" #~ msgstr "Hindi matagumpay ang paglagay ng service, status: 0x%08lX" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to add service, err 0x%04x" #~ msgstr "Hindi matagumpay ang paglagay ng service, status: 0x%08lX" @@ -2844,7 +2729,7 @@ msgstr "zero step" #~ msgid "Failed to continue scanning" #~ msgstr "Hindi maituloy ang pag scan, status: 0x%0xlX" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to continue scanning, err 0x%04x" #~ msgstr "Hindi maituloy ang pag scan, status: 0x%0xlX" @@ -2868,7 +2753,7 @@ msgstr "zero step" #~ msgid "Failed to start advertising" #~ msgstr "Hindi masimulaan ang advertisement, status: 0x%08lX" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to start advertising, err 0x%04x" #~ msgstr "Hindi masimulaan ang advertisement, status: 0x%08lX" @@ -2880,7 +2765,7 @@ msgstr "zero step" #~ msgid "Failed to stop advertising" #~ msgstr "Hindi mahinto ang advertisement, status: 0x%08lX" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Hindi mahinto ang advertisement, status: 0x%08lX" @@ -2890,6 +2775,9 @@ msgstr "zero step" #~ msgid "GPIO16 does not support pull up." #~ msgstr "Walang pull down support ang GPI016." +#~ msgid "I2C operation not supported" +#~ msgstr "Hindi supportado ang operasyong I2C" + #~ msgid "Invalid bit clock pin" #~ msgstr "Mali ang bit clock pin" @@ -2946,6 +2834,9 @@ msgstr "zero step" #~ msgid "STA required" #~ msgstr "STA kailangan" +#~ msgid "Splitting with sub-captures" +#~ msgstr "Binibiyak gamit ang sub-captures" + #~ msgid "UART(%d) does not exist" #~ msgstr "Walang UART(%d)" @@ -2968,9 +2859,24 @@ msgstr "zero step" #~ msgid "[addrinfo error %d]" #~ msgstr "[addrinfo error %d]" +#~ msgid "a bytes-like object is required" +#~ msgstr "a bytes-like object ay kailangan" + +#~ msgid "abort() called" +#~ msgstr "abort() tinawag" + +#~ msgid "address %08x is not aligned to %d bytes" +#~ msgstr "address %08x ay hindi pantay sa %d bytes" + +#~ msgid "bits must be 8" +#~ msgstr "bits ay dapat walo (8)" + #~ msgid "buffer too long" #~ msgstr "masyadong mahaba ng buffer" +#~ msgid "buffers must be the same length" +#~ msgstr "ang buffers ay dapat parehas sa haba" + #~ msgid "can query only one param" #~ msgstr "maaaring i-query lamang ang isang param" @@ -2986,9 +2892,15 @@ msgstr "zero step" #~ msgid "can't set STA config" #~ msgstr "hindi makuha ang STA config" +#~ msgid "compression header" +#~ msgstr "compression header" + #~ msgid "either pos or kw args are allowed" #~ msgstr "pos o kw args ang pinahihintulutan" +#~ msgid "empty heap" +#~ msgstr "walang laman ang heap" + #~ msgid "expected a DigitalInOut" #~ msgstr "umasa ng DigitalInOut" @@ -2998,24 +2910,54 @@ msgstr "zero step" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" +#~ msgid "firstbit must be MSB" +#~ msgstr "firstbit ay dapat MSB" + #~ msgid "flash location must be below 1MByte" #~ msgstr "dapat na mas mababa sa 1MB ang lokasyon ng flash" #~ msgid "frequency can only be either 80Mhz or 160MHz" #~ msgstr "ang frequency ay dapat 80Mhz or 160MHz lamang" +#~ msgid "heap must be a list" +#~ msgstr "list dapat ang heap" + #~ msgid "impossible baudrate" #~ msgstr "impossibleng baudrate" +#~ msgid "incorrect padding" +#~ msgstr "mali ang padding" + +#~ msgid "invalid I2C peripheral" +#~ msgstr "maling I2C peripheral" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "hindi wastong SPI peripheral" + #~ msgid "invalid alarm" #~ msgstr "mali ang alarm" +#~ msgid "invalid arguments" +#~ msgstr "mali ang mga argumento" + #~ msgid "invalid buffer length" #~ msgstr "mali ang buffer length" +#~ msgid "invalid cert" +#~ msgstr "mali ang cert" + #~ msgid "invalid data bits" #~ msgstr "mali ang data bits" +#~ msgid "invalid dupterm index" +#~ msgstr "mali ang dupterm index" + +#~ msgid "invalid format" +#~ msgstr "hindi wastong pag-format" + +#~ msgid "invalid key" +#~ msgstr "mali ang key" + #~ msgid "invalid pin" #~ msgstr "mali ang pin" @@ -3029,25 +2971,52 @@ msgstr "zero step" #~ msgstr "" #~ "nabigo ang paglalaan ng memorya, naglalaan ng %u bytes para sa native code" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "dapat tukuyin lahat ng SCK/MOSI/MISO" + #, fuzzy #~ msgid "name must be a string" #~ msgstr "ang keywords dapat strings" +#~ msgid "non-hex digit found" +#~ msgstr "non-hex digit nahanap" + #~ msgid "not a valid ADC Channel: %d" #~ msgstr "hindi tamang ADC Channel: %d" +#~ msgid "odd-length string" +#~ msgstr "odd-length string" + #~ msgid "pin does not have IRQ capabilities" #~ msgstr "walang IRQ capabilities ang pin" #~ msgid "position must be 2-tuple" #~ msgstr "position ay dapat 2-tuple" +#~ msgid "queue overflow" +#~ msgstr "puno na ang pila (overflow)" + #~ msgid "row must be packed and word aligned" #~ msgstr "row ay dapat packed at ang word nakahanay" #~ msgid "scan failed" #~ msgstr "nabigo ang pag-scan" +#~ msgid "struct: cannot index" +#~ msgstr "struct: hindi ma-index" + +#~ msgid "struct: index out of range" +#~ msgstr "struct: index hindi maabot" + +#~ msgid "struct: no fields" +#~ msgstr "struct: walang fields" + +#~ msgid "syntax error in JSON" +#~ msgstr "sintaks error sa JSON" + +#~ msgid "syntax error in uctypes descriptor" +#~ msgstr "may pagkakamali sa sintaks sa uctypes descriptor" + #~ msgid "too many arguments" #~ msgstr "masyadong maraming argumento" diff --git a/locale/fr.po b/locale/fr.po index 9136376758..6f82b8f9d4 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-10-21 19:50-0700\n" +"POT-Creation-Date: 2019-11-17 20:11-0600\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -442,10 +442,6 @@ msgstr "On ne peut faire de sous-classes de tranches" msgid "Cannot transfer without MOSI and MISO pins." msgstr "Pas de transfert sans broches MOSI et MISO." -#: extmod/moductypes.c -msgid "Cannot unambiguously get sizeof scalar" -msgstr "Impossible d'obtenir la taille du scalaire sans ambigüité" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Impossible d'écrire sans broche MOSI." @@ -559,10 +555,6 @@ msgstr "Le mode Drive n'est pas utilisé quand la direction est 'input'." msgid "EXTINT channel already in use" msgstr "Canal EXTINT déjà utilisé" -#: extmod/modure.c -msgid "Error in regex" -msgstr "Erreur dans l'expression régulière" - #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c @@ -770,14 +762,10 @@ msgstr "" msgid "Group full" msgstr "Groupe plein" -#: extmod/vfs_posix_file.c py/objstringio.c +#: py/objstringio.c msgid "I/O operation on closed file" msgstr "opération d'E/S sur un fichier fermé" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "opération sur I2C non supportée" - #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1137,7 +1125,7 @@ msgstr "adresse hors limites" msgid "Read-only" msgstr "Lecture seule" -#: extmod/vfs_fat.c py/moduerrno.c +#: py/moduerrno.c msgid "Read-only filesystem" msgstr "Système de fichier en lecture seule" @@ -1166,7 +1154,7 @@ msgstr "Mode sans-échec! Auto-chargement désactivé.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Mode sans-échec! Le code sauvegardé n'est pas éxecuté.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA ou SCL a besoin d'une résistance de tirage ('pull up')" @@ -1199,10 +1187,6 @@ msgstr "Tranche et valeur de tailles différentes" msgid "Slices not supported" msgstr "Tranches non supportées" -#: extmod/modure.c -msgid "Splitting with sub-captures" -msgstr "Fractionnement avec des sous-captures" - #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "La pile doit être au moins de 256" @@ -1452,19 +1436,6 @@ msgstr "__init__() doit retourner None, pas '%s'" msgid "__new__ arg must be a user-type" msgstr "l'argument __new__ doit être d'un type défini par l'utilisateur" -#: extmod/modubinascii.c extmod/moduhashlib.c -msgid "a bytes-like object is required" -msgstr "un objet 'bytes-like' est requis" - -#: lib/embed/abort_.c -msgid "abort() called" -msgstr "abort() appelé" - -#: extmod/machine_mem.c -#, c-format -msgid "address %08x is not aligned to %d bytes" -msgstr "l'adresse %08x n'est pas alignée sur %d octets" - #: shared-bindings/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "adresse hors limites" @@ -1522,10 +1493,6 @@ msgstr "opération binaire '%q' non implémentée" msgid "bits must be 7, 8 or 9" msgstr "bits doivent être 7, 8 ou 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "les bits doivent être 8" - #: shared-bindings/audiomixer/Mixer.c #, fuzzy msgid "bits_per_sample must be 8 or 16" @@ -1559,10 +1526,6 @@ msgstr "les tranches de tampon doivent être de longueurs égales" msgid "buffer too small" msgstr "tampon trop petit" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "les tampons doivent être de la même longueur" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "les boutons doivent être des digitalio.DigitalInOut" @@ -1808,10 +1771,6 @@ msgstr "division complexe par zéro" msgid "complex values not supported" msgstr "valeurs complexes non supportées" -#: extmod/moduzlib.c -msgid "compression header" -msgstr "entête de compression" - #: py/parse.c msgid "constant must be an integer" msgstr "constante doit être un entier" @@ -1856,10 +1815,6 @@ msgstr "division par zéro" msgid "empty" msgstr "vide" -#: extmod/moduheapq.c extmod/modutimeq.c -msgid "empty heap" -msgstr "tas vide" - #: py/objstr.c msgid "empty separator" msgstr "séparateur vide" @@ -1931,10 +1886,6 @@ msgstr "le system de fichier doit fournir une méthode 'mount'" msgid "first argument to super() must be type" msgstr "le premier argument de super() doit être un type" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "le 1er bit doit être le MSB" - #: py/objint.c msgid "float too big" msgstr "nombre à virgule flottante trop grand" @@ -2003,10 +1954,6 @@ msgstr "le générateur a ignoré GeneratorExit" msgid "graphic must be 2048 bytes long" msgstr "graphic doit être long de 2048 octets" -#: extmod/moduheapq.c -msgid "heap must be a list" -msgstr "le tas doit être une liste" - #: py/compile.c msgid "identifier redefined as global" msgstr "identifiant redéfini comme global" @@ -2023,10 +1970,6 @@ msgstr "format incomplet" msgid "incomplete format key" msgstr "clé de format incomplète" -#: extmod/modubinascii.c -msgid "incorrect padding" -msgstr "espacement incorrect" - #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -2053,38 +1996,10 @@ msgstr "entier requis" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "périphérique I2C invalide" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "périphérique SPI invalide" - -#: lib/netutils/netutils.c -msgid "invalid arguments" -msgstr "arguments invalides" - -#: extmod/modussl_axtls.c -msgid "invalid cert" -msgstr "certificat invalide" - -#: extmod/uos_dupterm.c -msgid "invalid dupterm index" -msgstr "index invalide pour dupterm" - -#: extmod/modframebuf.c -msgid "invalid format" -msgstr "format invalide" - #: py/objstr.c msgid "invalid format specifier" msgstr "spécification de format invalide" -#: extmod/modussl_axtls.c -msgid "invalid key" -msgstr "clé invalide" - #: py/compile.c msgid "invalid micropython decorator" msgstr "décorateur micropython invalide" @@ -2217,10 +2132,6 @@ msgstr "héritages multiples non supportés" msgid "must raise an object" msgstr "doit lever un objet" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "sck, mosi et miso doivent tous être spécifiés" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "doit utiliser un argument nommé pour une fonction key" @@ -2289,10 +2200,6 @@ msgid "non-default argument follows default argument" msgstr "" "un argument sans valeur par défaut suit un argument avec valeur par défaut" -#: extmod/modubinascii.c -msgid "non-hex digit found" -msgstr "chiffre non-héxadécimale trouvé" - #: py/compile.c msgid "non-keyword arg after */**" msgstr "argument non-nommé après */**" @@ -2360,10 +2267,6 @@ msgstr "l'objet de type '%s' n'a pas de len()" msgid "object with buffer protocol required" msgstr "un objet avec un protocole de tampon est nécessaire" -#: extmod/modubinascii.c -msgid "odd-length string" -msgstr "chaîne de longueur impaire" - #: py/objstr.c py/objstrunicode.c #, fuzzy msgid "offset out of bounds" @@ -2458,10 +2361,6 @@ msgstr "le 3e argument de pow() ne peut être 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() avec 3 arguments nécessite des entiers" -#: extmod/modutimeq.c -msgid "queue overflow" -msgstr "dépassement de file" - #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "'rawbuf' n'est pas de la même taille que 'buf'" @@ -2579,18 +2478,6 @@ msgid "string not supported; use bytes or bytearray" msgstr "" "chaîne de carac. non supportée; utilisez des bytes ou un tableau de bytes" -#: extmod/moductypes.c -msgid "struct: cannot index" -msgstr "struct: indexage impossible" - -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct: index hors limites" - -#: extmod/moductypes.c -msgid "struct: no fields" -msgstr "struct: aucun champs" - #: py/objstr.c msgid "substring not found" msgstr "sous-chaîne non trouvée" @@ -2599,14 +2486,6 @@ msgstr "sous-chaîne non trouvée" msgid "super() can't find self" msgstr "super() ne peut pas trouver self" -#: extmod/modujson.c -msgid "syntax error in JSON" -msgstr "erreur de syntaxe JSON" - -#: extmod/moductypes.c -msgid "syntax error in uctypes descriptor" -msgstr "erreur de syntaxe dans le descripteur d'uctypes" - #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" msgstr "le seuil doit être dans la gamme 0-65536" @@ -2840,6 +2719,9 @@ msgstr "'step' nul" #~ msgid "Cannot set STA config" #~ msgstr "Impossible de configurer STA" +#~ msgid "Cannot unambiguously get sizeof scalar" +#~ msgstr "Impossible d'obtenir la taille du scalaire sans ambigüité" + #~ msgid "Cannot update i/f status" #~ msgstr "le status i/f ne peut être mis à jour" @@ -2864,11 +2746,14 @@ msgstr "'step' nul" #~ msgid "Error in ffi_prep_cif" #~ msgstr "Erreur dans ffi_prep_cif" +#~ msgid "Error in regex" +#~ msgstr "Erreur dans l'expression régulière" + #, fuzzy #~ msgid "Failed to acquire mutex" #~ msgstr "Echec de l'obtention de mutex" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to add characteristic, err 0x%04x" #~ msgstr "Echec de l'ajout de caractéristique, err 0x%04x" @@ -2876,7 +2761,7 @@ msgstr "'step' nul" #~ msgid "Failed to add service" #~ msgstr "Echec de l'ajout de service" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to add service, err 0x%04x" #~ msgstr "Echec de l'ajout de service, err 0x%04x" @@ -2892,7 +2777,7 @@ msgstr "'step' nul" #~ msgid "Failed to continue scanning" #~ msgstr "Impossible de poursuivre le scan" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to continue scanning, err 0x%04x" #~ msgstr "Impossible de poursuivre le scan, err 0x%04x" @@ -2916,7 +2801,7 @@ msgstr "'step' nul" #~ msgid "Failed to start advertising" #~ msgstr "Echec du démarrage de la diffusion" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to start advertising, err 0x%04x" #~ msgstr "Impossible de commencer à diffuser, err 0x%04x" @@ -2928,7 +2813,7 @@ msgstr "'step' nul" #~ msgid "Failed to stop advertising" #~ msgstr "Echec de l'arrêt de diffusion" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Echec de l'arrêt de diffusion, err 0x%04x" @@ -2938,6 +2823,9 @@ msgstr "'step' nul" #~ msgid "GPIO16 does not support pull up." #~ msgstr "Le GPIO16 ne supporte pas le tirage (pull-up)" +#~ msgid "I2C operation not supported" +#~ msgstr "opération sur I2C non supportée" + #~ msgid "Invalid bit clock pin" #~ msgstr "Broche invalide pour 'bit clock'" @@ -3003,10 +2891,12 @@ msgstr "'step' nul" #~ msgid "STA required" #~ msgstr "'STA' requis" -#, c-format #~ msgid "Soft device assert, id: 0x%08lX, pc: 0x%08lX" #~ msgstr "Assertion en mode 'soft-device', id: 0x%08lX, pc: 0x%08lX" +#~ msgid "Splitting with sub-captures" +#~ msgstr "Fractionnement avec des sous-captures" + #~ msgid "Tile indices must be 0 - 255" #~ msgstr "Les indices des tuiles doivent être compris entre 0 et 255 " @@ -3032,12 +2922,27 @@ msgstr "'step' nul" #~ msgid "Voice index too high" #~ msgstr "Index de la voix trop grand" +#~ msgid "a bytes-like object is required" +#~ msgstr "un objet 'bytes-like' est requis" + +#~ msgid "abort() called" +#~ msgstr "abort() appelé" + +#~ msgid "address %08x is not aligned to %d bytes" +#~ msgstr "l'adresse %08x n'est pas alignée sur %d octets" + #~ msgid "bad GATT role" #~ msgstr "mauvais rôle GATT" +#~ msgid "bits must be 8" +#~ msgstr "les bits doivent être 8" + #~ msgid "buffer too long" #~ msgstr "tampon trop long" +#~ msgid "buffers must be the same length" +#~ msgstr "les tampons doivent être de la même longueur" + #~ msgid "can query only one param" #~ msgstr "ne peut demander qu'un seul paramètre" @@ -3057,36 +2962,72 @@ msgstr "'step' nul" #~ msgstr "" #~ "'characteristics' inclut un objet qui n'est pas une 'Characteristic'" +#~ msgid "compression header" +#~ msgstr "entête de compression" + #~ msgid "either pos or kw args are allowed" #~ msgstr "soit 'pos', soit 'kw' est permis en argument" +#~ msgid "empty heap" +#~ msgstr "tas vide" + #~ msgid "expected a DigitalInOut" #~ msgstr "objet DigitalInOut attendu" #~ msgid "expecting a pin" #~ msgstr "une broche (Pin) est attendue" +#~ msgid "firstbit must be MSB" +#~ msgstr "le 1er bit doit être le MSB" + #~ msgid "flash location must be below 1MByte" #~ msgstr "l'emplacement en mémoire flash doit être inférieur à 1Mo" #~ msgid "frequency can only be either 80Mhz or 160MHz" #~ msgstr "la fréquence doit être soit 80MHz soit 160MHz" +#~ msgid "heap must be a list" +#~ msgstr "le tas doit être une liste" + #~ msgid "impossible baudrate" #~ msgstr "débit impossible" +#~ msgid "incorrect padding" +#~ msgstr "espacement incorrect" + #~ msgid "interval not in range 0.0020 to 10.24" #~ msgstr "intervalle hors bornes 0.0020 à 10.24" +#~ msgid "invalid I2C peripheral" +#~ msgstr "périphérique I2C invalide" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "périphérique SPI invalide" + #~ msgid "invalid alarm" #~ msgstr "alarme invalide" +#~ msgid "invalid arguments" +#~ msgstr "arguments invalides" + #~ msgid "invalid buffer length" #~ msgstr "longueur de tampon invalide" +#~ msgid "invalid cert" +#~ msgstr "certificat invalide" + #~ msgid "invalid data bits" #~ msgstr "bits de données invalides" +#~ msgid "invalid dupterm index" +#~ msgstr "index invalide pour dupterm" + +#~ msgid "invalid format" +#~ msgstr "format invalide" + +#~ msgid "invalid key" +#~ msgstr "clé invalide" + #~ msgid "invalid pin" #~ msgstr "broche invalide" @@ -3100,13 +3041,22 @@ msgstr "'step' nul" #~ msgstr "" #~ "l'allocation de mémoire a échoué en allouant %u octets pour un code natif" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "sck, mosi et miso doivent tous être spécifiés" + #, fuzzy #~ msgid "name must be a string" #~ msgstr "les noms doivent être des chaînes de caractère" +#~ msgid "non-hex digit found" +#~ msgstr "chiffre non-héxadécimale trouvé" + #~ msgid "not a valid ADC Channel: %d" #~ msgstr "canal ADC non valide : %d" +#~ msgid "odd-length string" +#~ msgstr "chaîne de longueur impaire" + #~ msgid "pin does not have IRQ capabilities" #~ msgstr "la broche ne supporte pas les interruptions (IRQ)" @@ -3114,12 +3064,30 @@ msgstr "'step' nul" #~ msgid "position must be 2-tuple" #~ msgstr "position doit être un 2-tuple" +#~ msgid "queue overflow" +#~ msgstr "dépassement de file" + #~ msgid "scan failed" #~ msgstr "échec du scan" #~ msgid "services includes an object that is not a Service" #~ msgstr "'services' inclut un object qui n'est pas un 'Service'" +#~ msgid "struct: cannot index" +#~ msgstr "struct: indexage impossible" + +#~ msgid "struct: index out of range" +#~ msgstr "struct: index hors limites" + +#~ msgid "struct: no fields" +#~ msgstr "struct: aucun champs" + +#~ msgid "syntax error in JSON" +#~ msgstr "erreur de syntaxe JSON" + +#~ msgid "syntax error in uctypes descriptor" +#~ msgstr "erreur de syntaxe dans le descripteur d'uctypes" + #~ msgid "tile index out of bounds" #~ msgstr "indice de tuile hors limites" diff --git a/locale/it_IT.po b/locale/it_IT.po index d4035fdf09..f7b7b3a528 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-10-21 19:50-0700\n" +"POT-Creation-Date: 2019-11-17 20:11-0600\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -437,10 +437,6 @@ msgstr "Impossibile subclasare slice" msgid "Cannot transfer without MOSI and MISO pins." msgstr "Impossibile trasferire senza i pin MOSI e MISO." -#: extmod/moductypes.c -msgid "Cannot unambiguously get sizeof scalar" -msgstr "Impossibile ricavare la grandezza scalare di sizeof inequivocabilmente" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Impossibile scrivere senza pin MOSI." @@ -555,10 +551,6 @@ msgstr "" msgid "EXTINT channel already in use" msgstr "Canale EXTINT già in uso" -#: extmod/modure.c -msgid "Error in regex" -msgstr "Errore nella regex" - #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c @@ -764,14 +756,10 @@ msgstr "" msgid "Group full" msgstr "Gruppo pieno" -#: extmod/vfs_posix_file.c py/objstringio.c +#: py/objstringio.c msgid "I/O operation on closed file" msgstr "operazione I/O su file chiuso" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "operazione I2C non supportata" - #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1126,7 +1114,7 @@ msgstr "indirizzo fuori limite" msgid "Read-only" msgstr "Sola lettura" -#: extmod/vfs_fat.c py/moduerrno.c +#: py/moduerrno.c msgid "Read-only filesystem" msgstr "Filesystem in sola lettura" @@ -1155,7 +1143,7 @@ msgstr "Modalità sicura in esecuzione! Auto-reload disattivato.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Modalità sicura in esecuzione! Codice salvato non in esecuzione.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA o SCL necessitano un pull-up" @@ -1189,10 +1177,6 @@ msgstr "" msgid "Slices not supported" msgstr "Slice non supportate" -#: extmod/modure.c -msgid "Splitting with sub-captures" -msgstr "Suddivisione con sotto-catture" - #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "La dimensione dello stack deve essere almeno 256" @@ -1422,19 +1406,6 @@ msgstr "__init__() deve ritornare None, non '%s'" msgid "__new__ arg must be a user-type" msgstr "" -#: extmod/modubinascii.c extmod/moduhashlib.c -msgid "a bytes-like object is required" -msgstr "un oggetto byte-like è richiesto" - -#: lib/embed/abort_.c -msgid "abort() called" -msgstr "abort() chiamato" - -#: extmod/machine_mem.c -#, c-format -msgid "address %08x is not aligned to %d bytes" -msgstr "l'indirizzo %08x non è allineato a %d bytes" - #: shared-bindings/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "indirizzo fuori limite" @@ -1492,10 +1463,6 @@ msgstr "operazione binaria %q non implementata" msgid "bits must be 7, 8 or 9" msgstr "i bit devono essere 7, 8 o 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "i bit devono essere 8" - #: shared-bindings/audiomixer/Mixer.c #, fuzzy msgid "bits_per_sample must be 8 or 16" @@ -1529,10 +1496,6 @@ msgstr "slice del buffer devono essere della stessa lunghezza" msgid "buffer too small" msgstr "buffer troppo piccolo" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "i buffer devono essere della stessa lunghezza" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1766,10 +1729,6 @@ msgstr "complex divisione per zero" msgid "complex values not supported" msgstr "valori complessi non supportai" -#: extmod/moduzlib.c -msgid "compression header" -msgstr "compressione dell'header" - #: py/parse.c msgid "constant must be an integer" msgstr "la costante deve essere un intero" @@ -1815,10 +1774,6 @@ msgstr "divisione per zero" msgid "empty" msgstr "vuoto" -#: extmod/moduheapq.c extmod/modutimeq.c -msgid "empty heap" -msgstr "heap vuoto" - #: py/objstr.c msgid "empty separator" msgstr "separatore vuoto" @@ -1890,10 +1845,6 @@ msgstr "il filesystem deve fornire un metodo di mount" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "il primo bit deve essere il più significativo (MSB)" - #: py/objint.c msgid "float too big" msgstr "float troppo grande" @@ -1963,10 +1914,6 @@ msgstr "" msgid "graphic must be 2048 bytes long" msgstr "graphic deve essere lunga 2048 byte" -#: extmod/moduheapq.c -msgid "heap must be a list" -msgstr "l'heap deve essere una lista" - #: py/compile.c msgid "identifier redefined as global" msgstr "identificatore ridefinito come globale" @@ -1983,10 +1930,6 @@ msgstr "formato incompleto" msgid "incomplete format key" msgstr "" -#: extmod/modubinascii.c -msgid "incorrect padding" -msgstr "padding incorretto" - #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -2013,38 +1956,10 @@ msgstr "intero richiesto" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "periferica I2C invalida" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "periferica SPI invalida" - -#: lib/netutils/netutils.c -msgid "invalid arguments" -msgstr "argomenti non validi" - -#: extmod/modussl_axtls.c -msgid "invalid cert" -msgstr "certificato non valido" - -#: extmod/uos_dupterm.c -msgid "invalid dupterm index" -msgstr "indice dupterm non valido" - -#: extmod/modframebuf.c -msgid "invalid format" -msgstr "formato non valido" - #: py/objstr.c msgid "invalid format specifier" msgstr "specificatore di formato non valido" -#: extmod/modussl_axtls.c -msgid "invalid key" -msgstr "chiave non valida" - #: py/compile.c msgid "invalid micropython decorator" msgstr "decoratore non valido in micropython" @@ -2178,10 +2093,6 @@ msgstr "ereditarietà multipla non supportata" msgid "must raise an object" msgstr "deve lanciare un oggetto" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "è necessario specificare tutte le sck/mosi/miso" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -2249,10 +2160,6 @@ msgstr "" msgid "non-default argument follows default argument" msgstr "argomento non predefinito segue argmoento predfinito" -#: extmod/modubinascii.c -msgid "non-hex digit found" -msgstr "trovata cifra non esadecimale" - #: py/compile.c msgid "non-keyword arg after */**" msgstr "argomento non nominato dopo */**" @@ -2321,10 +2228,6 @@ msgstr "l'oggetto di tipo '%s' non implementa len()" msgid "object with buffer protocol required" msgstr "" -#: extmod/modubinascii.c -msgid "odd-length string" -msgstr "stringa di lunghezza dispari" - #: py/objstr.c py/objstrunicode.c #, fuzzy msgid "offset out of bounds" @@ -2416,10 +2319,6 @@ msgstr "il terzo argomento di pow() non può essere 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() con 3 argomenti richiede interi" -#: extmod/modutimeq.c -msgid "queue overflow" -msgstr "overflow della coda" - #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "" @@ -2536,18 +2435,6 @@ msgstr "indici della stringa devono essere interi, non %s" msgid "string not supported; use bytes or bytearray" msgstr "" -#: extmod/moductypes.c -msgid "struct: cannot index" -msgstr "struct: impossibile indicizzare" - -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct: indice fuori intervallo" - -#: extmod/moductypes.c -msgid "struct: no fields" -msgstr "struct: nessun campo" - #: py/objstr.c msgid "substring not found" msgstr "sottostringa non trovata" @@ -2556,14 +2443,6 @@ msgstr "sottostringa non trovata" msgid "super() can't find self" msgstr "" -#: extmod/modujson.c -msgid "syntax error in JSON" -msgstr "errore di sintassi nel JSON" - -#: extmod/moductypes.c -msgid "syntax error in uctypes descriptor" -msgstr "errore di sintassi nel descrittore uctypes" - #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" msgstr "la soglia deve essere nell'intervallo 0-65536" @@ -2795,6 +2674,10 @@ msgstr "zero step" #~ msgid "Cannot set STA config" #~ msgstr "Impossibile impostare la configurazione della STA" +#~ msgid "Cannot unambiguously get sizeof scalar" +#~ msgstr "" +#~ "Impossibile ricavare la grandezza scalare di sizeof inequivocabilmente" + #~ msgid "Cannot update i/f status" #~ msgstr "Impossibile aggiornare status di i/f" @@ -2820,11 +2703,14 @@ msgstr "zero step" #~ msgid "Error in ffi_prep_cif" #~ msgstr "Errore in ffi_prep_cif" +#~ msgid "Error in regex" +#~ msgstr "Errore nella regex" + #, fuzzy #~ msgid "Failed to acquire mutex" #~ msgstr "Impossibile allocare buffer RX" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to add characteristic, err 0x%04x" #~ msgstr "Impossibile fermare advertisement. status: 0x%02x" @@ -2832,7 +2718,7 @@ msgstr "zero step" #~ msgid "Failed to add service" #~ msgstr "Impossibile fermare advertisement. status: 0x%02x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to add service, err 0x%04x" #~ msgstr "Impossibile fermare advertisement. status: 0x%02x" @@ -2848,7 +2734,7 @@ msgstr "zero step" #~ msgid "Failed to continue scanning" #~ msgstr "Impossible iniziare la scansione. status: 0x%02x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to continue scanning, err 0x%04x" #~ msgstr "Impossible iniziare la scansione. status: 0x%02x" @@ -2872,7 +2758,7 @@ msgstr "zero step" #~ msgid "Failed to start advertising" #~ msgstr "Impossibile avviare advertisement. status: 0x%02x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to start advertising, err 0x%04x" #~ msgstr "Impossibile avviare advertisement. status: 0x%02x" @@ -2884,13 +2770,16 @@ msgstr "zero step" #~ msgid "Failed to stop advertising" #~ msgstr "Impossibile fermare advertisement. status: 0x%02x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Impossibile fermare advertisement. status: 0x%02x" #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 non supporta pull-up" +#~ msgid "I2C operation not supported" +#~ msgstr "operazione I2C non supportata" + #~ msgid "Invalid bit clock pin" #~ msgstr "Pin del clock di bit non valido" @@ -2948,6 +2837,9 @@ msgstr "zero step" #~ msgid "STA required" #~ msgstr "STA richiesta" +#~ msgid "Splitting with sub-captures" +#~ msgstr "Suddivisione con sotto-catture" + #~ msgid "UART(%d) does not exist" #~ msgstr "UART(%d) non esistente" @@ -2966,9 +2858,24 @@ msgstr "zero step" #~ msgid "[addrinfo error %d]" #~ msgstr "[errore addrinfo %d]" +#~ msgid "a bytes-like object is required" +#~ msgstr "un oggetto byte-like è richiesto" + +#~ msgid "abort() called" +#~ msgstr "abort() chiamato" + +#~ msgid "address %08x is not aligned to %d bytes" +#~ msgstr "l'indirizzo %08x non è allineato a %d bytes" + +#~ msgid "bits must be 8" +#~ msgstr "i bit devono essere 8" + #~ msgid "buffer too long" #~ msgstr "buffer troppo lungo" +#~ msgid "buffers must be the same length" +#~ msgstr "i buffer devono essere della stessa lunghezza" + #~ msgid "can query only one param" #~ msgstr "è possibile interrogare solo un parametro" @@ -2984,9 +2891,15 @@ msgstr "zero step" #~ msgid "can't set STA config" #~ msgstr "impossibile impostare le configurazioni della STA" +#~ msgid "compression header" +#~ msgstr "compressione dell'header" + #~ msgid "either pos or kw args are allowed" #~ msgstr "sono permesse solo gli argomenti pos o kw" +#~ msgid "empty heap" +#~ msgstr "heap vuoto" + #~ msgid "expected a DigitalInOut" #~ msgstr "DigitalInOut atteso" @@ -2996,24 +2909,54 @@ msgstr "zero step" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" +#~ msgid "firstbit must be MSB" +#~ msgstr "il primo bit deve essere il più significativo (MSB)" + #~ msgid "flash location must be below 1MByte" #~ msgstr "Locazione della flash deve essere inferiore a 1mb" #~ msgid "frequency can only be either 80Mhz or 160MHz" #~ msgstr "la frequenza può essere o 80Mhz o 160Mhz" +#~ msgid "heap must be a list" +#~ msgstr "l'heap deve essere una lista" + #~ msgid "impossible baudrate" #~ msgstr "baudrate impossibile" +#~ msgid "incorrect padding" +#~ msgstr "padding incorretto" + +#~ msgid "invalid I2C peripheral" +#~ msgstr "periferica I2C invalida" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "periferica SPI invalida" + #~ msgid "invalid alarm" #~ msgstr "alarm non valido" +#~ msgid "invalid arguments" +#~ msgstr "argomenti non validi" + #~ msgid "invalid buffer length" #~ msgstr "lunghezza del buffer non valida" +#~ msgid "invalid cert" +#~ msgstr "certificato non valido" + #~ msgid "invalid data bits" #~ msgstr "bit dati invalidi" +#~ msgid "invalid dupterm index" +#~ msgstr "indice dupterm non valido" + +#~ msgid "invalid format" +#~ msgstr "formato non valido" + +#~ msgid "invalid key" +#~ msgstr "chiave non valida" + #~ msgid "invalid pin" #~ msgstr "pin non valido" @@ -3027,25 +2970,52 @@ msgstr "zero step" #~ msgstr "" #~ "allocazione di memoria fallita, allocazione di %d byte per codice nativo" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "è necessario specificare tutte le sck/mosi/miso" + #, fuzzy #~ msgid "name must be a string" #~ msgstr "argomenti nominati devono essere stringhe" +#~ msgid "non-hex digit found" +#~ msgstr "trovata cifra non esadecimale" + #~ msgid "not a valid ADC Channel: %d" #~ msgstr "canale ADC non valido: %d" +#~ msgid "odd-length string" +#~ msgstr "stringa di lunghezza dispari" + #~ msgid "pin does not have IRQ capabilities" #~ msgstr "il pin non implementa IRQ" #~ msgid "position must be 2-tuple" #~ msgstr "position deve essere una 2-tuple" +#~ msgid "queue overflow" +#~ msgstr "overflow della coda" + #~ msgid "row must be packed and word aligned" #~ msgstr "la riga deve essere compattata e allineata alla parola" #~ msgid "scan failed" #~ msgstr "scansione fallita" +#~ msgid "struct: cannot index" +#~ msgstr "struct: impossibile indicizzare" + +#~ msgid "struct: index out of range" +#~ msgstr "struct: indice fuori intervallo" + +#~ msgid "struct: no fields" +#~ msgstr "struct: nessun campo" + +#~ msgid "syntax error in JSON" +#~ msgstr "errore di sintassi nel JSON" + +#~ msgid "syntax error in uctypes descriptor" +#~ msgstr "errore di sintassi nel descrittore uctypes" + #~ msgid "too many arguments" #~ msgstr "troppi argomenti" diff --git a/locale/ko.po b/locale/ko.po index b3b52c2e29..2c785e2902 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-04-17 11:24-0700\n" +"POT-Creation-Date: 2019-11-17 20:11-0600\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -54,7 +54,7 @@ msgstr "%q 인덱스 범위를 벗어났습니다" msgid "%q indices must be integers, not %s" msgstr "%q 인덱스는 %s 가 아닌 정수 여야합니다" -#: shared-bindings/bleio/CharacteristicBuffer.c +#: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/displayio/Group.c shared-bindings/displayio/Shape.c msgid "%q must be >= 1" msgstr "%q 는 >=1이어야합니다" @@ -219,16 +219,15 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "" -#: shared-bindings/bleio/Address.c -#, c-format -msgid "Address is not %d bytes long or is in wrong format" -msgstr "" - -#: shared-bindings/bleio/Address.c +#: shared-bindings/_bleio/Address.c #, c-format msgid "Address must be %d bytes long" msgstr "" +#: shared-bindings/_bleio/Address.c +msgid "Address type out of range" +msgstr "" + #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "사용중인 모든 I2C주변 기기" @@ -256,11 +255,16 @@ msgstr "핀의 모든 타이머가 사용 중입니다" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c +#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseOut.c shared-bindings/pulseio/PWMOut.c #: shared-module/_pew/PewPew.c msgid "All timers in use" msgstr "모든 타이머가 사용 중입니다" +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Already advertising." +msgstr "" + #: ports/nrf/common-hal/analogio/AnalogOut.c msgid "AnalogOut functionality not supported" msgstr "" @@ -298,8 +302,12 @@ msgid "" "Auto-reload is on. Simply save files over USB to run them or enter REPL to " "disable.\n" msgstr "" -"자동 새로 고침이 켜져 있습니다. USB를 통해 파일을 저장하여 실행하십시오. 비활성화하려면 " -"REPL을 입력하십시오.\n" +"자동 새로 고침이 켜져 있습니다. USB를 통해 파일을 저장하여 실행하십시오. 비활" +"성화하려면 REPL을 입력하십시오.\n" + +#: shared-module/displayio/Display.c +msgid "Below minimum frame rate" +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" @@ -313,6 +321,10 @@ msgstr "" msgid "Both pins must support hardware interrupts" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "Brightness must be 0-1.0" +msgstr "" + #: shared-bindings/supervisor/__init__.c msgid "Brightness must be between 0 and 255" msgstr "밝기는 0에서 255 사이 여야합니다" @@ -321,11 +333,29 @@ msgstr "밝기는 0에서 255 사이 여야합니다" msgid "Brightness not adjustable" msgstr "밝기를 조절할 수 없습니다" +#: shared-bindings/_bleio/UUID.c +#, c-format +msgid "Buffer + offset too small %d %d %d" +msgstr "" + #: shared-module/usb_hid/Device.c #, c-format msgid "Buffer incorrect size. Should be %d bytes." msgstr "잘못된 크기의 버퍼. %d 바이트 여야합니다." +#: shared-bindings/displayio/Display.c +msgid "Buffer is not a bytearray." +msgstr "" + +#: shared-bindings/displayio/Display.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 "" + #: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c msgid "Buffer must be at least length 1" msgstr "잘못된 크기의 버퍼. >1 여야합니다" @@ -336,7 +366,7 @@ msgstr "잘못된 크기의 버퍼. >1 여야합니다" msgid "Bus pin %d is already in use" msgstr "" -#: shared-bindings/bleio/UUID.c +#: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." msgstr "잘못된 크기의 버퍼. 16 바이트 여야합니다." @@ -344,25 +374,17 @@ msgstr "잘못된 크기의 버퍼. 16 바이트 여야합니다." msgid "Bytes must be between 0 and 255." msgstr "바이트는 0에서 255 사이 여야합니다." +#: py/objtype.c +msgid "Call super().__init__() before accessing native object." +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c #, c-format msgid "Can not use dotstar with %s" msgstr "" -#: shared-bindings/bleio/Device.c -msgid "Can't add services in Central mode" -msgstr "센트랄(중앙) 모드에서는 서비스를 추가 할 수 없습니다" - -#: shared-bindings/bleio/Device.c -msgid "Can't advertise in Central mode" -msgstr "센트랄(중앙) 모드로 광고 (브로드 캐스트) 할 수 없습니다" - -#: shared-bindings/bleio/Device.c -msgid "Can't change the name in Central mode" -msgstr "센트랄(중앙) 모드에서는 이름을 변경할 수 없습니다" - -#: shared-bindings/bleio/Device.c -msgid "Can't connect in Peripheral mode" +#: ports/nrf/common-hal/_bleio/Characteristic.c +msgid "Can't set CCCD on local Characteristic" msgstr "" #: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c @@ -410,23 +432,11 @@ msgstr "" msgid "Cannot transfer without MOSI and MISO pins." msgstr "" -#: extmod/moductypes.c -msgid "Cannot unambiguously get sizeof scalar" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "" -#: shared-bindings/bleio/Service.c -msgid "Characteristic UUID doesn't match Service UUID" -msgstr "" - -#: ports/nrf/common-hal/bleio/Service.c -msgid "Characteristic already in use by another Service." -msgstr "" - -#: shared-bindings/bleio/CharacteristicBuffer.c +#: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" msgstr "" @@ -446,11 +456,29 @@ msgstr "" msgid "Column entry must be digitalio.DigitalInOut" msgstr "" +#: shared-bindings/displayio/I2CDisplay.c +msgid "Command must be 0-255" +msgstr "" + #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/ParallelBus.c msgid "Command must be an int between 0 and 255" msgstr "명령은 0에서 255 사이의 정수(int) 여야합니다" -#: ports/nrf/common-hal/bleio/UUID.c +#: 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/nrf/common-hal/_bleio/UUID.c #, c-format msgid "Could not decode ble_uuid, err 0x%04x" msgstr "" @@ -459,11 +487,11 @@ msgstr "" msgid "Could not initialize UART" msgstr "" -#: shared-module/audioio/Mixer.c shared-module/audioio/WaveFile.c +#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c msgid "Couldn't allocate first buffer" msgstr "" -#: shared-module/audioio/Mixer.c shared-module/audioio/WaveFile.c +#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c msgid "Couldn't allocate second buffer" msgstr "" @@ -480,24 +508,28 @@ msgstr "DAC가 현재 사용 중입니다" msgid "Data 0 pin must be byte aligned" msgstr "" -#: shared-module/audioio/WaveFile.c +#: shared-module/audiocore/WaveFile.c msgid "Data chunk must follow fmt chunk" msgstr "" -#: ports/nrf/common-hal/bleio/Broadcaster.c -#: ports/nrf/common-hal/bleio/Peripheral.c +#: ports/nrf/common-hal/_bleio/Adapter.c msgid "Data too large for advertisement packet" msgstr "광고 (브로드 캐스트) 패킷에 대한 데이터가 너무 큽니다" -#: ports/nrf/common-hal/bleio/Device.c -msgid "Data too large for the 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 "" + #: shared-bindings/displayio/Display.c +msgid "Display must have a 16 bit colorspace." +msgstr "" + +#: shared-bindings/displayio/Display.c +#: shared-bindings/displayio/EPaperDisplay.c msgid "Display rotation must be in 90 degree increments" msgstr "" @@ -506,56 +538,62 @@ msgid "Drive mode not used when direction is input." 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 msgid "EXTINT channel already in use" msgstr "" -#: extmod/modure.c -msgid "Error in regex" -msgstr "Regex에 오류가 있습니다." - #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c msgid "Expected a %q" msgstr "%q 이 예상되었습니다." -#: shared-bindings/bleio/CharacteristicBuffer.c +#: shared-bindings/_bleio/CharacteristicBuffer.c +#: shared-bindings/_bleio/Descriptor.c msgid "Expected a Characteristic" msgstr "특성(Characteristic)이 예상되었습니다." -#: shared-bindings/bleio/Characteristic.c shared-bindings/bleio/Descriptor.c -#: shared-bindings/bleio/Service.c +#: shared-bindings/_bleio/Characteristic.c +msgid "Expected a Service" +msgstr "" + +#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c +#: shared-bindings/_bleio/Service.c msgid "Expected a UUID" msgstr "UUID이 예상되었습니다." +#: shared-bindings/_bleio/Adapter.c +msgid "Expected an Address" +msgstr "" + #: shared-module/_pixelbuf/PixelBuf.c #, c-format msgid "Expected tuple of length %d, got %d" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c -msgid "Failed to acquire mutex" +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Failed initiate attribute read, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Characteristic.c ports/nrf/sd_mutex.c +#: 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/nrf/common-hal/bleio/Service.c -#, c-format -msgid "Failed to add characteristic, err 0x%04x" +#: ports/nrf/common-hal/_bleio/Service.c +msgid "Failed to add characteristic, NRF_ERROR_%q" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c -msgid "Failed to add service" -msgstr "서비스를 추가하지 못했습니다" - -#: ports/nrf/common-hal/bleio/Peripheral.c +#: ports/nrf/common-hal/_bleio/Characteristic.c #, c-format -msgid "Failed to add service, err 0x%04x" -msgstr "서비스를 추가하지 못했습니다., 오류 0x%04x" +msgid "Failed to add descriptor, err 0x%04x" +msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" @@ -567,108 +605,101 @@ msgstr "" msgid "Failed to allocate RX buffer of %d bytes" msgstr "" -#: ports/nrf/common-hal/bleio/Adapter.c -msgid "Failed to change softdevice state" +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Failed to change softdevice state, NRF_ERROR_%q" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c -msgid "Failed to connect:" -msgstr "연결할 수 없다" - -#: ports/nrf/common-hal/bleio/Device.c -msgid "Failed to continue scanning" -msgstr "스캔을 계속할 수 없습니다" - -#: ports/nrf/common-hal/bleio/Scanner.c -#, c-format -msgid "Failed to continue scanning, err 0x%04x" -msgstr "스캔을 계속할 수 없습니다, 오류 0x%04x" - -#: ports/nrf/common-hal/bleio/Device.c -msgid "Failed to create mutex" +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Failed to connect: internal error" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Failed to connect: timeout" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Service.c +msgid "Failed to create service, NRF_ERROR_%q" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Connection.c msgid "Failed to discover services" msgstr "" -#: ports/nrf/common-hal/bleio/Adapter.c +#: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to get local address" msgstr "" -#: ports/nrf/common-hal/bleio/Adapter.c +#: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to get softdevice state" msgstr "" -#: ports/nrf/common-hal/bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Characteristic.c #, c-format msgid "Failed to notify or indicate attribute value, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Connection.c +msgid "Failed to pair" +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c #, c-format msgid "Failed to read CCCD value, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Failed to read attribute value, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Failed to read gatts value, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/UUID.c +#: ports/nrf/common-hal/_bleio/UUID.c #, c-format msgid "Failed to register Vendor-Specific UUID, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c -msgid "Failed to release mutex" -msgstr "" - -#: ports/nrf/common-hal/bleio/Characteristic.c ports/nrf/sd_mutex.c +#: ports/nrf/sd_mutex.c #, c-format msgid "Failed to release mutex, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c -msgid "Failed to start advertising" +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Failed to start advertising, NRF_ERROR_%q" msgstr "" -#: ports/nrf/common-hal/bleio/Broadcaster.c -#: ports/nrf/common-hal/bleio/Peripheral.c +#: ports/nrf/common-hal/_bleio/Adapter.c #, c-format -msgid "Failed to start advertising, err 0x%04x" +msgid "Failed to start connecting, error 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c -msgid "Failed to start scanning" +#: ports/nrf/common-hal/_bleio/Connection.c +msgid "Failed to start pairing, NRF_ERROR_%q" msgstr "" -#: ports/nrf/common-hal/bleio/Scanner.c +#: ports/nrf/common-hal/_bleio/Adapter.c #, c-format msgid "Failed to start scanning, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Device.c -msgid "Failed to stop advertising" +#: ports/nrf/common-hal/_bleio/Adapter.c +msgid "Failed to stop advertising, NRF_ERROR_%q" msgstr "" -#: ports/nrf/common-hal/bleio/Broadcaster.c -#: ports/nrf/common-hal/bleio/Peripheral.c +#: ports/nrf/common-hal/_bleio/Characteristic.c #, c-format -msgid "Failed to stop advertising, err 0x%04x" +msgid "Failed to write CCCD, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Failed to write attribute value, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Failed to write gatts value, err 0x%04x" msgstr "" @@ -704,18 +735,19 @@ msgstr "" msgid "Function requires lock" msgstr "" +#: shared-bindings/displayio/Display.c +#: shared-bindings/displayio/EPaperDisplay.c +msgid "Group already used" +msgstr "" + #: shared-module/displayio/Group.c msgid "Group full" msgstr "" -#: extmod/vfs_posix_file.c py/objstringio.c +#: py/objstringio.c msgid "I/O operation on closed file" msgstr "" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "" - #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -760,7 +792,7 @@ msgstr "" msgid "Invalid capture period. Valid range: 1 - 500" msgstr "" -#: shared-bindings/audioio/Mixer.c +#: shared-bindings/audiomixer/Mixer.c msgid "Invalid channel count" msgstr "" @@ -768,11 +800,11 @@ msgstr "" msgid "Invalid direction." msgstr "" -#: shared-module/audioio/WaveFile.c +#: shared-module/audiocore/WaveFile.c msgid "Invalid file" msgstr "파일이 유효하지 않습니다" -#: shared-module/audioio/WaveFile.c +#: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "형식 청크 크기가 잘못되었습니다" @@ -810,15 +842,27 @@ msgstr "핀이 유효하지 않습니다" msgid "Invalid polarity" msgstr "" +#: shared-bindings/_bleio/Characteristic.c +msgid "Invalid properties" +msgstr "" + #: shared-bindings/microcontroller/__init__.c msgid "Invalid run mode." msgstr "" -#: shared-bindings/audioio/Mixer.c +#: shared-module/_bleio/Attribute.c +msgid "Invalid security_mode" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c +msgid "Invalid voice" +msgstr "" + +#: shared-bindings/audiomixer/Mixer.c msgid "Invalid voice count" msgstr "" -#: shared-module/audioio/WaveFile.c +#: shared-module/audiocore/WaveFile.c msgid "Invalid wave file" msgstr "" @@ -826,6 +870,10 @@ msgstr "" 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 "" @@ -870,8 +918,12 @@ msgstr "" msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" -#: shared-bindings/displayio/Display.c -msgid "Must be a Group subclass." +#: shared-bindings/displayio/Group.c +msgid "Must be a %q subclass." +msgstr "" + +#: ports/nrf/common-hal/_bleio/Characteristic.c +msgid "No CCCD for this Characteristic" msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c @@ -907,11 +959,19 @@ msgstr "" 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 "" +#: shared-module/touchio/TouchIn.c +msgid "No pulldown on pin; 1Mohm recommended" +msgstr "" + #: py/moduerrno.c msgid "No space left on device" msgstr "" @@ -920,11 +980,13 @@ msgstr "" msgid "No such file/directory" msgstr "" -#: shared-bindings/bleio/CharacteristicBuffer.c +#: 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 "" @@ -950,8 +1012,8 @@ msgstr "" #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" -"Only monochrome, indexed 8bpp, and 16bpp or greater BMPs supported: %d bpp " -"given" +"Only monochrome, indexed 4bpp or 8bpp, and 16bpp or greater BMPs supported: " +"%d bpp given" msgstr "" #: shared-bindings/_pixelbuf/PixelBuf.c @@ -989,6 +1051,14 @@ msgstr "" msgid "Plus any modules on the filesystem\n" msgstr "" +#: shared-bindings/ps2io/Ps2.c +msgid "Pop from an empty Ps2 buffer" +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." msgstr "" @@ -1013,7 +1083,7 @@ msgstr "" msgid "Read-only" msgstr "" -#: extmod/vfs_fat.c py/moduerrno.c +#: py/moduerrno.c msgid "Read-only filesystem" msgstr "" @@ -1021,6 +1091,10 @@ msgstr "" msgid "Read-only object" msgstr "" +#: shared-bindings/displayio/EPaperDisplay.c +msgid "Refresh too soon" +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" msgstr "" @@ -1037,19 +1111,24 @@ msgstr "" msgid "Running in safe mode! Not running saved code.\n" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "" -#: shared-bindings/audioio/Mixer.c +#: shared-bindings/audiomixer/Mixer.c msgid "Sample rate must be positive" msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c +#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.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/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Serializer in use" @@ -1064,15 +1143,6 @@ msgstr "" msgid "Slices not supported" msgstr "" -#: ports/nrf/common-hal/bleio/Adapter.c -#, c-format -msgid "Soft device assert, id: 0x%08lX, pc: 0x%08lX" -msgstr "" - -#: extmod/modure.c -msgid "Splitting with sub-captures" -msgstr "" - #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "" @@ -1090,6 +1160,12 @@ msgid "" "your CIRCUITPY drive:\n" 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 "" + #: supervisor/shared/safe_mode.c msgid "" "The microcontroller's power dipped. Please make sure your power supply " @@ -1104,19 +1180,19 @@ msgid "" "exit safe mode.\n" msgstr "" -#: shared-module/audioio/Mixer.c +#: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" msgstr "" -#: shared-module/audioio/Mixer.c +#: shared-module/audiomixer/MixerVoice.c msgid "The sample's channel count does not match the mixer's" msgstr "" -#: shared-module/audioio/Mixer.c +#: shared-module/audiomixer/MixerVoice.c msgid "The sample's sample rate does not match the mixer's" msgstr "" -#: shared-module/audioio/Mixer.c +#: shared-module/audiomixer/MixerVoice.c msgid "The sample's signedness does not match the mixer's" msgstr "" @@ -1124,8 +1200,12 @@ msgstr "" 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 indices must be 0 - 255" +msgid "Tile value out of bounds" msgstr "" #: shared-bindings/displayio/TileGrid.c @@ -1140,11 +1220,13 @@ msgstr "" msgid "Too many channels in sample." msgstr "" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/ParallelBus.c +#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c +#: shared-bindings/displayio/ParallelBus.c msgid "Too many display busses" msgstr "" #: shared-bindings/displayio/Display.c +#: shared-bindings/displayio/EPaperDisplay.c msgid "Too many displays" msgstr "" @@ -1164,23 +1246,29 @@ msgstr "" msgid "USB Error" msgstr "" -#: shared-bindings/bleio/UUID.c -msgid "UUID integer value not in range 0 to 0xffff" +#: shared-bindings/_bleio/UUID.c +msgid "UUID integer value must be 0-0xffff" msgstr "" -#: shared-bindings/bleio/UUID.c +#: shared-bindings/_bleio/UUID.c msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" msgstr "UUID문자열이 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'형식이 아닙니다" -#: shared-bindings/bleio/UUID.c +#: shared-bindings/_bleio/UUID.c msgid "UUID value is not str, int or byte buffer" -msgstr "UUID값이 문자열(str), 정수(int) 또는 바이트버퍼가(byte buffer) 아닙니다" +msgstr "" +"UUID값이 문자열(str), 정수(int) 또는 바이트버퍼가(byte buffer) 아닙니다" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Unable to allocate buffers for signed conversion" 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" @@ -1198,7 +1286,7 @@ msgstr "" msgid "Unable to write to nvm." msgstr "" -#: ports/nrf/common-hal/bleio/UUID.c +#: ports/nrf/common-hal/_bleio/UUID.c msgid "Unexpected nrfx uuid type" msgstr "" @@ -1211,11 +1299,11 @@ msgstr "" msgid "Unsupported baudrate" msgstr "" -#: shared-module/displayio/Display.c +#: shared-module/displayio/display_core.c msgid "Unsupported display bus type" msgstr "" -#: shared-module/audioio/WaveFile.c +#: shared-module/audiocore/WaveFile.c msgid "Unsupported format" msgstr "" @@ -1227,12 +1315,18 @@ msgstr "" msgid "Unsupported pull value." msgstr "" -#: py/emitnative.c -msgid "Viper functions don't currently support more than 4 arguments" +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +msgid "Value length != required fixed length" msgstr "" -#: shared-module/audioio/Mixer.c -msgid "Voice index too high" +#: ports/nrf/common-hal/_bleio/Characteristic.c +#: ports/nrf/common-hal/_bleio/Descriptor.c +msgid "Value length > max_length" +msgstr "" + +#: py/emitnative.c +msgid "Viper functions don't currently support more than 4 arguments" msgstr "" #: main.c @@ -1271,19 +1365,6 @@ msgstr "" msgid "__new__ arg must be a user-type" msgstr "" -#: extmod/modubinascii.c extmod/moduhashlib.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/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "" @@ -1317,10 +1398,6 @@ msgstr "" msgid "attributes not supported yet" msgstr "" -#: ports/nrf/common-hal/bleio/Characteristic.c -msgid "bad GATT role" -msgstr "" - #: py/builtinevex.c msgid "bad compile mode" msgstr "" @@ -1345,11 +1422,7 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "비트(bits)는 7, 8 또는 9 여야합니다" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "비트(bits)는 8이어야합니다" - -#: shared-bindings/audioio/Mixer.c +#: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample은 8 또는 16이어야합니다." @@ -1362,7 +1435,7 @@ msgstr "" msgid "buf is too small. need %d bytes" msgstr "" -#: shared-bindings/audioio/RawSample.c +#: shared-bindings/audiocore/RawSample.c msgid "buffer must be a bytes-like object" msgstr "" @@ -1379,10 +1452,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1573,10 +1642,6 @@ msgstr "" msgid "casting" msgstr "" -#: shared-bindings/bleio/Service.c -msgid "characteristics includes an object that is not a Characteristic" -msgstr "" - #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "" @@ -1617,10 +1682,6 @@ msgstr "" msgid "complex values not supported" msgstr "" -#: extmod/moduzlib.c -msgid "compression header" -msgstr "" - #: py/parse.c msgid "constant must be an integer" msgstr "" @@ -1663,10 +1724,6 @@ msgstr "" msgid "empty" msgstr "" -#: extmod/moduheapq.c extmod/modutimeq.c -msgid "empty heap" -msgstr "" - #: py/objstr.c msgid "empty separator" msgstr "" @@ -1724,7 +1781,8 @@ msgstr "" msgid "extra positional arguments given" msgstr "" -#: shared-bindings/audioio/WaveFile.c shared-bindings/displayio/OnDiskBitmap.c +#: shared-bindings/audiocore/WaveFile.c +#: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" msgstr "" @@ -1736,10 +1794,6 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "" - #: py/objint.c msgid "float too big" msgstr "float이 너무 큽니다" @@ -1808,10 +1862,6 @@ msgstr "" 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 "" @@ -1828,10 +1878,6 @@ msgstr "" msgid "incomplete format key" msgstr "" -#: extmod/modubinascii.c -msgid "incorrect padding" -msgstr "" - #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -1853,42 +1899,15 @@ msgstr "" msgid "integer required" msgstr "정수가 필요합니다" -#: ports/nrf/common-hal/bleio/Broadcaster.c -msgid "interval not in range 0.0020 to 10.24" +#: shared-bindings/_bleio/Adapter.c +#, c-format +msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "ICT주변 기기가 유효하지 않습니다" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "SPI주변 기기가 유효하지 않습니다" - -#: lib/netutils/netutils.c -msgid "invalid arguments" -msgstr "" - -#: extmod/modussl_axtls.c -msgid "invalid cert" -msgstr "cert가 유효하지 않습니다" - -#: extmod/uos_dupterm.c -msgid "invalid dupterm index" -msgstr "Dupterm index가 유효하지 않습니다" - -#: extmod/modframebuf.c -msgid "invalid format" -msgstr "형식가 유효하지 않습니다" - #: py/objstr.c msgid "invalid format specifier" msgstr "형식 지정자(format specifier)가 유효하지 않습니다" -#: extmod/modussl_axtls.c -msgid "invalid key" -msgstr "키가 유효하지 않습니다" - #: py/compile.c msgid "invalid micropython decorator" msgstr "" @@ -1946,6 +1965,10 @@ msgstr "" 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 "" @@ -1974,6 +1997,12 @@ msgstr "" msgid "math domain error" 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 "" + #: py/runtime.c msgid "maximum recursion depth exceeded" msgstr "" @@ -2007,10 +2036,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -2019,10 +2044,6 @@ msgstr "" msgid "name '%q' is not defined" msgstr "" -#: shared-bindings/bleio/Peripheral.c -msgid "name must be a string" -msgstr "" - #: py/runtime.c msgid "name not defined" msgstr "" @@ -2064,16 +2085,21 @@ msgstr "" 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 "" + #: py/runtime.c shared-bindings/_pixelbuf/__init__.c msgid "no such attribute" msgstr "" -#: py/compile.c -msgid "non-default argument follows default argument" +#: ports/nrf/common-hal/_bleio/Connection.c +msgid "non-UUID found in service_uuids_whitelist" msgstr "" -#: extmod/modubinascii.c -msgid "non-hex digit found" +#: py/compile.c +msgid "non-default argument follows default argument" msgstr "" #: py/compile.c @@ -2084,7 +2110,7 @@ msgstr "" msgid "non-keyword arg after keyword arg" msgstr "" -#: shared-bindings/bleio/UUID.c +#: shared-bindings/_bleio/UUID.c msgid "not a 128-bit UUID" msgstr "" @@ -2125,7 +2151,7 @@ msgstr "" msgid "object not callable" msgstr "" -#: py/sequence.c +#: py/sequence.c shared-bindings/displayio/Group.c msgid "object not in sequence" msgstr "" @@ -2142,14 +2168,18 @@ msgstr "" msgid "object with buffer protocol required" msgstr "" -#: extmod/modubinascii.c -msgid "odd-length string" -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/nvm/ByteArray.c msgid "only slices with step=1 (aka None) are supported" @@ -2225,10 +2255,6 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: extmod/modutimeq.c -msgid "queue overflow" -msgstr "" - #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "" @@ -2258,7 +2284,7 @@ msgstr "" msgid "rsplit(None,n)" msgstr "" -#: shared-bindings/audioio/RawSample.c +#: shared-bindings/audiocore/RawSample.c msgid "" "sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " "'B'" @@ -2276,10 +2302,6 @@ msgstr "" msgid "script compilation not supported" msgstr "" -#: shared-bindings/bleio/Peripheral.c -msgid "services includes an object that is not a Service" -msgstr "" - #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "" @@ -2345,18 +2367,6 @@ msgstr "" msgid "string not supported; use bytes or bytearray" msgstr "" -#: extmod/moductypes.c -msgid "struct: cannot index" -msgstr "" - -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "" - -#: extmod/moductypes.c -msgid "struct: no fields" -msgstr "" - #: py/objstr.c msgid "substring not found" msgstr "" @@ -2365,22 +2375,10 @@ msgstr "" 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/displayio/TileGrid.c -msgid "tile index out of bounds" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -2393,7 +2391,7 @@ msgstr "" msgid "timeout >100 (units are now seconds, not msecs)" msgstr "" -#: shared-bindings/bleio/CharacteristicBuffer.c +#: shared-bindings/_bleio/CharacteristicBuffer.c msgid "timeout must be >= 0.0" msgstr "" @@ -2537,10 +2535,19 @@ msgstr "" msgid "unsupported types for %q: '%s', '%s'" 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 "" +#: shared-bindings/_bleio/Adapter.c +msgid "window must be <= interval" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "write_args must be a list, tuple, or None" msgstr "" @@ -2568,3 +2575,54 @@ msgstr "" #: py/objrange.c msgid "zero step" msgstr "" + +#~ msgid "Can't add services in Central mode" +#~ msgstr "센트랄(중앙) 모드에서는 서비스를 추가 할 수 없습니다" + +#~ msgid "Can't advertise in Central mode" +#~ msgstr "센트랄(중앙) 모드로 광고 (브로드 캐스트) 할 수 없습니다" + +#~ msgid "Can't change the name in Central mode" +#~ msgstr "센트랄(중앙) 모드에서는 이름을 변경할 수 없습니다" + +#~ msgid "Data too large for the advertisement packet" +#~ msgstr "광고 (브로드 캐스트) 패킷에 대한 데이터가 너무 큽니다" + +#~ msgid "Error in regex" +#~ msgstr "Regex에 오류가 있습니다." + +#~ msgid "Failed to add service" +#~ msgstr "서비스를 추가하지 못했습니다" + +#~ msgid "Failed to add service, err 0x%04x" +#~ msgstr "서비스를 추가하지 못했습니다., 오류 0x%04x" + +#~ msgid "Failed to connect:" +#~ msgstr "연결할 수 없다" + +#~ msgid "Failed to continue scanning" +#~ msgstr "스캔을 계속할 수 없습니다" + +#~ msgid "Failed to continue scanning, err 0x%04x" +#~ msgstr "스캔을 계속할 수 없습니다, 오류 0x%04x" + +#~ msgid "bits must be 8" +#~ msgstr "비트(bits)는 8이어야합니다" + +#~ msgid "invalid I2C peripheral" +#~ msgstr "ICT주변 기기가 유효하지 않습니다" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "SPI주변 기기가 유효하지 않습니다" + +#~ msgid "invalid cert" +#~ msgstr "cert가 유효하지 않습니다" + +#~ msgid "invalid dupterm index" +#~ msgstr "Dupterm index가 유효하지 않습니다" + +#~ msgid "invalid format" +#~ msgstr "형식가 유효하지 않습니다" + +#~ msgid "invalid key" +#~ msgstr "키가 유효하지 않습니다" diff --git a/locale/pl.po b/locale/pl.po index 0edc5906e8..e1a3ccfd9c 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-10-21 19:50-0700\n" +"POT-Creation-Date: 2019-11-17 20:11-0600\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -431,10 +431,6 @@ msgstr "Nie można dziedziczyć ze slice" msgid "Cannot transfer without MOSI and MISO pins." msgstr "Nie można przesyłać bez nóżek MOSI i MISO." -#: extmod/moductypes.c -msgid "Cannot unambiguously get sizeof scalar" -msgstr "Wielkość skalara jest niejednoznaczna" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Nie można pisać bez nóżki MOSI." @@ -546,10 +542,6 @@ msgstr "Tryb sterowania nieużywany w trybie wejścia." msgid "EXTINT channel already in use" msgstr "Kanał EXTINT w użyciu" -#: extmod/modure.c -msgid "Error in regex" -msgstr "Błąd w regex" - #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c @@ -751,14 +743,10 @@ msgstr "" msgid "Group full" msgstr "Grupa pełna" -#: extmod/vfs_posix_file.c py/objstringio.c +#: py/objstringio.c msgid "I/O operation on closed file" msgstr "Operacja I/O na zamkniętym pliku" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "Operacja I2C nieobsługiwana" - #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1101,7 +1089,7 @@ msgstr "Zakres poza granicami" msgid "Read-only" msgstr "Tylko do odczytu" -#: extmod/vfs_fat.c py/moduerrno.c +#: py/moduerrno.c msgid "Read-only filesystem" msgstr "System plików tylko do odczytu" @@ -1129,7 +1117,7 @@ msgstr "Uruchomiony tryb bezpieczeństwa! Samo-przeładowanie wyłączone.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Uruchomiony tryb bezpieczeństwa! Zapisany kod nie jest uruchamiany.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA lub SCL wymagają podciągnięcia" @@ -1161,10 +1149,6 @@ msgstr "Fragment i wartość są różnych długości." msgid "Slices not supported" msgstr "Fragmenty nieobsługiwane" -#: extmod/modure.c -msgid "Splitting with sub-captures" -msgstr "Podział z podgrupami" - #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "Stos musi mieć co najmniej 256 bajtów" @@ -1400,19 +1384,6 @@ msgstr "__init__() powinien zwracać None, nie '%s'" msgid "__new__ arg must be a user-type" msgstr "Argument __new__ musi być typu użytkownika" -#: extmod/modubinascii.c extmod/moduhashlib.c -msgid "a bytes-like object is required" -msgstr "wymagany obiekt typu bytes" - -#: lib/embed/abort_.c -msgid "abort() called" -msgstr "Wywołano abort()" - -#: extmod/machine_mem.c -#, c-format -msgid "address %08x is not aligned to %d bytes" -msgstr "adres %08x nie jest wyrównany do %d bajtów" - #: shared-bindings/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "adres poza zakresem" @@ -1470,10 +1441,6 @@ msgstr "brak dwu-argumentowego operatora %q" msgid "bits must be 7, 8 or 9" msgstr "bits musi być 7, 8 lub 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits musi być 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample musi być 8 lub 16" @@ -1504,10 +1471,6 @@ msgstr "fragmenty bufora muszą mieć tę samą długość" msgid "buffer too small" msgstr "zbyt mały bufor" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "bufory muszą mieć tę samą długość" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "buttons musi być digitalio.DigitalInOut" @@ -1738,10 +1701,6 @@ msgstr "zespolone dzielenie przez zero" msgid "complex values not supported" msgstr "wartości zespolone nieobsługiwane" -#: extmod/moduzlib.c -msgid "compression header" -msgstr "nagłówek kompresji" - #: py/parse.c msgid "constant must be an integer" msgstr "stała musi być liczbą całkowitą" @@ -1785,10 +1744,6 @@ msgstr "dzielenie przez zero" msgid "empty" msgstr "puste" -#: extmod/moduheapq.c extmod/modutimeq.c -msgid "empty heap" -msgstr "pusta sterta" - #: py/objstr.c msgid "empty separator" msgstr "pusty separator" @@ -1859,10 +1814,6 @@ msgstr "system plików musi mieć metodę mount" msgid "first argument to super() must be type" msgstr "pierwszy argument super() musi być typem" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "firstbit musi być MSB" - #: py/objint.c msgid "float too big" msgstr "float zbyt wielki" @@ -1931,10 +1882,6 @@ msgstr "generator zignorował GeneratorExit" msgid "graphic must be 2048 bytes long" msgstr "graphic musi mieć 2048 bajtów długości" -#: extmod/moduheapq.c -msgid "heap must be a list" -msgstr "heap musi być listą" - #: py/compile.c msgid "identifier redefined as global" msgstr "nazwa przedefiniowana jako globalna" @@ -1951,10 +1898,6 @@ msgstr "niepełny format" msgid "incomplete format key" msgstr "niepełny klucz formatu" -#: extmod/modubinascii.c -msgid "incorrect padding" -msgstr "złe wypełnienie" - #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -1981,38 +1924,10 @@ msgstr "wymagana liczba całkowita" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "złe I2C" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "złe SPI" - -#: lib/netutils/netutils.c -msgid "invalid arguments" -msgstr "złe arguemnty" - -#: extmod/modussl_axtls.c -msgid "invalid cert" -msgstr "zły ceryfikat" - -#: extmod/uos_dupterm.c -msgid "invalid dupterm index" -msgstr "zły indeks dupterm" - -#: extmod/modframebuf.c -msgid "invalid format" -msgstr "zły format" - #: py/objstr.c msgid "invalid format specifier" msgstr "zła specyfikacja formatu" -#: extmod/modussl_axtls.c -msgid "invalid key" -msgstr "zły klucz" - #: py/compile.c msgid "invalid micropython decorator" msgstr "zły dekorator micropythona" @@ -2141,10 +2056,6 @@ msgstr "wielokrotne dziedzicznie niewspierane" msgid "must raise an object" msgstr "wyjątek musi być obiektem" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "sck/mosi/miso muszą być podane" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "funkcja key musi być podana jako argument nazwany" @@ -2211,10 +2122,6 @@ msgstr "" msgid "non-default argument follows default argument" msgstr "argument z wartością domyślną przed argumentem bez" -#: extmod/modubinascii.c -msgid "non-hex digit found" -msgstr "cyfra nieszesnastkowa" - #: py/compile.c msgid "non-keyword arg after */**" msgstr "argument nienazwany po */**" @@ -2281,10 +2188,6 @@ msgstr "obiekt typu '%s' nie ma len()" msgid "object with buffer protocol required" msgstr "wymagany obiekt z protokołem buforu" -#: extmod/modubinascii.c -msgid "odd-length string" -msgstr "łańcuch o nieparzystej długości" - #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "offset poza zakresem" @@ -2373,10 +2276,6 @@ msgstr "trzeci argument pow() nie może być 0" msgid "pow() with 3 arguments requires integers" msgstr "trzyargumentowe pow() wymaga liczb całkowitych" -#: extmod/modutimeq.c -msgid "queue overflow" -msgstr "przepełnienie kolejki" - #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "rawbuf nie jest tej samej wielkości co buf" @@ -2490,18 +2389,6 @@ msgstr "indeksy łańcucha muszą być całkowite, nie %s" msgid "string not supported; use bytes or bytearray" msgstr "łańcuchy nieobsługiwane; użyj bytes lub bytearray" -#: extmod/moductypes.c -msgid "struct: cannot index" -msgstr "struct: nie można indeksować" - -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct: indeks poza zakresem" - -#: extmod/moductypes.c -msgid "struct: no fields" -msgstr "struct: brak pól" - #: py/objstr.c msgid "substring not found" msgstr "brak pod-łańcucha" @@ -2510,14 +2397,6 @@ msgstr "brak pod-łańcucha" msgid "super() can't find self" msgstr "super() nie może znaleźć self" -#: extmod/modujson.c -msgid "syntax error in JSON" -msgstr "błąd składni w JSON" - -#: extmod/moductypes.c -msgid "syntax error in uctypes descriptor" -msgstr "błąd składni w deskryptorze uctypes" - #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" msgstr "threshold musi być w zakresie 0-65536" @@ -2734,6 +2613,9 @@ msgstr "zerowy krok" #~ msgid "Can't connect in Peripheral mode" #~ msgstr "Nie można się łączyć w trybie Peripheral" +#~ msgid "Cannot unambiguously get sizeof scalar" +#~ msgstr "Wielkość skalara jest niejednoznaczna" + #~ msgid "Characteristic UUID doesn't match Service UUID" #~ msgstr "UUID charakterystyki inny niż UUID serwisu" @@ -2743,17 +2625,19 @@ msgstr "zerowy krok" #~ msgid "Data too large for the advertisement packet" #~ msgstr "Zbyt dużo danych pakietu rozgłoszeniowego" +#~ msgid "Error in regex" +#~ msgstr "Błąd w regex" + #~ msgid "Failed to acquire mutex" #~ msgstr "Nie udało się uzyskać blokady" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to add characteristic, err 0x%04x" #~ msgstr "Nie udało się dodać charakterystyki, błąd 0x$04x" #~ msgid "Failed to add service" #~ msgstr "Nie udało się dodać serwisu" -#, c-format #~ msgid "Failed to add service, err 0x%04x" #~ msgstr "Nie udało się dodać serwisu, błąd 0x%04x" @@ -2766,7 +2650,6 @@ msgstr "zerowy krok" #~ msgid "Failed to continue scanning" #~ msgstr "Nie udała się kontynuacja skanowania" -#, c-format #~ msgid "Failed to continue scanning, err 0x%04x" #~ msgstr "Nie udała się kontynuacja skanowania, błąd 0x%04x" @@ -2779,7 +2662,6 @@ msgstr "zerowy krok" #~ msgid "Failed to start advertising" #~ msgstr "Nie udało się rozpocząć rozgłaszania" -#, c-format #~ msgid "Failed to start advertising, err 0x%04x" #~ msgstr "Nie udało się rozpocząć rozgłaszania, błąd 0x%04x" @@ -2789,10 +2671,12 @@ msgstr "zerowy krok" #~ msgid "Failed to stop advertising" #~ msgstr "Nie udało się zatrzymać rozgłaszania" -#, c-format #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Nie udało się zatrzymać rozgłaszania, błąd 0x%04x" +#~ msgid "I2C operation not supported" +#~ msgstr "Operacja I2C nieobsługiwana" + #~ msgid "Invalid bit clock pin" #~ msgstr "Zła nóżka zegara" @@ -2810,10 +2694,12 @@ msgstr "zerowy krok" #~ "bpp given" #~ msgstr "Wspierane są tylko pliki BMP czarno-białe, 8bpp i 16bpp: %d bpp " -#, c-format #~ msgid "Soft device assert, id: 0x%08lX, pc: 0x%08lX" #~ msgstr "Soft device assert, id: 0x%08lX, pc: 0x%08lX" +#~ msgid "Splitting with sub-captures" +#~ msgstr "Podział z podgrupami" + #~ msgid "Tile indices must be 0 - 255" #~ msgstr "Indeks kafelka musi być pomiędzy 0 a 255 włącznie" @@ -2823,21 +2709,99 @@ msgstr "zerowy krok" #~ msgid "Voice index too high" #~ msgstr "Zbyt wysoki indeks głosu" +#~ msgid "a bytes-like object is required" +#~ msgstr "wymagany obiekt typu bytes" + +#~ msgid "abort() called" +#~ msgstr "Wywołano abort()" + +#~ msgid "address %08x is not aligned to %d bytes" +#~ msgstr "adres %08x nie jest wyrównany do %d bajtów" + #~ msgid "bad GATT role" #~ msgstr "zła rola GATT" +#~ msgid "bits must be 8" +#~ msgstr "bits musi być 8" + +#~ msgid "buffers must be the same length" +#~ msgstr "bufory muszą mieć tę samą długość" + #~ msgid "characteristics includes an object that is not a Characteristic" #~ msgstr "" #~ "charakterystyki zawierają obiekt, który nie jest typu Characteristic" +#~ msgid "compression header" +#~ msgstr "nagłówek kompresji" + +#~ msgid "empty heap" +#~ msgstr "pusta sterta" + +#~ msgid "firstbit must be MSB" +#~ msgstr "firstbit musi być MSB" + +#~ msgid "heap must be a list" +#~ msgstr "heap musi być listą" + +#~ msgid "incorrect padding" +#~ msgstr "złe wypełnienie" + #~ msgid "interval not in range 0.0020 to 10.24" #~ msgstr "przedział poza zakresem 0.0020 do 10.24" +#~ msgid "invalid I2C peripheral" +#~ msgstr "złe I2C" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "złe SPI" + +#~ msgid "invalid arguments" +#~ msgstr "złe arguemnty" + +#~ msgid "invalid cert" +#~ msgstr "zły ceryfikat" + +#~ msgid "invalid dupterm index" +#~ msgstr "zły indeks dupterm" + +#~ msgid "invalid format" +#~ msgstr "zły format" + +#~ msgid "invalid key" +#~ msgstr "zły klucz" + +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "sck/mosi/miso muszą być podane" + #~ msgid "name must be a string" #~ msgstr "nazwa musi być łańcuchem" +#~ msgid "non-hex digit found" +#~ msgstr "cyfra nieszesnastkowa" + +#~ msgid "odd-length string" +#~ msgstr "łańcuch o nieparzystej długości" + +#~ msgid "queue overflow" +#~ msgstr "przepełnienie kolejki" + #~ msgid "services includes an object that is not a Service" #~ msgstr "obiekt typu innego niż Service w services" +#~ msgid "struct: cannot index" +#~ msgstr "struct: nie można indeksować" + +#~ msgid "struct: index out of range" +#~ msgstr "struct: indeks poza zakresem" + +#~ msgid "struct: no fields" +#~ msgstr "struct: brak pól" + +#~ msgid "syntax error in JSON" +#~ msgstr "błąd składni w JSON" + +#~ msgid "syntax error in uctypes descriptor" +#~ msgstr "błąd składni w deskryptorze uctypes" + #~ msgid "tile index out of bounds" #~ msgstr "indeks kafelka poza zakresem" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index b5cd24405a..f89cc428c5 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-10-21 19:50-0700\n" +"POT-Creation-Date: 2019-11-17 20:11-0600\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -433,10 +433,6 @@ msgstr "" msgid "Cannot transfer without MOSI and MISO pins." msgstr "Não é possível transferir sem os pinos MOSI e MISO." -#: extmod/moductypes.c -msgid "Cannot unambiguously get sizeof scalar" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Não é possível ler sem um pino MOSI" @@ -550,10 +546,6 @@ msgstr "" msgid "EXTINT channel already in use" msgstr "Canal EXTINT em uso" -#: extmod/modure.c -msgid "Error in regex" -msgstr "Erro no regex" - #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c @@ -759,14 +751,10 @@ msgstr "" msgid "Group full" msgstr "Grupo cheio" -#: extmod/vfs_posix_file.c py/objstringio.c +#: py/objstringio.c msgid "I/O operation on closed file" msgstr "Operação I/O no arquivo fechado" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "I2C operação não suportada" - #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1109,7 +1097,7 @@ msgstr "" msgid "Read-only" msgstr "Somente leitura" -#: extmod/vfs_fat.c py/moduerrno.c +#: py/moduerrno.c msgid "Read-only filesystem" msgstr "Sistema de arquivos somente leitura" @@ -1138,7 +1126,7 @@ msgstr "Rodando em modo seguro! Atualização automática está desligada.\n" msgid "Running in safe mode! Not running saved code.\n" msgstr "Rodando em modo seguro! Não está executando o código salvo.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA ou SCL precisa de um pull up" @@ -1170,10 +1158,6 @@ msgstr "" msgid "Slices not supported" msgstr "" -#: extmod/modure.c -msgid "Splitting with sub-captures" -msgstr "" - #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "O tamanho da pilha deve ser pelo menos 256" @@ -1396,19 +1380,6 @@ msgstr "" msgid "__new__ arg must be a user-type" msgstr "" -#: extmod/modubinascii.c extmod/moduhashlib.c -msgid "a bytes-like object is required" -msgstr "" - -#: lib/embed/abort_.c -msgid "abort() called" -msgstr "abort() chamado" - -#: extmod/machine_mem.c -#, c-format -msgid "address %08x is not aligned to %d bytes" -msgstr "endereço %08x não está alinhado com %d bytes" - #: shared-bindings/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "" @@ -1466,10 +1437,6 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bits devem ser 8" - #: shared-bindings/audiomixer/Mixer.c #, fuzzy msgid "bits_per_sample must be 8 or 16" @@ -1503,10 +1470,6 @@ msgstr "" msgid "buffer too small" msgstr "" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "buffers devem ser o mesmo tamanho" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1737,10 +1700,6 @@ msgstr "" msgid "complex values not supported" msgstr "" -#: extmod/moduzlib.c -msgid "compression header" -msgstr "" - #: py/parse.c msgid "constant must be an integer" msgstr "constante deve ser um inteiro" @@ -1783,10 +1742,6 @@ msgstr "divisão por zero" msgid "empty" msgstr "vazio" -#: extmod/moduheapq.c extmod/modutimeq.c -msgid "empty heap" -msgstr "heap vazia" - #: py/objstr.c msgid "empty separator" msgstr "" @@ -1858,10 +1813,6 @@ msgstr "sistema de arquivos deve fornecer método de montagem" msgid "first argument to super() must be type" msgstr "" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "firstbit devem ser MSB" - #: py/objint.c msgid "float too big" msgstr "float muito grande" @@ -1930,10 +1881,6 @@ msgstr "" msgid "graphic must be 2048 bytes long" msgstr "" -#: extmod/moduheapq.c -msgid "heap must be a list" -msgstr "heap deve ser uma lista" - #: py/compile.c msgid "identifier redefined as global" msgstr "" @@ -1950,10 +1897,6 @@ msgstr "formato incompleto" msgid "incomplete format key" msgstr "" -#: extmod/modubinascii.c -msgid "incorrect padding" -msgstr "preenchimento incorreto" - #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -1980,38 +1923,10 @@ msgstr "inteiro requerido" msgid "interval must be in range %s-%s" msgstr "" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "periférico I2C inválido" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "periférico SPI inválido" - -#: lib/netutils/netutils.c -msgid "invalid arguments" -msgstr "argumentos inválidos" - -#: extmod/modussl_axtls.c -msgid "invalid cert" -msgstr "certificado inválido" - -#: extmod/uos_dupterm.c -msgid "invalid dupterm index" -msgstr "Índice de dupterm inválido" - -#: extmod/modframebuf.c -msgid "invalid format" -msgstr "formato inválido" - #: py/objstr.c msgid "invalid format specifier" msgstr "" -#: extmod/modussl_axtls.c -msgid "invalid key" -msgstr "chave inválida" - #: py/compile.c msgid "invalid micropython decorator" msgstr "" @@ -2140,10 +2055,6 @@ msgstr "" msgid "must raise an object" msgstr "" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "deve especificar todos sck/mosi/miso" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -2210,10 +2121,6 @@ msgstr "" 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 "" @@ -2280,10 +2187,6 @@ msgstr "" msgid "object with buffer protocol required" msgstr "" -#: extmod/modubinascii.c -msgid "odd-length string" -msgstr "" - #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "" @@ -2371,10 +2274,6 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: extmod/modutimeq.c -msgid "queue overflow" -msgstr "estouro de fila" - #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "" @@ -2489,18 +2388,6 @@ msgstr "" msgid "string not supported; use bytes or bytearray" msgstr "" -#: extmod/moductypes.c -msgid "struct: cannot index" -msgstr "struct: não pode indexar" - -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "struct: índice fora do intervalo" - -#: extmod/moductypes.c -msgid "struct: no fields" -msgstr "struct: sem campos" - #: py/objstr.c msgid "substring not found" msgstr "" @@ -2509,14 +2396,6 @@ msgstr "" msgid "super() can't find self" msgstr "" -#: extmod/modujson.c -msgid "syntax error in JSON" -msgstr "erro de sintaxe no JSON" - -#: 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 "Limite deve estar no alcance de 0-65536" @@ -2750,11 +2629,14 @@ msgstr "passo zero" #~ msgid "Error in ffi_prep_cif" #~ msgstr "Erro no ffi_prep_cif" +#~ msgid "Error in regex" +#~ msgstr "Erro no regex" + #, fuzzy #~ msgid "Failed to acquire mutex" #~ msgstr "Falha ao alocar buffer RX" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to add characteristic, err 0x%04x" #~ msgstr "Não pode parar propaganda. status: 0x%02x" @@ -2762,7 +2644,7 @@ msgstr "passo zero" #~ msgid "Failed to add service" #~ msgstr "Não pode parar propaganda. status: 0x%02x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to add service, err 0x%04x" #~ msgstr "Não pode parar propaganda. status: 0x%02x" @@ -2770,7 +2652,7 @@ msgstr "passo zero" #~ msgid "Failed to change softdevice state" #~ msgstr "Não pode parar propaganda. status: 0x%02x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to continue scanning, err 0x%04x" #~ msgstr "Não é possível iniciar o anúncio. status: 0x%02x" @@ -2794,7 +2676,7 @@ msgstr "passo zero" #~ msgid "Failed to start advertising" #~ msgstr "Não é possível iniciar o anúncio. status: 0x%02x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to start advertising, err 0x%04x" #~ msgstr "Não é possível iniciar o anúncio. status: 0x%02x" @@ -2806,13 +2688,16 @@ msgstr "passo zero" #~ msgid "Failed to stop advertising" #~ msgstr "Não pode parar propaganda. status: 0x%02x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Não pode parar propaganda. status: 0x%02x" #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 não suporta pull up." +#~ msgid "I2C operation not supported" +#~ msgstr "I2C operação não suportada" + #~ msgid "Invalid bit clock pin" #~ msgstr "Pino de bit clock inválido" @@ -2883,9 +2768,21 @@ msgstr "passo zero" #~ msgid "Use esptool to erase flash and re-upload Python instead" #~ msgstr "Use o esptool para apagar o flash e recarregar o Python" +#~ msgid "abort() called" +#~ msgstr "abort() chamado" + +#~ msgid "address %08x is not aligned to %d bytes" +#~ msgstr "endereço %08x não está alinhado com %d bytes" + +#~ msgid "bits must be 8" +#~ msgstr "bits devem ser 8" + #~ msgid "buffer too long" #~ msgstr "buffer muito longo" +#~ msgid "buffers must be the same length" +#~ msgstr "buffers devem ser o mesmo tamanho" + #~ msgid "can query only one param" #~ msgstr "pode consultar apenas um parâmetro" @@ -2904,30 +2801,63 @@ msgstr "passo zero" #~ msgid "either pos or kw args are allowed" #~ msgstr "pos ou kw args são permitidos" +#~ msgid "empty heap" +#~ msgstr "heap vazia" + #~ msgid "expecting a pin" #~ msgstr "esperando um pino" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" +#~ msgid "firstbit must be MSB" +#~ msgstr "firstbit devem ser MSB" + #~ msgid "flash location must be below 1MByte" #~ msgstr "o local do flash deve estar abaixo de 1 MByte" #~ msgid "frequency can only be either 80Mhz or 160MHz" #~ msgstr "A frequência só pode ser 80Mhz ou 160MHz" +#~ msgid "heap must be a list" +#~ msgstr "heap deve ser uma lista" + #~ msgid "impossible baudrate" #~ msgstr "taxa de transmissão impossível" +#~ msgid "incorrect padding" +#~ msgstr "preenchimento incorreto" + +#~ msgid "invalid I2C peripheral" +#~ msgstr "periférico I2C inválido" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "periférico SPI inválido" + #~ msgid "invalid alarm" #~ msgstr "Alarme inválido" +#~ msgid "invalid arguments" +#~ msgstr "argumentos inválidos" + #~ msgid "invalid buffer length" #~ msgstr "comprimento de buffer inválido" +#~ msgid "invalid cert" +#~ msgstr "certificado inválido" + #~ msgid "invalid data bits" #~ msgstr "Bits de dados inválidos" +#~ msgid "invalid dupterm index" +#~ msgstr "Índice de dupterm inválido" + +#~ msgid "invalid format" +#~ msgstr "formato inválido" + +#~ msgid "invalid key" +#~ msgstr "chave inválida" + #~ msgid "invalid pin" #~ msgstr "Pino inválido" @@ -2940,6 +2870,9 @@ msgstr "passo zero" #~ msgid "memory allocation failed, allocating %u bytes for native code" #~ msgstr "alocação de memória falhou, alocando %u bytes para código nativo" +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "deve especificar todos sck/mosi/miso" + #, fuzzy #~ msgid "name must be a string" #~ msgstr "heap deve ser uma lista" @@ -2950,12 +2883,27 @@ msgstr "passo zero" #~ msgid "pin does not have IRQ capabilities" #~ msgstr "Pino não tem recursos de IRQ" +#~ msgid "queue overflow" +#~ msgstr "estouro de fila" + #~ msgid "row must be packed and word aligned" #~ msgstr "Linha deve ser comprimida e com as palavras alinhadas" #~ msgid "scan failed" #~ msgstr "varredura falhou" +#~ msgid "struct: cannot index" +#~ msgstr "struct: não pode indexar" + +#~ msgid "struct: index out of range" +#~ msgstr "struct: índice fora do intervalo" + +#~ msgid "struct: no fields" +#~ msgstr "struct: sem campos" + +#~ msgid "syntax error in JSON" +#~ msgstr "erro de sintaxe no JSON" + #~ msgid "too many arguments" #~ msgstr "muitos argumentos" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index dfd7e8b0db..0111774c14 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-10-21 19:50-0700\n" +"POT-Creation-Date: 2019-11-17 20:11-0600\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -432,10 +432,6 @@ msgstr "Wúfǎ zi fēnlèi" msgid "Cannot transfer without MOSI and MISO pins." msgstr "Méiyǒu MOSI/MISO jiù wúfǎ zhuǎnyí." -#: extmod/moductypes.c -msgid "Cannot unambiguously get sizeof scalar" -msgstr "Wúfǎ míngquè de huòdé biāoliàng de dàxiǎo" - #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Wúfǎ xiě rù MOSI de yǐn jiǎo." @@ -547,10 +543,6 @@ msgstr "Fāngxiàng shūrù shí qūdòng móshì méiyǒu shǐyòng." msgid "EXTINT channel already in use" msgstr "EXTINT píndào yǐjīng shǐyòng" -#: extmod/modure.c -msgid "Error in regex" -msgstr "Zhèngzé biǎodá shì cuòwù" - #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c @@ -752,14 +744,10 @@ msgstr "Jítuán yǐjīng shǐyòngguò" msgid "Group full" msgstr "Fēnzǔ yǐ mǎn" -#: extmod/vfs_posix_file.c py/objstringio.c +#: py/objstringio.c msgid "I/O operation on closed file" msgstr "Wénjiàn shàng de I/ O cāozuò" -#: extmod/machine_i2c.c -msgid "I2C operation not supported" -msgstr "I2C cāozuò bù zhīchí" - #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1105,7 +1093,7 @@ msgstr "Fànwéi chāochū biānjiè" msgid "Read-only" msgstr "Zhǐ dú" -#: extmod/vfs_fat.c py/moduerrno.c +#: py/moduerrno.c msgid "Read-only filesystem" msgstr "Zhǐ dú wénjiàn xìtǒng" @@ -1133,7 +1121,7 @@ msgstr "Zài ānquán móshì xià yùnxíng! Zìdòng chóngxīn jiāzài yǐ g msgid "Running in safe mode! Not running saved code.\n" msgstr "Zài ānquán móshì xià yùnxíng! Bù yùnxíng yǐ bǎocún de dàimǎ.\n" -#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "SDA or SCL needs a pull up" msgstr "SDA huò SCL xūyào lādòng" @@ -1165,10 +1153,6 @@ msgstr "Qiēpiàn hé zhí bùtóng chángdù." msgid "Slices not supported" msgstr "Qiēpiàn bù shòu zhīchí" -#: extmod/modure.c -msgid "Splitting with sub-captures" -msgstr "Yǔ zi bǔhuò fēnliè" - #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "Duīzhàn dàxiǎo bìxū zhìshǎo 256" @@ -1409,19 +1393,6 @@ msgstr "__Init__() yīnggāi fǎnhuí not, ér bùshì '%s'" msgid "__new__ arg must be a user-type" msgstr "__new__ cānshù bìxū shì yònghù lèixíng" -#: extmod/modubinascii.c extmod/moduhashlib.c -msgid "a bytes-like object is required" -msgstr "xūyào yīgè zì jié lèi duìxiàng" - -#: lib/embed/abort_.c -msgid "abort() called" -msgstr "zhōngzhǐ () diàoyòng" - -#: extmod/machine_mem.c -#, c-format -msgid "address %08x is not aligned to %d bytes" -msgstr "wèi zhǐ %08x wèi yǔ %d wèi yuán zǔ duìqí" - #: shared-bindings/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "dìzhǐ chāochū biānjiè" @@ -1479,10 +1450,6 @@ msgstr "èrjìnzhì bǎn qián bǎn %q wèi zhíxíng" msgid "bits must be 7, 8 or 9" msgstr "bǐtè bìxū shì 7,8 huò 9" -#: extmod/machine_spi.c -msgid "bits must be 8" -msgstr "bǐtè bìxū shì 8" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "měi jiàn yàngběn bìxū wèi 8 huò 16" @@ -1513,10 +1480,6 @@ msgstr "huǎnchōng qū qiēpiàn bìxū chángdù xiāngděng" msgid "buffer too small" msgstr "huǎnchōng qū tài xiǎo" -#: extmod/machine_spi.c -msgid "buffers must be the same length" -msgstr "huǎnchōng qū bìxū shì chángdù xiāngtóng" - #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "ànniǔ bìxū shì digitalio.DigitalInOut" @@ -1749,10 +1712,6 @@ msgstr "fùzá de fēngé wèi 0" msgid "complex values not supported" msgstr "bù zhīchí fùzá de zhí" -#: extmod/moduzlib.c -msgid "compression header" -msgstr "yāsuō tóu bù" - #: py/parse.c msgid "constant must be an integer" msgstr "chángshù bìxū shì yīgè zhěngshù" @@ -1796,10 +1755,6 @@ msgstr "bèi líng chú" msgid "empty" msgstr "kòngxián" -#: extmod/moduheapq.c extmod/modutimeq.c -msgid "empty heap" -msgstr "kōng yīn yīnxiào" - #: py/objstr.c msgid "empty separator" msgstr "kōng fēngé fú" @@ -1870,10 +1825,6 @@ msgstr "wénjiàn xìtǒng bìxū tígōng guà zài fāngfǎ" msgid "first argument to super() must be type" msgstr "chāojí () de dì yī gè cānshù bìxū shì lèixíng" -#: extmod/machine_spi.c -msgid "firstbit must be MSB" -msgstr "dì yī wèi bìxū shì MSB" - #: py/objint.c msgid "float too big" msgstr "fú diǎn tài dà" @@ -1942,10 +1893,6 @@ msgstr "shēngchéng qì hūlüè shēngchéng qì tuìchū" msgid "graphic must be 2048 bytes long" msgstr "túxíng bìxū wèi 2048 zì jié" -#: extmod/moduheapq.c -msgid "heap must be a list" -msgstr "duī bìxū shì yīgè lièbiǎo" - #: py/compile.c msgid "identifier redefined as global" msgstr "biāozhì fú chóngxīn dìngyì wèi quánjú" @@ -1962,10 +1909,6 @@ msgstr "géshì bù wánzhěng" msgid "incomplete format key" msgstr "géshì bù wánzhěng de mì yào" -#: extmod/modubinascii.c -msgid "incorrect padding" -msgstr "bù zhèngquè de tiánchōng" - #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -1992,38 +1935,10 @@ msgstr "xūyào zhěngshù" msgid "interval must be in range %s-%s" msgstr "Jiàngé bìxū zài %s-%s fànwéi nèi" -#: extmod/machine_i2c.c -msgid "invalid I2C peripheral" -msgstr "wúxiào de I2C wàiwéi qì" - -#: extmod/machine_spi.c -msgid "invalid SPI peripheral" -msgstr "wúxiào de SPI wàiwéi qì" - -#: lib/netutils/netutils.c -msgid "invalid arguments" -msgstr "wúxiào de cānshù" - -#: extmod/modussl_axtls.c -msgid "invalid cert" -msgstr "zhèngshū wúxiào" - -#: extmod/uos_dupterm.c -msgid "invalid dupterm index" -msgstr "dupterm suǒyǐn wúxiào" - -#: extmod/modframebuf.c -msgid "invalid format" -msgstr "wúxiào géshì" - #: py/objstr.c msgid "invalid format specifier" msgstr "wúxiào de géshì biāozhù" -#: extmod/modussl_axtls.c -msgid "invalid key" -msgstr "wúxiào de mì yào" - #: py/compile.c msgid "invalid micropython decorator" msgstr "wúxiào de MicroPython zhuāngshì qì" @@ -2153,10 +2068,6 @@ msgstr "bù zhīchí duō gè jìchéng" msgid "must raise an object" msgstr "bìxū tíchū duìxiàng" -#: extmod/machine_spi.c -msgid "must specify all of sck/mosi/miso" -msgstr "bìxū zhǐdìng suǒyǒu sck/mosi/misco" - #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "bìxū shǐyòng guānjiàn cí cānshù" @@ -2224,10 +2135,6 @@ msgstr "Zài service_uuids bái míngdān zhōng zhǎodào fēi UUID" msgid "non-default argument follows default argument" msgstr "bùshì mòrèn cānshù zūnxún mòrèn cānshù" -#: extmod/modubinascii.c -msgid "non-hex digit found" -msgstr "zhǎodào fēi shíliù jìn zhì shùzì" - #: py/compile.c msgid "non-keyword arg after */**" msgstr "zài */** zhīhòu fēi guānjiàn cí cānshù" @@ -2294,10 +2201,6 @@ msgstr "lèixíng '%s' de duìxiàng méiyǒu chángdù" msgid "object with buffer protocol required" msgstr "xūyào huǎnchōng qū xiéyì de duìxiàng" -#: extmod/modubinascii.c -msgid "odd-length string" -msgstr "jīshù zìfú chuàn" - #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "piānlí biānjiè" @@ -2385,10 +2288,6 @@ msgstr "pow() 3 cān shǔ bùnéng wéi 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() yǒu 3 cānshù xūyào zhěngshù" -#: extmod/modutimeq.c -msgid "queue overflow" -msgstr "duìliè yìchū" - #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "yuánshǐ huǎnchōng qū hé huǎnchōng qū de dàxiǎo bùtóng" @@ -2503,18 +2402,6 @@ msgstr "zìfú chuàn zhǐshù bìxū shì zhěngshù, ér bùshì %s" msgid "string not supported; use bytes or bytearray" msgstr "zìfú chuàn bù zhīchí; shǐyòng zì jié huò zì jié zǔ" -#: extmod/moductypes.c -msgid "struct: cannot index" -msgstr "jiégòu: bùnéng suǒyǐn" - -#: extmod/moductypes.c -msgid "struct: index out of range" -msgstr "jiégòu: suǒyǐn chāochū fànwéi" - -#: extmod/moductypes.c -msgid "struct: no fields" -msgstr "jiégòu: méiyǒu zìduàn" - #: py/objstr.c msgid "substring not found" msgstr "wèi zhǎodào zi zìfú chuàn" @@ -2523,14 +2410,6 @@ msgstr "wèi zhǎodào zi zìfú chuàn" msgid "super() can't find self" msgstr "chāojí() zhǎo bù dào zìjǐ" -#: extmod/modujson.c -msgid "syntax error in JSON" -msgstr "JSON yǔfǎ cuòwù" - -#: extmod/moductypes.c -msgid "syntax error in uctypes descriptor" -msgstr "uctypes miáoshù fú zhōng de yǔfǎ cuòwù" - #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" msgstr "yùzhí bìxū zài fànwéi 0-65536" @@ -2750,6 +2629,9 @@ msgstr "líng bù" #~ msgid "Can't set CCCD for local Characteristic" #~ msgstr "Wúfǎ wéi běndì tèzhēng shèzhì CCCD" +#~ msgid "Cannot unambiguously get sizeof scalar" +#~ msgstr "Wúfǎ míngquè de huòdé biāoliàng de dàxiǎo" + #~ msgid "Characteristic UUID doesn't match Service UUID" #~ msgstr "Zìfú UUID bù fúhé fúwù UUID" @@ -2759,27 +2641,27 @@ msgstr "líng bù" #~ msgid "Data too large for the advertisement packet" #~ msgstr "Guǎnggào bāo de shùjù tài dà" +#~ msgid "Error in regex" +#~ msgstr "Zhèngzé biǎodá shì cuòwù" + #~ msgid "Expected a Peripheral" #~ msgstr "Qídài yīgè wàiwéi shèbèi" #~ msgid "Failed to acquire mutex" #~ msgstr "Wúfǎ huòdé mutex" -#, c-format #~ msgid "Failed to add characteristic, err 0x%04x" #~ msgstr "Tiānjiā tèxìng shībài, err 0x%04x" #~ msgid "Failed to add service" #~ msgstr "Tiānjiā fúwù shībài" -#, c-format #~ msgid "Failed to add service, err 0x%04x" #~ msgstr "Tiānjiā fúwù shībài, err 0x%04x" #~ msgid "Failed to change softdevice state" #~ msgstr "Gēnggǎi ruǎn shèbèi zhuàngtài shībài" -#, c-format #~ msgid "Failed to configure advertising, err 0x%04x" #~ msgstr "Wúfǎ pèizhì guǎnggào, cuòwù 0x%04x" @@ -2789,7 +2671,6 @@ msgstr "líng bù" #~ msgid "Failed to continue scanning" #~ msgstr "Jìxù sǎomiáo shībài" -#, c-format #~ msgid "Failed to continue scanning, err 0x%04x" #~ msgstr "Jìxù sǎomiáo shībài, err 0x%04x" @@ -2799,18 +2680,15 @@ msgstr "líng bù" #~ msgid "Failed to release mutex" #~ msgstr "Wúfǎ shìfàng mutex" -#, c-format #~ msgid "Failed to set device name, err 0x%04x" #~ msgstr "Wúfǎ shèzhì shèbèi míngchēng, cuòwù 0x%04x" #~ msgid "Failed to start advertising" #~ msgstr "Qǐdòng guǎnggào shībài" -#, c-format #~ msgid "Failed to start advertising, err 0x%04x" #~ msgstr "Qǐdòng guǎnggào shībài, err 0x%04x" -#, c-format #~ msgid "Failed to start pairing, error 0x%04x" #~ msgstr "Wúfǎ kāishǐ pèiduì, cuòwù 0x%04x" @@ -2820,10 +2698,12 @@ msgstr "líng bù" #~ msgid "Failed to stop advertising" #~ msgstr "Wúfǎ tíngzhǐ guǎnggào" -#, c-format #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Wúfǎ tíngzhǐ guǎnggào, err 0x%04x" +#~ msgid "I2C operation not supported" +#~ msgstr "I2C cāozuò bù zhīchí" + #~ msgid "Invalid bit clock pin" #~ msgstr "Wúxiào de wèi shízhōng yǐn jiǎo" @@ -2854,10 +2734,12 @@ msgstr "líng bù" #~ msgstr "" #~ "Jǐn zhīchí dān sè, suǒyǐn 8bpp hé 16bpp huò gèng dà de BMP: %d bpp tígōng" -#, c-format #~ msgid "Soft device assert, id: 0x%08lX, pc: 0x%08lX" #~ msgstr "Ruǎn shèbèi wéihù, id: 0X%08lX, pc: 0X%08lX" +#~ msgid "Splitting with sub-captures" +#~ msgstr "Yǔ zi bǔhuò fēnliè" + #~ msgid "Tile indices must be 0 - 255" #~ msgstr "Píng pū zhǐshù bìxū wèi 0 - 255" @@ -2867,27 +2749,105 @@ msgstr "líng bù" #~ msgid "Voice index too high" #~ msgstr "Yǔyīn suǒyǐn tài gāo" +#~ msgid "a bytes-like object is required" +#~ msgstr "xūyào yīgè zì jié lèi duìxiàng" + +#~ msgid "abort() called" +#~ msgstr "zhōngzhǐ () diàoyòng" + +#~ msgid "address %08x is not aligned to %d bytes" +#~ msgstr "wèi zhǐ %08x wèi yǔ %d wèi yuán zǔ duìqí" + #~ msgid "bad GATT role" #~ msgstr "zǒng xiédìng de bùliáng juésè" +#~ msgid "bits must be 8" +#~ msgstr "bǐtè bìxū shì 8" + +#~ msgid "buffers must be the same length" +#~ msgstr "huǎnchōng qū bìxū shì chángdù xiāngtóng" + #~ msgid "characteristics includes an object that is not a Characteristic" #~ msgstr "tèxìng bāokuò bùshì zìfú de wùtǐ" +#~ msgid "compression header" +#~ msgstr "yāsuō tóu bù" + +#~ msgid "empty heap" +#~ msgstr "kōng yīn yīnxiào" + #~ msgid "expected a DigitalInOut" #~ msgstr "qídài de DigitalInOut" +#~ msgid "firstbit must be MSB" +#~ msgstr "dì yī wèi bìxū shì MSB" + +#~ msgid "heap must be a list" +#~ msgstr "duī bìxū shì yīgè lièbiǎo" + +#~ msgid "incorrect padding" +#~ msgstr "bù zhèngquè de tiánchōng" + #~ msgid "interval not in range 0.0020 to 10.24" #~ msgstr "jùlí 0.0020 Zhì 10.24 Zhī jiān de jiàngé shíjiān" +#~ msgid "invalid I2C peripheral" +#~ msgstr "wúxiào de I2C wàiwéi qì" + +#~ msgid "invalid SPI peripheral" +#~ msgstr "wúxiào de SPI wàiwéi qì" + +#~ msgid "invalid arguments" +#~ msgstr "wúxiào de cānshù" + +#~ msgid "invalid cert" +#~ msgstr "zhèngshū wúxiào" + +#~ msgid "invalid dupterm index" +#~ msgstr "dupterm suǒyǐn wúxiào" + +#~ msgid "invalid format" +#~ msgstr "wúxiào géshì" + +#~ msgid "invalid key" +#~ msgstr "wúxiào de mì yào" + +#~ msgid "must specify all of sck/mosi/miso" +#~ msgstr "bìxū zhǐdìng suǒyǒu sck/mosi/misco" + #~ msgid "name must be a string" #~ msgstr "míngchēng bìxū shì yīgè zìfú chuàn" +#~ msgid "non-hex digit found" +#~ msgstr "zhǎodào fēi shíliù jìn zhì shùzì" + +#~ msgid "odd-length string" +#~ msgstr "jīshù zìfú chuàn" + +#~ msgid "queue overflow" +#~ msgstr "duìliè yìchū" + #~ msgid "row must be packed and word aligned" #~ msgstr "xíng bìxū dǎbāo bìngqiě zì duìqí" #~ msgid "services includes an object that is not a Service" #~ msgstr "fúwù bāokuò yīgè bùshì fúwù de wùjiàn" +#~ msgid "struct: cannot index" +#~ msgstr "jiégòu: bùnéng suǒyǐn" + +#~ msgid "struct: index out of range" +#~ msgstr "jiégòu: suǒyǐn chāochū fànwéi" + +#~ msgid "struct: no fields" +#~ msgstr "jiégòu: méiyǒu zìduàn" + +#~ msgid "syntax error in JSON" +#~ msgstr "JSON yǔfǎ cuòwù" + +#~ msgid "syntax error in uctypes descriptor" +#~ msgstr "uctypes miáoshù fú zhōng de yǔfǎ cuòwù" + #~ msgid "tile index out of bounds" #~ msgstr "kuài suǒyǐn chāochū fànwéi" From 6700a58a17a040f8f9b1268391a3f1ca7075c3ff Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 Nov 2019 20:54:21 -0600 Subject: [PATCH 046/189] Makefile: Fix a problem where `xargs` invoked `xgettext` 2x On a Debian 10 system, the number of arguments to xargs was such that it would not fit in a single invocation (xargs --show-limits prints "bytes: Size of command buffer we are actually using: 131072"). In this situation, the output from the second invocation of xgettext would replace the output of the first one, so messages that appeared only in files early in the list would be lost. Strings in "extmod" were most frequently the victim, including "incorrect padding" from modubinascii.c. Unfortunately, when the github environment was similar enough to the environment where "make translate" was invoked, the problem was not found by "check-translate", because the same (incorrect, truncated) potfile would be generated on both systems. Apparently Ubuntu and Debian were different enough that the problem could become visible. xgettext has a mode where it reads files from stdin ('-f-'), but this does not have a zero-delimited variant documented. Still, we will assume that files with adversarial names are not committed to circuitpython or created by the build process, and print newline-delimited filenames from `find` to be processed by `xgettext -f-`. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b9c489fd40..d7127b517d 100644 --- a/Makefile +++ b/Makefile @@ -204,7 +204,7 @@ pseudoxml: all-source: locale/circuitpython.pot: all-source - find $(TRANSLATE_SOURCES) -iname "*.c" -print0 | (LC_ALL=C sort -z) | xargs -0 xgettext -L C -s --add-location=file --keyword=translate -o circuitpython.pot -p locale + find $(TRANSLATE_SOURCES) -iname "*.c" -print | (LC_ALL=C sort) | xgettext -f- -L C -s --add-location=file --keyword=translate -o circuitpython.pot -p locale translate: locale/circuitpython.pot for po in $(shell ls locale/*.po); do msgmerge -U $$po -s --no-fuzzy-matching --add-location=file locale/circuitpython.pot; done From 900e365f9389d23381475997025eef953854d726 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 Nov 2019 20:59:14 -0600 Subject: [PATCH 047/189] locale: Re-run "make translate" subsequent to the xargs/xgettext fix I manually inspected the changes relative to 5.0.0-alpha.5-93-g8778f367e and believe they are innocuous; Besides restoring some translations that had become fuzzy, "c-format" was removed from many (all?) fuzzy messages, and the word-wrapping of one message was changed. --- locale/ID.po | 217 +++++++++++++++++++++----------------- locale/circuitpython.pot | 127 ++++++++++++++++++++++- locale/de_DE.po | 217 +++++++++++++++++++++----------------- locale/en_US.po | 127 ++++++++++++++++++++++- locale/en_x_pirate.po | 139 ++++++++++++++++++++++--- locale/es.po | 217 +++++++++++++++++++++----------------- locale/fil.po | 217 +++++++++++++++++++++----------------- locale/fr.po | 217 +++++++++++++++++++++----------------- locale/it_IT.po | 218 ++++++++++++++++++++++----------------- locale/ko.po | 151 ++++++++++++++++++++++----- locale/pl.po | 217 +++++++++++++++++++++----------------- locale/pt_BR.po | 196 ++++++++++++++++++++++------------- locale/zh_Latn_pinyin.po | 217 +++++++++++++++++++++----------------- 13 files changed, 1612 insertions(+), 865 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 26011a9025..9cdbb64ef3 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:11-0600\n" +"POT-Creation-Date: 2019-11-17 20:54-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -438,6 +438,10 @@ msgstr "" msgid "Cannot transfer without MOSI and MISO pins." msgstr "" +#: extmod/moductypes.c +msgid "Cannot unambiguously get sizeof scalar" +msgstr "tidak dapat mendapatkan ukuran scalar secara tidak ambigu" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "" @@ -550,6 +554,10 @@ msgstr "" msgid "EXTINT channel already in use" msgstr "Channel EXTINT sedang digunakan" +#: extmod/modure.c +msgid "Error in regex" +msgstr "Error pada regex" + #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c @@ -754,10 +762,14 @@ msgstr "" msgid "Group full" msgstr "" -#: py/objstringio.c +#: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "operasi I/O pada file tertutup" +#: extmod/machine_i2c.c +msgid "I2C operation not supported" +msgstr "operasi I2C tidak didukung" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1096,7 +1108,7 @@ msgstr "" msgid "Read-only" msgstr "" -#: py/moduerrno.c +#: extmod/vfs_fat.c py/moduerrno.c msgid "Read-only filesystem" msgstr "sistem file (filesystem) bersifat Read-only" @@ -1158,6 +1170,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: extmod/modure.c +msgid "Splitting with sub-captures" +msgstr "Memisahkan dengan menggunakan sub-captures" + #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "" @@ -1392,6 +1408,19 @@ msgstr "" msgid "__new__ arg must be a user-type" msgstr "" +#: extmod/modubinascii.c extmod/moduhashlib.c +msgid "a bytes-like object is required" +msgstr "sebuah objek menyerupai byte (bytes-like) dibutuhkan" + +#: lib/embed/abort_.c +msgid "abort() called" +msgstr "abort() dipanggil" + +#: extmod/machine_mem.c +#, c-format +msgid "address %08x is not aligned to %d bytes" +msgstr "alamat %08x tidak selaras dengan %d bytes" + #: shared-bindings/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "" @@ -1449,6 +1478,10 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" +#: extmod/machine_spi.c +msgid "bits must be 8" +msgstr "bits harus memilki nilai 8" + #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -1480,6 +1513,10 @@ msgstr "" msgid "buffer too small" msgstr "" +#: extmod/machine_spi.c +msgid "buffers must be the same length" +msgstr "buffers harus mempunyai panjang yang sama" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1710,6 +1747,10 @@ msgstr "" msgid "complex values not supported" msgstr "" +#: extmod/moduzlib.c +msgid "compression header" +msgstr "kompresi header" + #: py/parse.c msgid "constant must be an integer" msgstr "" @@ -1752,6 +1793,10 @@ msgstr "" msgid "empty" msgstr "" +#: extmod/moduheapq.c extmod/modutimeq.c +msgid "empty heap" +msgstr "heap kosong" + #: py/objstr.c msgid "empty separator" msgstr "" @@ -1822,6 +1867,10 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" +#: extmod/machine_spi.c +msgid "firstbit must be MSB" +msgstr "bit pertama(firstbit) harus berupa MSB" + #: py/objint.c msgid "float too big" msgstr "" @@ -1890,6 +1939,10 @@ msgstr "" msgid "graphic must be 2048 bytes long" msgstr "" +#: extmod/moduheapq.c +msgid "heap must be a list" +msgstr "heap harus berupa sebuah list" + #: py/compile.c msgid "identifier redefined as global" msgstr "identifier didefinisi ulang sebagai global" @@ -1906,6 +1959,10 @@ msgstr "" msgid "incomplete format key" msgstr "" +#: extmod/modubinascii.c +msgid "incorrect padding" +msgstr "lapisan (padding) tidak benar" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -1932,10 +1989,38 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" +#: extmod/machine_i2c.c +msgid "invalid I2C peripheral" +msgstr "perangkat I2C tidak valid" + +#: extmod/machine_spi.c +msgid "invalid SPI peripheral" +msgstr "perangkat SPI tidak valid" + +#: lib/netutils/netutils.c +msgid "invalid arguments" +msgstr "argumen-argumen tidak valid" + +#: extmod/modussl_axtls.c +msgid "invalid cert" +msgstr "cert tidak valid" + +#: extmod/uos_dupterm.c +msgid "invalid dupterm index" +msgstr "indeks dupterm tidak valid" + +#: extmod/modframebuf.c +msgid "invalid format" +msgstr "format tidak valid" + #: py/objstr.c msgid "invalid format specifier" msgstr "" +#: extmod/modussl_axtls.c +msgid "invalid key" +msgstr "key tidak valid" + #: py/compile.c msgid "invalid micropython decorator" msgstr "micropython decorator tidak valid" @@ -2064,6 +2149,10 @@ msgstr "" msgid "must raise an object" msgstr "" +#: extmod/machine_spi.c +msgid "must specify all of sck/mosi/miso" +msgstr "harus menentukan semua pin sck/mosi/miso" + #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -2130,6 +2219,10 @@ msgstr "" msgid "non-default argument follows default argument" msgstr "argumen non-default mengikuti argumen standar(default)" +#: extmod/modubinascii.c +msgid "non-hex digit found" +msgstr "digit non-hex ditemukan" + #: py/compile.c msgid "non-keyword arg after */**" msgstr "non-keyword arg setelah */**" @@ -2196,6 +2289,10 @@ msgstr "" msgid "object with buffer protocol required" msgstr "" +#: extmod/modubinascii.c +msgid "odd-length string" +msgstr "panjang data string memiliki keganjilan (odd-length)" + #: py/objstr.c py/objstrunicode.c #, fuzzy msgid "offset out of bounds" @@ -2284,6 +2381,10 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: extmod/modutimeq.c +msgid "queue overflow" +msgstr "antrian meluap (overflow)" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "" @@ -2396,6 +2497,18 @@ msgstr "" msgid "string not supported; use bytes or bytearray" msgstr "" +#: extmod/moductypes.c +msgid "struct: cannot index" +msgstr "struct: tidak bisa melakukan index" + +#: extmod/moductypes.c +msgid "struct: index out of range" +msgstr "struct: index keluar dari jangkauan" + +#: extmod/moductypes.c +msgid "struct: no fields" +msgstr "struct: tidak ada fields" + #: py/objstr.c msgid "substring not found" msgstr "" @@ -2404,6 +2517,14 @@ msgstr "" msgid "super() can't find self" msgstr "super() tidak dapat menemukan dirinya sendiri" +#: extmod/modujson.c +msgid "syntax error in JSON" +msgstr "sintaksis error pada JSON" + +#: extmod/moductypes.c +msgid "syntax error in uctypes descriptor" +msgstr "sintaksis error pada pendeskripsi uctypes" + #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" msgstr "" @@ -2621,9 +2742,6 @@ msgstr "" #~ msgid "Cannot set STA config" #~ msgstr "Tidak dapat mengatur konfigurasi STA" -#~ msgid "Cannot unambiguously get sizeof scalar" -#~ msgstr "tidak dapat mendapatkan ukuran scalar secara tidak ambigu" - #~ msgid "Cannot update i/f status" #~ msgstr "Tidak dapat memperbarui status i/f" @@ -2643,9 +2761,6 @@ msgstr "" #~ msgid "Error in ffi_prep_cif" #~ msgstr "Errod pada ffi_prep_cif" -#~ msgid "Error in regex" -#~ msgstr "Error pada regex" - #, fuzzy #~ msgid "Failed to acquire mutex" #~ msgstr "Gagal untuk mendapatkan mutex, status: 0x%08lX" @@ -2717,9 +2832,6 @@ msgstr "" #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 tidak mendukung pull up" -#~ msgid "I2C operation not supported" -#~ msgstr "operasi I2C tidak didukung" - #~ msgid "Invalid bit clock pin" #~ msgstr "Bit clock pada pin tidak valid" @@ -2770,9 +2882,6 @@ msgstr "" #~ msgid "Soft device assert, id: 0x%08lX, pc: 0x%08lX" #~ msgstr "Dukungan soft device, id: 0x%08lX, pc: 0x%08l" -#~ msgid "Splitting with sub-captures" -#~ msgstr "Memisahkan dengan menggunakan sub-captures" - #~ msgid "UART(%d) does not exist" #~ msgstr "UART(%d) tidak ada" @@ -2793,24 +2902,9 @@ msgstr "" #~ msgid "[addrinfo error %d]" #~ msgstr "[addrinfo error %d]" -#~ msgid "a bytes-like object is required" -#~ msgstr "sebuah objek menyerupai byte (bytes-like) dibutuhkan" - -#~ msgid "abort() called" -#~ msgstr "abort() dipanggil" - -#~ msgid "address %08x is not aligned to %d bytes" -#~ msgstr "alamat %08x tidak selaras dengan %d bytes" - -#~ msgid "bits must be 8" -#~ msgstr "bits harus memilki nilai 8" - #~ msgid "buffer too long" #~ msgstr "buffer terlalu panjang" -#~ msgid "buffers must be the same length" -#~ msgstr "buffers harus mempunyai panjang yang sama" - #~ msgid "can query only one param" #~ msgstr "hanya bisa melakukan query satu param" @@ -2826,69 +2920,33 @@ msgstr "" #~ msgid "can't set STA config" #~ msgstr "tidak bisa mendapatkan konfigurasi STA" -#~ msgid "compression header" -#~ msgstr "kompresi header" - #~ msgid "either pos or kw args are allowed" #~ msgstr "hanya antar pos atau kw args yang diperbolehkan" -#~ msgid "empty heap" -#~ msgstr "heap kosong" - #~ msgid "expecting a pin" #~ msgstr "mengharapkan sebuah pin" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" -#~ msgid "firstbit must be MSB" -#~ msgstr "bit pertama(firstbit) harus berupa MSB" - #~ msgid "flash location must be below 1MByte" #~ msgstr "alokasi flash harus dibawah 1MByte" #~ msgid "frequency can only be either 80Mhz or 160MHz" #~ msgstr "frekuensi hanya bisa didefinisikan 80Mhz atau 160Mhz" -#~ msgid "heap must be a list" -#~ msgstr "heap harus berupa sebuah list" - #~ msgid "impossible baudrate" #~ msgstr "baudrate tidak memungkinkan" -#~ msgid "incorrect padding" -#~ msgstr "lapisan (padding) tidak benar" - -#~ msgid "invalid I2C peripheral" -#~ msgstr "perangkat I2C tidak valid" - -#~ msgid "invalid SPI peripheral" -#~ msgstr "perangkat SPI tidak valid" - #~ msgid "invalid alarm" #~ msgstr "alarm tidak valid" -#~ msgid "invalid arguments" -#~ msgstr "argumen-argumen tidak valid" - #~ msgid "invalid buffer length" #~ msgstr "panjang buffer tidak valid" -#~ msgid "invalid cert" -#~ msgstr "cert tidak valid" - #~ msgid "invalid data bits" #~ msgstr "bit data tidak valid" -#~ msgid "invalid dupterm index" -#~ msgstr "indeks dupterm tidak valid" - -#~ msgid "invalid format" -#~ msgstr "format tidak valid" - -#~ msgid "invalid key" -#~ msgstr "key tidak valid" - #~ msgid "invalid pin" #~ msgstr "pin tidak valid" @@ -2901,46 +2959,19 @@ msgstr "" #~ msgid "memory allocation failed, allocating %u bytes for native code" #~ msgstr "alokasi memori gagal, mengalokasikan %u byte untuk kode native" -#~ msgid "must specify all of sck/mosi/miso" -#~ msgstr "harus menentukan semua pin sck/mosi/miso" - #, fuzzy #~ msgid "name must be a string" #~ msgstr "keyword harus berupa string" -#~ msgid "non-hex digit found" -#~ msgstr "digit non-hex ditemukan" - #~ msgid "not a valid ADC Channel: %d" #~ msgstr "tidak valid channel ADC: %d" -#~ msgid "odd-length string" -#~ msgstr "panjang data string memiliki keganjilan (odd-length)" - #~ msgid "pin does not have IRQ capabilities" #~ msgstr "pin tidak memiliki kemampuan IRQ" -#~ msgid "queue overflow" -#~ msgstr "antrian meluap (overflow)" - #~ msgid "scan failed" #~ msgstr "scan gagal" -#~ msgid "struct: cannot index" -#~ msgstr "struct: tidak bisa melakukan index" - -#~ msgid "struct: index out of range" -#~ msgstr "struct: index keluar dari jangkauan" - -#~ msgid "struct: no fields" -#~ msgstr "struct: tidak ada fields" - -#~ msgid "syntax error in JSON" -#~ msgstr "sintaksis error pada JSON" - -#~ msgid "syntax error in uctypes descriptor" -#~ msgstr "sintaksis error pada pendeskripsi uctypes" - #~ msgid "unknown config param" #~ msgstr "konfigurasi param tidak diketahui" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index ee9f5344a1..2c01026f9f 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:17-0600\n" +"POT-Creation-Date: 2019-11-17 20:54-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -428,6 +428,10 @@ msgstr "" msgid "Cannot transfer without MOSI and MISO pins." msgstr "" +#: extmod/moductypes.c +msgid "Cannot unambiguously get sizeof scalar" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "" @@ -539,6 +543,10 @@ msgstr "" msgid "EXTINT channel already in use" msgstr "" +#: extmod/modure.c +msgid "Error in regex" +msgstr "" + #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c @@ -740,10 +748,14 @@ msgstr "" msgid "Group full" msgstr "" -#: py/objstringio.c +#: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "" +#: extmod/machine_i2c.c +msgid "I2C operation not supported" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1079,7 +1091,7 @@ msgstr "" msgid "Read-only" msgstr "" -#: py/moduerrno.c +#: extmod/vfs_fat.c py/moduerrno.c msgid "Read-only filesystem" msgstr "" @@ -1139,6 +1151,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: extmod/modure.c +msgid "Splitting with sub-captures" +msgstr "" + #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "" @@ -1360,6 +1376,19 @@ msgstr "" msgid "__new__ arg must be a user-type" msgstr "" +#: extmod/modubinascii.c extmod/moduhashlib.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/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "" @@ -1417,6 +1446,10 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" +#: extmod/machine_spi.c +msgid "bits must be 8" +msgstr "" + #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -1447,6 +1480,10 @@ msgstr "" msgid "buffer too small" msgstr "" +#: extmod/machine_spi.c +msgid "buffers must be the same length" +msgstr "" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1677,6 +1714,10 @@ msgstr "" msgid "complex values not supported" msgstr "" +#: extmod/moduzlib.c +msgid "compression header" +msgstr "" + #: py/parse.c msgid "constant must be an integer" msgstr "" @@ -1719,6 +1760,10 @@ msgstr "" msgid "empty" msgstr "" +#: extmod/moduheapq.c extmod/modutimeq.c +msgid "empty heap" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "" @@ -1789,6 +1834,10 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" +#: extmod/machine_spi.c +msgid "firstbit must be MSB" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "" @@ -1857,6 +1906,10 @@ msgstr "" 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 "" @@ -1873,6 +1926,10 @@ msgstr "" msgid "incomplete format key" msgstr "" +#: extmod/modubinascii.c +msgid "incorrect padding" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -1899,10 +1956,38 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" +#: extmod/machine_i2c.c +msgid "invalid I2C peripheral" +msgstr "" + +#: extmod/machine_spi.c +msgid "invalid SPI peripheral" +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 "" +#: extmod/modussl_axtls.c +msgid "invalid key" +msgstr "" + #: py/compile.c msgid "invalid micropython decorator" msgstr "" @@ -2031,6 +2116,10 @@ msgstr "" msgid "must raise an object" msgstr "" +#: extmod/machine_spi.c +msgid "must specify all of sck/mosi/miso" +msgstr "" + #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -2097,6 +2186,10 @@ msgstr "" 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 "" @@ -2163,6 +2256,10 @@ msgstr "" msgid "object with buffer protocol required" msgstr "" +#: extmod/modubinascii.c +msgid "odd-length string" +msgstr "" + #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "" @@ -2250,6 +2347,10 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: extmod/modutimeq.c +msgid "queue overflow" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "" @@ -2362,6 +2463,18 @@ msgstr "" msgid "string not supported; use bytes or bytearray" msgstr "" +#: extmod/moductypes.c +msgid "struct: cannot index" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: index out of range" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: no fields" +msgstr "" + #: py/objstr.c msgid "substring not found" msgstr "" @@ -2370,6 +2483,14 @@ msgstr "" 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 "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 90ec37a361..38a6dffb68 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:11-0600\n" +"POT-Creation-Date: 2019-11-17 20:54-0600\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -432,6 +432,10 @@ msgstr "" msgid "Cannot transfer without MOSI and MISO pins." msgstr "Übertragung ohne MOSI- und MISO-Pins nicht möglich." +#: extmod/moductypes.c +msgid "Cannot unambiguously get sizeof scalar" +msgstr "sizeof scalar kann nicht eindeutig bestimmt werden" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Kann nicht ohne MOSI-Pin schreiben." @@ -543,6 +547,10 @@ msgstr "Drive mode wird nicht verwendet, wenn die Richtung input ist." msgid "EXTINT channel already in use" msgstr "EXTINT Kanal ist schon in Benutzung" +#: extmod/modure.c +msgid "Error in regex" +msgstr "Fehler in regex" + #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c @@ -746,10 +754,14 @@ msgstr "Gruppe schon benutzt" msgid "Group full" msgstr "Gruppe voll" -#: py/objstringio.c +#: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Lese/Schreibe-operation an geschlossener Datei" +#: extmod/machine_i2c.c +msgid "I2C operation not supported" +msgstr "I2C-operation nicht unterstützt" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1102,7 +1114,7 @@ msgstr "Bereich außerhalb der Grenzen" msgid "Read-only" msgstr "Nur lesen möglich, da Schreibgeschützt" -#: py/moduerrno.c +#: extmod/vfs_fat.c py/moduerrno.c msgid "Read-only filesystem" msgstr "Schreibgeschützte Dateisystem" @@ -1162,6 +1174,10 @@ msgstr "Slice und Wert (value) haben unterschiedliche Längen." msgid "Slices not supported" msgstr "Slices werden nicht unterstützt" +#: extmod/modure.c +msgid "Splitting with sub-captures" +msgstr "Splitting mit sub-captures" + #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "Die Stackgröße sollte mindestens 256 sein" @@ -1408,6 +1424,19 @@ msgstr "__init__() sollte None zurückgeben, nicht '%s'" msgid "__new__ arg must be a user-type" msgstr "__new__ arg muss user-type sein" +#: extmod/modubinascii.c extmod/moduhashlib.c +msgid "a bytes-like object is required" +msgstr "ein Byte-ähnliches Objekt ist erforderlich" + +#: lib/embed/abort_.c +msgid "abort() called" +msgstr "abort() wurde aufgerufen" + +#: extmod/machine_mem.c +#, c-format +msgid "address %08x is not aligned to %d bytes" +msgstr "Addresse %08x ist nicht an %d bytes ausgerichtet" + #: shared-bindings/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "Adresse außerhalb der Grenzen" @@ -1465,6 +1494,10 @@ msgstr "Der binäre Operator %q ist nicht implementiert" msgid "bits must be 7, 8 or 9" msgstr "bits muss 7, 8 oder 9 sein" +#: extmod/machine_spi.c +msgid "bits must be 8" +msgstr "bits müssen 8 sein" + #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "Es müssen 8 oder 16 bits_per_sample sein" @@ -1495,6 +1528,10 @@ msgstr "Puffersegmente müssen gleich lang sein" msgid "buffer too small" msgstr "Der Puffer ist zu klein" +#: extmod/machine_spi.c +msgid "buffers must be the same length" +msgstr "Buffer müssen gleich lang sein" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1726,6 +1763,10 @@ msgstr "Komplexe Division durch null" msgid "complex values not supported" msgstr "Komplexe Zahlen nicht unterstützt" +#: extmod/moduzlib.c +msgid "compression header" +msgstr "kompression header" + #: py/parse.c msgid "constant must be an integer" msgstr "constant muss ein integer sein" @@ -1768,6 +1809,10 @@ msgstr "Division durch Null" msgid "empty" msgstr "leer" +#: extmod/moduheapq.c extmod/modutimeq.c +msgid "empty heap" +msgstr "leerer heap" + #: py/objstr.c msgid "empty separator" msgstr "leeres Trennzeichen" @@ -1838,6 +1883,10 @@ msgstr "Das Dateisystem muss eine Mount-Methode bereitstellen" msgid "first argument to super() must be type" msgstr "Das erste Argument für super() muss type sein" +#: extmod/machine_spi.c +msgid "firstbit must be MSB" +msgstr "Erstes Bit muss das höchstwertigste Bit (MSB) sein" + #: py/objint.c msgid "float too big" msgstr "float zu groß" @@ -1907,6 +1956,10 @@ msgstr "Generator ignoriert GeneratorExit" msgid "graphic must be 2048 bytes long" msgstr "graphic muss 2048 Byte lang sein" +#: extmod/moduheapq.c +msgid "heap must be a list" +msgstr "heap muss eine Liste sein" + #: py/compile.c msgid "identifier redefined as global" msgstr "Bezeichner als global neu definiert" @@ -1923,6 +1976,10 @@ msgstr "unvollständiges Format" msgid "incomplete format key" msgstr "unvollständiger Formatschlüssel" +#: extmod/modubinascii.c +msgid "incorrect padding" +msgstr "padding ist inkorrekt" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -1949,10 +2006,38 @@ msgstr "integer erforderlich" msgid "interval must be in range %s-%s" msgstr "Das Intervall muss im Bereich %s-%s sein" +#: extmod/machine_i2c.c +msgid "invalid I2C peripheral" +msgstr "ungültige I2C Schnittstelle" + +#: extmod/machine_spi.c +msgid "invalid SPI peripheral" +msgstr "ungültige SPI Schnittstelle" + +#: lib/netutils/netutils.c +msgid "invalid arguments" +msgstr "ungültige argumente" + +#: extmod/modussl_axtls.c +msgid "invalid cert" +msgstr "ungültiges cert" + +#: extmod/uos_dupterm.c +msgid "invalid dupterm index" +msgstr "ungültiger dupterm index" + +#: extmod/modframebuf.c +msgid "invalid format" +msgstr "ungültiges Format" + #: py/objstr.c msgid "invalid format specifier" msgstr "ungültiger Formatbezeichner" +#: extmod/modussl_axtls.c +msgid "invalid key" +msgstr "ungültiger Schlüssel" + #: py/compile.c msgid "invalid micropython decorator" msgstr "ungültiger micropython decorator" @@ -2087,6 +2172,10 @@ msgstr "Mehrfache Vererbung nicht unterstützt" msgid "must raise an object" msgstr "" +#: extmod/machine_spi.c +msgid "must specify all of sck/mosi/miso" +msgstr "sck/mosi/miso müssen alle spezifiziert sein" + #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "muss Schlüsselwortargument für key function verwenden" @@ -2153,6 +2242,10 @@ msgstr "" msgid "non-default argument follows default argument" msgstr "ein non-default argument folgt auf ein default argument" +#: extmod/modubinascii.c +msgid "non-hex digit found" +msgstr "eine nicht-hex zahl wurde gefunden" + #: py/compile.c msgid "non-keyword arg after */**" msgstr "" @@ -2219,6 +2312,10 @@ msgstr "Objekt vom Typ '%s' hat keine len()" msgid "object with buffer protocol required" msgstr "Objekt mit Pufferprotokoll (buffer protocol) erforderlich" +#: extmod/modubinascii.c +msgid "odd-length string" +msgstr "String mit ungerader Länge" + #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "offset außerhalb der Grenzen" @@ -2308,6 +2405,10 @@ msgstr "pow() drittes Argument darf nicht 0 sein" msgid "pow() with 3 arguments requires integers" msgstr "" +#: extmod/modutimeq.c +msgid "queue overflow" +msgstr "Warteschlangenüberlauf" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "rawbuf hat nicht die gleiche Größe wie buf" @@ -2423,6 +2524,18 @@ msgid "string not supported; use bytes or bytearray" msgstr "" "Zeichenfolgen werden nicht unterstützt; Verwenden Sie bytes oder bytearray" +#: extmod/moductypes.c +msgid "struct: cannot index" +msgstr "struct: kann nicht indexieren" + +#: extmod/moductypes.c +msgid "struct: index out of range" +msgstr "struct: index außerhalb gültigen Bereichs" + +#: extmod/moductypes.c +msgid "struct: no fields" +msgstr "struct: keine Felder" + #: py/objstr.c msgid "substring not found" msgstr "substring nicht gefunden" @@ -2431,6 +2544,14 @@ msgstr "substring nicht gefunden" msgid "super() can't find self" msgstr "super() kann self nicht finden" +#: extmod/modujson.c +msgid "syntax error in JSON" +msgstr "Syntaxfehler in JSON" + +#: extmod/moductypes.c +msgid "syntax error in uctypes descriptor" +msgstr "Syntaxfehler in uctypes Deskriptor" + #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" msgstr "threshold muss im Intervall 0-65536 liegen" @@ -2666,9 +2787,6 @@ msgstr "" #~ msgid "Cannot set STA config" #~ msgstr "Kann STA Konfiguration nicht setzen" -#~ msgid "Cannot unambiguously get sizeof scalar" -#~ msgstr "sizeof scalar kann nicht eindeutig bestimmt werden" - #~ msgid "Cannot update i/f status" #~ msgstr "Kann i/f Status nicht updaten" @@ -2694,9 +2812,6 @@ msgstr "" #~ msgid "Error in ffi_prep_cif" #~ msgstr "Fehler in ffi_prep_cif" -#~ msgid "Error in regex" -#~ msgstr "Fehler in regex" - #~ msgid "Expected a Peripheral" #~ msgstr "Ein Peripheriegerät wird erwartet" @@ -2764,9 +2879,6 @@ msgstr "" #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 unterstützt pull up nicht" -#~ msgid "I2C operation not supported" -#~ msgstr "I2C-operation nicht unterstützt" - #~ msgid "Invalid bit clock pin" #~ msgstr "Ungültiges bit clock pin" @@ -2825,9 +2937,6 @@ msgstr "" #~ msgid "STA required" #~ msgstr "STA erforderlich" -#~ msgid "Splitting with sub-captures" -#~ msgstr "Splitting mit sub-captures" - #~ msgid "UART(%d) does not exist" #~ msgstr "UART(%d) existiert nicht" @@ -2850,30 +2959,9 @@ msgstr "" #~ msgid "Voice index too high" #~ msgstr "Voice index zu hoch" -#~ msgid "a bytes-like object is required" -#~ msgstr "ein Byte-ähnliches Objekt ist erforderlich" - -#~ msgid "abort() called" -#~ msgstr "abort() wurde aufgerufen" - -#~ msgid "address %08x is not aligned to %d bytes" -#~ msgstr "Addresse %08x ist nicht an %d bytes ausgerichtet" - -#~ msgid "bits must be 8" -#~ msgstr "bits müssen 8 sein" - #~ msgid "buffer too long" #~ msgstr "Buffer zu lang" -#~ msgid "buffers must be the same length" -#~ msgstr "Buffer müssen gleich lang sein" - -#~ msgid "compression header" -#~ msgstr "kompression header" - -#~ msgid "empty heap" -#~ msgstr "leerer heap" - #~ msgid "expected a DigitalInOut" #~ msgstr "erwarte DigitalInOut" @@ -2883,57 +2971,27 @@ msgstr "" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" -#~ msgid "firstbit must be MSB" -#~ msgstr "Erstes Bit muss das höchstwertigste Bit (MSB) sein" - #~ msgid "flash location must be below 1MByte" #~ msgstr "flash location muss unter 1MByte sein" #~ msgid "frequency can only be either 80Mhz or 160MHz" #~ msgstr "Die Frequenz kann nur 80Mhz oder 160Mhz sein" -#~ msgid "heap must be a list" -#~ msgstr "heap muss eine Liste sein" - #~ msgid "impossible baudrate" #~ msgstr "Unmögliche Baudrate" -#~ msgid "incorrect padding" -#~ msgstr "padding ist inkorrekt" - #~ msgid "interval not in range 0.0020 to 10.24" #~ msgstr "Das Interval ist nicht im Bereich 0.0020 bis 10.24" -#~ msgid "invalid I2C peripheral" -#~ msgstr "ungültige I2C Schnittstelle" - -#~ msgid "invalid SPI peripheral" -#~ msgstr "ungültige SPI Schnittstelle" - #~ msgid "invalid alarm" #~ msgstr "ungültiger Alarm" -#~ msgid "invalid arguments" -#~ msgstr "ungültige argumente" - #~ msgid "invalid buffer length" #~ msgstr "ungültige Pufferlänge" -#~ msgid "invalid cert" -#~ msgstr "ungültiges cert" - #~ msgid "invalid data bits" #~ msgstr "ungültige Datenbits" -#~ msgid "invalid dupterm index" -#~ msgstr "ungültiger dupterm index" - -#~ msgid "invalid format" -#~ msgstr "ungültiges Format" - -#~ msgid "invalid key" -#~ msgstr "ungültiger Schlüssel" - #~ msgid "invalid pin" #~ msgstr "ungültiger Pin" @@ -2947,45 +3005,18 @@ msgstr "" #~ msgstr "" #~ "Speicherallozierung fehlgeschlagen, alloziere %u Bytes für nativen Code" -#~ msgid "must specify all of sck/mosi/miso" -#~ msgstr "sck/mosi/miso müssen alle spezifiziert sein" - #~ msgid "name must be a string" #~ msgstr "name muss ein String sein" -#~ msgid "non-hex digit found" -#~ msgstr "eine nicht-hex zahl wurde gefunden" - #~ msgid "not a valid ADC Channel: %d" #~ msgstr "Kein gültiger ADC Kanal: %d" -#~ msgid "odd-length string" -#~ msgstr "String mit ungerader Länge" - #~ msgid "pin does not have IRQ capabilities" #~ msgstr "Pin hat keine IRQ Fähigkeiten" -#~ msgid "queue overflow" -#~ msgstr "Warteschlangenüberlauf" - #~ msgid "scan failed" #~ msgstr "Scan fehlgeschlagen" -#~ msgid "struct: cannot index" -#~ msgstr "struct: kann nicht indexieren" - -#~ msgid "struct: index out of range" -#~ msgstr "struct: index außerhalb gültigen Bereichs" - -#~ msgid "struct: no fields" -#~ msgstr "struct: keine Felder" - -#~ msgid "syntax error in JSON" -#~ msgstr "Syntaxfehler in JSON" - -#~ msgid "syntax error in uctypes descriptor" -#~ msgstr "Syntaxfehler in uctypes Deskriptor" - #~ msgid "too many arguments" #~ msgstr "zu viele Argumente" diff --git a/locale/en_US.po b/locale/en_US.po index 9b234599a3..9408102d61 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:11-0600\n" +"POT-Creation-Date: 2019-11-17 20:54-0600\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -428,6 +428,10 @@ msgstr "" msgid "Cannot transfer without MOSI and MISO pins." msgstr "" +#: extmod/moductypes.c +msgid "Cannot unambiguously get sizeof scalar" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "" @@ -539,6 +543,10 @@ msgstr "" msgid "EXTINT channel already in use" msgstr "" +#: extmod/modure.c +msgid "Error in regex" +msgstr "" + #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c @@ -740,10 +748,14 @@ msgstr "" msgid "Group full" msgstr "" -#: py/objstringio.c +#: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "" +#: extmod/machine_i2c.c +msgid "I2C operation not supported" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1079,7 +1091,7 @@ msgstr "" msgid "Read-only" msgstr "" -#: py/moduerrno.c +#: extmod/vfs_fat.c py/moduerrno.c msgid "Read-only filesystem" msgstr "" @@ -1139,6 +1151,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: extmod/modure.c +msgid "Splitting with sub-captures" +msgstr "" + #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "" @@ -1360,6 +1376,19 @@ msgstr "" msgid "__new__ arg must be a user-type" msgstr "" +#: extmod/modubinascii.c extmod/moduhashlib.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/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "" @@ -1417,6 +1446,10 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" +#: extmod/machine_spi.c +msgid "bits must be 8" +msgstr "" + #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -1447,6 +1480,10 @@ msgstr "" msgid "buffer too small" msgstr "" +#: extmod/machine_spi.c +msgid "buffers must be the same length" +msgstr "" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1677,6 +1714,10 @@ msgstr "" msgid "complex values not supported" msgstr "" +#: extmod/moduzlib.c +msgid "compression header" +msgstr "" + #: py/parse.c msgid "constant must be an integer" msgstr "" @@ -1719,6 +1760,10 @@ msgstr "" msgid "empty" msgstr "" +#: extmod/moduheapq.c extmod/modutimeq.c +msgid "empty heap" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "" @@ -1789,6 +1834,10 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" +#: extmod/machine_spi.c +msgid "firstbit must be MSB" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "" @@ -1857,6 +1906,10 @@ msgstr "" 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 "" @@ -1873,6 +1926,10 @@ msgstr "" msgid "incomplete format key" msgstr "" +#: extmod/modubinascii.c +msgid "incorrect padding" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -1899,10 +1956,38 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" +#: extmod/machine_i2c.c +msgid "invalid I2C peripheral" +msgstr "" + +#: extmod/machine_spi.c +msgid "invalid SPI peripheral" +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 "" +#: extmod/modussl_axtls.c +msgid "invalid key" +msgstr "" + #: py/compile.c msgid "invalid micropython decorator" msgstr "" @@ -2031,6 +2116,10 @@ msgstr "" msgid "must raise an object" msgstr "" +#: extmod/machine_spi.c +msgid "must specify all of sck/mosi/miso" +msgstr "" + #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -2097,6 +2186,10 @@ msgstr "" 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 "" @@ -2163,6 +2256,10 @@ msgstr "" msgid "object with buffer protocol required" msgstr "" +#: extmod/modubinascii.c +msgid "odd-length string" +msgstr "" + #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "" @@ -2250,6 +2347,10 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: extmod/modutimeq.c +msgid "queue overflow" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "" @@ -2362,6 +2463,18 @@ msgstr "" msgid "string not supported; use bytes or bytearray" msgstr "" +#: extmod/moductypes.c +msgid "struct: cannot index" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: index out of range" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: no fields" +msgstr "" + #: py/objstr.c msgid "substring not found" msgstr "" @@ -2370,6 +2483,14 @@ msgstr "" 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 "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index 9fea903c32..6bf2d84a44 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:11-0600\n" +"POT-Creation-Date: 2019-11-17 20:54-0600\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -432,6 +432,10 @@ msgstr "" msgid "Cannot transfer without MOSI and MISO pins." msgstr "" +#: extmod/moductypes.c +msgid "Cannot unambiguously get sizeof scalar" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "" @@ -543,6 +547,10 @@ msgstr "" msgid "EXTINT channel already in use" msgstr "Avast! EXTINT channel already in use" +#: extmod/modure.c +msgid "Error in regex" +msgstr "" + #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c @@ -744,10 +752,14 @@ msgstr "" msgid "Group full" msgstr "" -#: py/objstringio.c +#: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "" +#: extmod/machine_i2c.c +msgid "I2C operation not supported" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1083,7 +1095,7 @@ msgstr "" msgid "Read-only" msgstr "" -#: py/moduerrno.c +#: extmod/vfs_fat.c py/moduerrno.c msgid "Read-only filesystem" msgstr "" @@ -1143,6 +1155,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: extmod/modure.c +msgid "Splitting with sub-captures" +msgstr "" + #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "" @@ -1364,6 +1380,19 @@ msgstr "" msgid "__new__ arg must be a user-type" msgstr "" +#: extmod/modubinascii.c extmod/moduhashlib.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/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "" @@ -1421,6 +1450,10 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" +#: extmod/machine_spi.c +msgid "bits must be 8" +msgstr "pieces must be of 8" + #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -1451,6 +1484,10 @@ msgstr "" msgid "buffer too small" msgstr "" +#: extmod/machine_spi.c +msgid "buffers must be the same length" +msgstr "yer buffers must be of the same length" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1681,6 +1718,10 @@ msgstr "" msgid "complex values not supported" msgstr "" +#: extmod/moduzlib.c +msgid "compression header" +msgstr "" + #: py/parse.c msgid "constant must be an integer" msgstr "" @@ -1723,6 +1764,10 @@ msgstr "" msgid "empty" msgstr "" +#: extmod/moduheapq.c extmod/modutimeq.c +msgid "empty heap" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "" @@ -1793,6 +1838,10 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" +#: extmod/machine_spi.c +msgid "firstbit must be MSB" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "" @@ -1861,6 +1910,10 @@ msgstr "" 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 "" @@ -1877,6 +1930,10 @@ msgstr "" msgid "incomplete format key" msgstr "" +#: extmod/modubinascii.c +msgid "incorrect padding" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -1903,10 +1960,38 @@ msgstr "" msgid "interval must be in range %s-%s" msgstr "" +#: extmod/machine_i2c.c +msgid "invalid I2C peripheral" +msgstr "Belay that! I2C peripheral be invalid" + +#: extmod/machine_spi.c +msgid "invalid SPI peripheral" +msgstr "Arr! SPI peripheral be invalid" + +#: 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 "" +#: extmod/modussl_axtls.c +msgid "invalid key" +msgstr "" + #: py/compile.c msgid "invalid micropython decorator" msgstr "" @@ -2035,6 +2120,10 @@ msgstr "" msgid "must raise an object" msgstr "" +#: extmod/machine_spi.c +msgid "must specify all of sck/mosi/miso" +msgstr "" + #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -2101,6 +2190,10 @@ msgstr "" 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 "" @@ -2167,6 +2260,10 @@ msgstr "" msgid "object with buffer protocol required" msgstr "" +#: extmod/modubinascii.c +msgid "odd-length string" +msgstr "" + #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "" @@ -2254,6 +2351,10 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: extmod/modutimeq.c +msgid "queue overflow" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "" @@ -2366,6 +2467,18 @@ msgstr "" msgid "string not supported; use bytes or bytearray" msgstr "" +#: extmod/moductypes.c +msgid "struct: cannot index" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: index out of range" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: no fields" +msgstr "" + #: py/objstr.c msgid "substring not found" msgstr "" @@ -2374,6 +2487,14 @@ msgstr "" 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 "" @@ -2589,15 +2710,3 @@ msgstr "" #~ msgid "Invalid clock pin" #~ msgstr "Avast! Clock pin be invalid" - -#~ msgid "bits must be 8" -#~ msgstr "pieces must be of 8" - -#~ msgid "buffers must be the same length" -#~ msgstr "yer buffers must be of the same length" - -#~ msgid "invalid I2C peripheral" -#~ msgstr "Belay that! I2C peripheral be invalid" - -#~ msgid "invalid SPI peripheral" -#~ msgstr "Arr! SPI peripheral be invalid" diff --git a/locale/es.po b/locale/es.po index 2c029edd54..449e88a800 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:11-0600\n" +"POT-Creation-Date: 2019-11-17 20:54-0600\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -436,6 +436,10 @@ msgstr "Cannot subclass slice" msgid "Cannot transfer without MOSI and MISO pins." msgstr "No se puede transmitir sin pines MOSI y MISO." +#: extmod/moductypes.c +msgid "Cannot unambiguously get sizeof scalar" +msgstr "No se puede obtener inequívocamente sizeof escalar" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "No se puede escribir sin pin MOSI." @@ -547,6 +551,10 @@ msgstr "Modo Drive no se usa cuando la dirección es input." msgid "EXTINT channel already in use" msgstr "El canal EXTINT ya está siendo utilizado" +#: extmod/modure.c +msgid "Error in regex" +msgstr "Error en regex" + #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c @@ -749,10 +757,14 @@ msgstr "" msgid "Group full" msgstr "Group lleno" -#: py/objstringio.c +#: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Operación I/O en archivo cerrado" +#: extmod/machine_i2c.c +msgid "I2C operation not supported" +msgstr "operación I2C no soportada" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1104,7 +1116,7 @@ msgstr "address fuera de límites" msgid "Read-only" msgstr "Solo-lectura" -#: py/moduerrno.c +#: extmod/vfs_fat.c py/moduerrno.c msgid "Read-only filesystem" msgstr "Sistema de archivos de solo-Lectura" @@ -1165,6 +1177,10 @@ msgstr "Slice y value tienen diferentes longitudes" msgid "Slices not supported" msgstr "Rebanadas no soportadas" +#: extmod/modure.c +msgid "Splitting with sub-captures" +msgstr "Dividiendo con sub-capturas" + #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "El tamaño de la pila debe ser de al menos 256" @@ -1407,6 +1423,19 @@ msgstr "__init__() deberia devolver None, no '%s'" msgid "__new__ arg must be a user-type" msgstr "__new__ arg debe ser un user-type" +#: extmod/modubinascii.c extmod/moduhashlib.c +msgid "a bytes-like object is required" +msgstr "se requiere un objeto bytes-like" + +#: lib/embed/abort_.c +msgid "abort() called" +msgstr "se llamó abort()" + +#: extmod/machine_mem.c +#, c-format +msgid "address %08x is not aligned to %d bytes" +msgstr "la dirección %08x no esta alineada a %d bytes" + #: shared-bindings/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "address fuera de límites" @@ -1464,6 +1493,10 @@ msgstr "operacion binaria %q no implementada" msgid "bits must be 7, 8 or 9" msgstr "bits deben ser 7, 8 ó 9" +#: extmod/machine_spi.c +msgid "bits must be 8" +msgstr "bits debe ser 8" + #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample debe ser 8 ó 16" @@ -1494,6 +1527,10 @@ msgstr "Las secciones del buffer necesitan tener longitud igual" msgid "buffer too small" msgstr "buffer demasiado pequeño" +#: extmod/machine_spi.c +msgid "buffers must be the same length" +msgstr "los buffers deben de tener la misma longitud" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "los botones necesitan ser digitalio.DigitalInOut" @@ -1729,6 +1766,10 @@ msgstr "división compleja por cero" msgid "complex values not supported" msgstr "valores complejos no soportados" +#: extmod/moduzlib.c +msgid "compression header" +msgstr "encabezado de compresión" + #: py/parse.c msgid "constant must be an integer" msgstr "constant debe ser un entero" @@ -1773,6 +1814,10 @@ msgstr "división por cero" msgid "empty" msgstr "vacío" +#: extmod/moduheapq.c extmod/modutimeq.c +msgid "empty heap" +msgstr "heap vacío" + #: py/objstr.c msgid "empty separator" msgstr "separator vacío" @@ -1843,6 +1888,10 @@ msgstr "sistema de archivos debe proporcionar método de montaje" msgid "first argument to super() must be type" msgstr "primer argumento para super() debe ser de tipo" +#: extmod/machine_spi.c +msgid "firstbit must be MSB" +msgstr "firstbit debe ser MSB" + #: py/objint.c msgid "float too big" msgstr "" @@ -1911,6 +1960,10 @@ msgstr "generador ignorado GeneratorExit" msgid "graphic must be 2048 bytes long" msgstr "graphic debe ser 2048 bytes de largo" +#: extmod/moduheapq.c +msgid "heap must be a list" +msgstr "heap debe ser una lista" + #: py/compile.c msgid "identifier redefined as global" msgstr "identificador redefinido como global" @@ -1927,6 +1980,10 @@ msgstr "formato incompleto" msgid "incomplete format key" msgstr "" +#: extmod/modubinascii.c +msgid "incorrect padding" +msgstr "relleno (padding) incorrecto" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -1953,10 +2010,38 @@ msgstr "Entero requerido" msgid "interval must be in range %s-%s" msgstr "" +#: extmod/machine_i2c.c +msgid "invalid I2C peripheral" +msgstr "periférico I2C inválido" + +#: extmod/machine_spi.c +msgid "invalid SPI peripheral" +msgstr "periférico SPI inválido" + +#: lib/netutils/netutils.c +msgid "invalid arguments" +msgstr "argumentos inválidos" + +#: extmod/modussl_axtls.c +msgid "invalid cert" +msgstr "certificado inválido" + +#: extmod/uos_dupterm.c +msgid "invalid dupterm index" +msgstr "index dupterm inválido" + +#: extmod/modframebuf.c +msgid "invalid format" +msgstr "formato inválido" + #: py/objstr.c msgid "invalid format specifier" msgstr "especificador de formato inválido" +#: extmod/modussl_axtls.c +msgid "invalid key" +msgstr "llave inválida" + #: py/compile.c msgid "invalid micropython decorator" msgstr "decorador de micropython inválido" @@ -2088,6 +2173,10 @@ msgstr "herencia multiple no soportada" msgid "must raise an object" msgstr "debe hacer un raise de un objeto" +#: extmod/machine_spi.c +msgid "must specify all of sck/mosi/miso" +msgstr "se deben de especificar sck/mosi/miso" + #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "debe utilizar argumento de palabra clave para la función clave" @@ -2154,6 +2243,10 @@ msgstr "" msgid "non-default argument follows default argument" msgstr "argumento no predeterminado sigue argumento predeterminado" +#: extmod/modubinascii.c +msgid "non-hex digit found" +msgstr "digito non-hex encontrado" + #: py/compile.c msgid "non-keyword arg after */**" msgstr "no deberia estar/tener agumento por palabra clave despues de */**" @@ -2223,6 +2316,10 @@ msgstr "el objeto de tipo '%s' no tiene len()" msgid "object with buffer protocol required" msgstr "objeto con protocolo de buffer requerido" +#: extmod/modubinascii.c +msgid "odd-length string" +msgstr "string de longitud impar" + #: py/objstr.c py/objstrunicode.c #, fuzzy msgid "offset out of bounds" @@ -2311,6 +2408,10 @@ msgstr "el 3er argumento de pow() no puede ser 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() con 3 argumentos requiere enteros" +#: extmod/modutimeq.c +msgid "queue overflow" +msgstr "desbordamiento de cola(queue)" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "rawbuf no es el mismo tamaño que buf" @@ -2427,6 +2528,18 @@ msgstr "índices de string deben ser enteros, no %s" msgid "string not supported; use bytes or bytearray" msgstr "string no soportado; usa bytes o bytearray" +#: extmod/moductypes.c +msgid "struct: cannot index" +msgstr "struct: no se puede indexar" + +#: extmod/moductypes.c +msgid "struct: index out of range" +msgstr "struct: index fuera de rango" + +#: extmod/moductypes.c +msgid "struct: no fields" +msgstr "struct: sin campos" + #: py/objstr.c msgid "substring not found" msgstr "substring no encontrado" @@ -2435,6 +2548,14 @@ msgstr "substring no encontrado" msgid "super() can't find self" msgstr "super() no puede encontrar self" +#: extmod/modujson.c +msgid "syntax error in JSON" +msgstr "error de sintaxis en JSON" + +#: extmod/moductypes.c +msgid "syntax error in uctypes descriptor" +msgstr "error de sintaxis en el descriptor uctypes" + #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" msgstr "limite debe ser en el rango 0-65536" @@ -2665,9 +2786,6 @@ msgstr "paso cero" #~ msgid "Cannot set STA config" #~ msgstr "No se puede establecer STA config" -#~ msgid "Cannot unambiguously get sizeof scalar" -#~ msgstr "No se puede obtener inequívocamente sizeof escalar" - #~ msgid "Cannot update i/f status" #~ msgstr "No se puede actualizar i/f status" @@ -2693,9 +2811,6 @@ msgstr "paso cero" #~ msgid "Error in ffi_prep_cif" #~ msgstr "Error en ffi_prep_cif" -#~ msgid "Error in regex" -#~ msgstr "Error en regex" - #, fuzzy #~ msgid "Failed to acquire mutex" #~ msgstr "No se puede adquirir el mutex, status: 0x%08lX" @@ -2765,9 +2880,6 @@ msgstr "paso cero" #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 no soporta pull up." -#~ msgid "I2C operation not supported" -#~ msgstr "operación I2C no soportada" - #~ msgid "Invalid bit clock pin" #~ msgstr "Pin bit clock inválido" @@ -2839,9 +2951,6 @@ msgstr "paso cero" #~ msgid "Soft device assert, id: 0x%08lX, pc: 0x%08lX" #~ msgstr "Soft device assert, id: 0x%08lX, pc: 0x%08lX" -#~ msgid "Splitting with sub-captures" -#~ msgstr "Dividiendo con sub-capturas" - #~ msgid "Tile indices must be 0 - 255" #~ msgstr "Los índices de Tile deben ser 0 - 255" @@ -2867,27 +2976,12 @@ msgstr "paso cero" #~ msgid "Voice index too high" #~ msgstr "Index de voz demasiado alto" -#~ msgid "a bytes-like object is required" -#~ msgstr "se requiere un objeto bytes-like" - -#~ msgid "abort() called" -#~ msgstr "se llamó abort()" - -#~ msgid "address %08x is not aligned to %d bytes" -#~ msgstr "la dirección %08x no esta alineada a %d bytes" - #~ msgid "bad GATT role" #~ msgstr "mal GATT role" -#~ msgid "bits must be 8" -#~ msgstr "bits debe ser 8" - #~ msgid "buffer too long" #~ msgstr "buffer demasiado largo" -#~ msgid "buffers must be the same length" -#~ msgstr "los buffers deben de tener la misma longitud" - #~ msgid "can query only one param" #~ msgstr "puede consultar solo un param" @@ -2906,15 +3000,9 @@ msgstr "paso cero" #~ msgid "characteristics includes an object that is not a Characteristic" #~ msgstr "characteristics incluye un objeto que no es una Characteristica" -#~ msgid "compression header" -#~ msgstr "encabezado de compresión" - #~ msgid "either pos or kw args are allowed" #~ msgstr "ya sea pos o kw args son permitidos" -#~ msgid "empty heap" -#~ msgstr "heap vacío" - #~ msgid "expected a DigitalInOut" #~ msgstr "se espera un DigitalInOut" @@ -2924,57 +3012,27 @@ msgstr "paso cero" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" -#~ msgid "firstbit must be MSB" -#~ msgstr "firstbit debe ser MSB" - #~ msgid "flash location must be below 1MByte" #~ msgstr "la ubicación de la flash debe estar debajo de 1MByte" #~ msgid "frequency can only be either 80Mhz or 160MHz" #~ msgstr "la frecuencia solo puede ser 80MHz ó 160MHz" -#~ msgid "heap must be a list" -#~ msgstr "heap debe ser una lista" - #~ msgid "impossible baudrate" #~ msgstr "baudrate imposible" -#~ msgid "incorrect padding" -#~ msgstr "relleno (padding) incorrecto" - #~ msgid "interval not in range 0.0020 to 10.24" #~ msgstr "El intervalo está fuera del rango de 0.0020 a 10.24" -#~ msgid "invalid I2C peripheral" -#~ msgstr "periférico I2C inválido" - -#~ msgid "invalid SPI peripheral" -#~ msgstr "periférico SPI inválido" - #~ msgid "invalid alarm" #~ msgstr "alarma inválida" -#~ msgid "invalid arguments" -#~ msgstr "argumentos inválidos" - #~ msgid "invalid buffer length" #~ msgstr "longitud de buffer inválida" -#~ msgid "invalid cert" -#~ msgstr "certificado inválido" - #~ msgid "invalid data bits" #~ msgstr "data bits inválidos" -#~ msgid "invalid dupterm index" -#~ msgstr "index dupterm inválido" - -#~ msgid "invalid format" -#~ msgstr "formato inválido" - -#~ msgid "invalid key" -#~ msgstr "llave inválida" - #~ msgid "invalid pin" #~ msgstr "pin inválido" @@ -2988,30 +3046,18 @@ msgstr "paso cero" #~ msgstr "" #~ "falló la asignación de memoria, asignando %u bytes para código nativo" -#~ msgid "must specify all of sck/mosi/miso" -#~ msgstr "se deben de especificar sck/mosi/miso" - #~ msgid "name must be a string" #~ msgstr "name debe de ser un string" -#~ msgid "non-hex digit found" -#~ msgstr "digito non-hex encontrado" - #~ msgid "not a valid ADC Channel: %d" #~ msgstr "no es un canal ADC válido: %d" -#~ msgid "odd-length string" -#~ msgstr "string de longitud impar" - #~ msgid "pin does not have IRQ capabilities" #~ msgstr "pin sin capacidades IRQ" #~ msgid "position must be 2-tuple" #~ msgstr "posición debe ser 2-tuple" -#~ msgid "queue overflow" -#~ msgstr "desbordamiento de cola(queue)" - #~ msgid "row must be packed and word aligned" #~ msgstr "la fila debe estar empacada y la palabra alineada" @@ -3021,21 +3067,6 @@ msgstr "paso cero" #~ msgid "services includes an object that is not a Service" #~ msgstr "services incluye un objeto que no es servicio" -#~ msgid "struct: cannot index" -#~ msgstr "struct: no se puede indexar" - -#~ msgid "struct: index out of range" -#~ msgstr "struct: index fuera de rango" - -#~ msgid "struct: no fields" -#~ msgstr "struct: sin campos" - -#~ msgid "syntax error in JSON" -#~ msgstr "error de sintaxis en JSON" - -#~ msgid "syntax error in uctypes descriptor" -#~ msgstr "error de sintaxis en el descriptor uctypes" - #~ msgid "tile index out of bounds" #~ msgstr "el indice del tile fuera de limite" diff --git a/locale/fil.po b/locale/fil.po index 6f51ff315d..57b633890c 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:11-0600\n" +"POT-Creation-Date: 2019-11-17 20:54-0600\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -436,6 +436,10 @@ msgstr "Hindi magawa ang sublcass slice" msgid "Cannot transfer without MOSI and MISO pins." msgstr "Hindi maaaring ilipat kapag walang MOSI at MISO pin." +#: extmod/moductypes.c +msgid "Cannot unambiguously get sizeof scalar" +msgstr "Hindi puedeng hindi sigurado ang get sizeof scalar" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Hindi maaring isulat kapag walang MOSI pin." @@ -551,6 +555,10 @@ msgstr "Drive mode ay hindi ginagamit kapag ang direksyon ay input." msgid "EXTINT channel already in use" msgstr "Ginagamit na ang EXTINT channel" +#: extmod/modure.c +msgid "Error in regex" +msgstr "May pagkakamali sa REGEX" + #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c @@ -757,10 +765,14 @@ msgstr "" msgid "Group full" msgstr "Puno ang group" -#: py/objstringio.c +#: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "I/O operasyon sa saradong file" +#: extmod/machine_i2c.c +msgid "I2C operation not supported" +msgstr "Hindi supportado ang operasyong I2C" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1110,7 +1122,7 @@ msgstr "wala sa sakop ang address" msgid "Read-only" msgstr "Basahin-lamang" -#: py/moduerrno.c +#: extmod/vfs_fat.c py/moduerrno.c msgid "Read-only filesystem" msgstr "Basahin-lamang mode" @@ -1171,6 +1183,10 @@ msgstr "Slice at value iba't ibang haba." msgid "Slices not supported" msgstr "Hindi suportado ang Slices" +#: extmod/modure.c +msgid "Splitting with sub-captures" +msgstr "Binibiyak gamit ang sub-captures" + #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "Ang laki ng stack ay dapat na hindi bababa sa 256" @@ -1412,6 +1428,19 @@ msgstr "__init__() dapat magbalink na None, hindi '%s'" msgid "__new__ arg must be a user-type" msgstr "__new__ arg ay dapat na user-type" +#: extmod/modubinascii.c extmod/moduhashlib.c +msgid "a bytes-like object is required" +msgstr "a bytes-like object ay kailangan" + +#: lib/embed/abort_.c +msgid "abort() called" +msgstr "abort() tinawag" + +#: extmod/machine_mem.c +#, c-format +msgid "address %08x is not aligned to %d bytes" +msgstr "address %08x ay hindi pantay sa %d bytes" + #: shared-bindings/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "wala sa sakop ang address" @@ -1469,6 +1498,10 @@ msgstr "binary op %q hindi implemented" msgid "bits must be 7, 8 or 9" msgstr "bits ay dapat 7, 8 o 9" +#: extmod/machine_spi.c +msgid "bits must be 8" +msgstr "bits ay dapat walo (8)" + #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample ay dapat 8 o 16" @@ -1500,6 +1533,10 @@ msgstr "aarehas na haba dapat ang buffer slices" msgid "buffer too small" msgstr "masyadong maliit ang buffer" +#: extmod/machine_spi.c +msgid "buffers must be the same length" +msgstr "ang buffers ay dapat parehas sa haba" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1736,6 +1773,10 @@ msgstr "kumplikadong dibisyon sa pamamagitan ng zero" msgid "complex values not supported" msgstr "kumplikadong values hindi sinusuportahan" +#: extmod/moduzlib.c +msgid "compression header" +msgstr "compression header" + #: py/parse.c msgid "constant must be an integer" msgstr "constant ay dapat na integer" @@ -1782,6 +1823,10 @@ msgstr "dibisyon ng zero" msgid "empty" msgstr "walang laman" +#: extmod/moduheapq.c extmod/modutimeq.c +msgid "empty heap" +msgstr "walang laman ang heap" + #: py/objstr.c msgid "empty separator" msgstr "walang laman na separator" @@ -1853,6 +1898,10 @@ msgstr "ang filesystem dapat mag bigay ng mount method" msgid "first argument to super() must be type" msgstr "unang argument ng super() ay dapat type" +#: extmod/machine_spi.c +msgid "firstbit must be MSB" +msgstr "firstbit ay dapat MSB" + #: py/objint.c msgid "float too big" msgstr "masyadong malaki ang float" @@ -1922,6 +1971,10 @@ msgstr "hindi pinansin ng generator ang GeneratorExit" msgid "graphic must be 2048 bytes long" msgstr "graphic ay dapat 2048 bytes ang haba" +#: extmod/moduheapq.c +msgid "heap must be a list" +msgstr "list dapat ang heap" + #: py/compile.c msgid "identifier redefined as global" msgstr "identifier ginawang global" @@ -1938,6 +1991,10 @@ msgstr "hindi kumpleto ang format" msgid "incomplete format key" msgstr "hindi kumpleto ang format key" +#: extmod/modubinascii.c +msgid "incorrect padding" +msgstr "mali ang padding" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -1964,10 +2021,38 @@ msgstr "kailangan ng int" msgid "interval must be in range %s-%s" msgstr "" +#: extmod/machine_i2c.c +msgid "invalid I2C peripheral" +msgstr "maling I2C peripheral" + +#: extmod/machine_spi.c +msgid "invalid SPI peripheral" +msgstr "hindi wastong SPI peripheral" + +#: lib/netutils/netutils.c +msgid "invalid arguments" +msgstr "mali ang mga argumento" + +#: extmod/modussl_axtls.c +msgid "invalid cert" +msgstr "mali ang cert" + +#: extmod/uos_dupterm.c +msgid "invalid dupterm index" +msgstr "mali ang dupterm index" + +#: extmod/modframebuf.c +msgid "invalid format" +msgstr "hindi wastong pag-format" + #: py/objstr.c msgid "invalid format specifier" msgstr "mali ang format specifier" +#: extmod/modussl_axtls.c +msgid "invalid key" +msgstr "mali ang key" + #: py/compile.c msgid "invalid micropython decorator" msgstr "mali ang micropython decorator" @@ -2100,6 +2185,10 @@ msgstr "maraming inhertance hindi sinusuportahan" msgid "must raise an object" msgstr "dapat itaas ang isang object" +#: extmod/machine_spi.c +msgid "must specify all of sck/mosi/miso" +msgstr "dapat tukuyin lahat ng SCK/MOSI/MISO" + #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "dapat gumamit ng keyword argument para sa key function" @@ -2166,6 +2255,10 @@ msgstr "" msgid "non-default argument follows default argument" msgstr "non-default argument sumusunod sa default argument" +#: extmod/modubinascii.c +msgid "non-hex digit found" +msgstr "non-hex digit nahanap" + #: py/compile.c msgid "non-keyword arg after */**" msgstr "non-keyword arg sa huli ng */**" @@ -2232,6 +2325,10 @@ msgstr "object na type '%s' walang len()" msgid "object with buffer protocol required" msgstr "object na may buffer protocol kinakailangan" +#: extmod/modubinascii.c +msgid "odd-length string" +msgstr "odd-length string" + #: py/objstr.c py/objstrunicode.c #, fuzzy msgid "offset out of bounds" @@ -2321,6 +2418,10 @@ msgstr "pow() 3rd argument ay hindi maaring 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() na may 3 argumento kailangan ng integers" +#: extmod/modutimeq.c +msgid "queue overflow" +msgstr "puno na ang pila (overflow)" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "" @@ -2437,6 +2538,18 @@ msgstr "ang indeks ng string ay dapat na integer, hindi %s" msgid "string not supported; use bytes or bytearray" msgstr "string hindi supportado; gumamit ng bytes o kaya bytearray" +#: extmod/moductypes.c +msgid "struct: cannot index" +msgstr "struct: hindi ma-index" + +#: extmod/moductypes.c +msgid "struct: index out of range" +msgstr "struct: index hindi maabot" + +#: extmod/moductypes.c +msgid "struct: no fields" +msgstr "struct: walang fields" + #: py/objstr.c msgid "substring not found" msgstr "substring hindi nahanap" @@ -2445,6 +2558,14 @@ msgstr "substring hindi nahanap" msgid "super() can't find self" msgstr "super() hindi mahanap ang sarili" +#: extmod/modujson.c +msgid "syntax error in JSON" +msgstr "sintaks error sa JSON" + +#: extmod/moductypes.c +msgid "syntax error in uctypes descriptor" +msgstr "may pagkakamali sa sintaks sa uctypes descriptor" + #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" msgstr "ang threshold ay dapat sa range 0-65536" @@ -2676,9 +2797,6 @@ msgstr "zero step" #~ msgid "Cannot set STA config" #~ msgstr "Hindi ma-set ang STA Config" -#~ msgid "Cannot unambiguously get sizeof scalar" -#~ msgstr "Hindi puedeng hindi sigurado ang get sizeof scalar" - #~ msgid "Cannot update i/f status" #~ msgstr "Hindi ma-update i/f status" @@ -2698,9 +2816,6 @@ msgstr "zero step" #~ msgid "Error in ffi_prep_cif" #~ msgstr "Pagkakamali sa ffi_prep_cif" -#~ msgid "Error in regex" -#~ msgstr "May pagkakamali sa REGEX" - #, fuzzy #~ msgid "Failed to acquire mutex" #~ msgstr "Nabigo sa pag kuha ng mutex, status: 0x%08lX" @@ -2775,9 +2890,6 @@ msgstr "zero step" #~ msgid "GPIO16 does not support pull up." #~ msgstr "Walang pull down support ang GPI016." -#~ msgid "I2C operation not supported" -#~ msgstr "Hindi supportado ang operasyong I2C" - #~ msgid "Invalid bit clock pin" #~ msgstr "Mali ang bit clock pin" @@ -2834,9 +2946,6 @@ msgstr "zero step" #~ msgid "STA required" #~ msgstr "STA kailangan" -#~ msgid "Splitting with sub-captures" -#~ msgstr "Binibiyak gamit ang sub-captures" - #~ msgid "UART(%d) does not exist" #~ msgstr "Walang UART(%d)" @@ -2859,24 +2968,9 @@ msgstr "zero step" #~ msgid "[addrinfo error %d]" #~ msgstr "[addrinfo error %d]" -#~ msgid "a bytes-like object is required" -#~ msgstr "a bytes-like object ay kailangan" - -#~ msgid "abort() called" -#~ msgstr "abort() tinawag" - -#~ msgid "address %08x is not aligned to %d bytes" -#~ msgstr "address %08x ay hindi pantay sa %d bytes" - -#~ msgid "bits must be 8" -#~ msgstr "bits ay dapat walo (8)" - #~ msgid "buffer too long" #~ msgstr "masyadong mahaba ng buffer" -#~ msgid "buffers must be the same length" -#~ msgstr "ang buffers ay dapat parehas sa haba" - #~ msgid "can query only one param" #~ msgstr "maaaring i-query lamang ang isang param" @@ -2892,15 +2986,9 @@ msgstr "zero step" #~ msgid "can't set STA config" #~ msgstr "hindi makuha ang STA config" -#~ msgid "compression header" -#~ msgstr "compression header" - #~ msgid "either pos or kw args are allowed" #~ msgstr "pos o kw args ang pinahihintulutan" -#~ msgid "empty heap" -#~ msgstr "walang laman ang heap" - #~ msgid "expected a DigitalInOut" #~ msgstr "umasa ng DigitalInOut" @@ -2910,54 +2998,24 @@ msgstr "zero step" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" -#~ msgid "firstbit must be MSB" -#~ msgstr "firstbit ay dapat MSB" - #~ msgid "flash location must be below 1MByte" #~ msgstr "dapat na mas mababa sa 1MB ang lokasyon ng flash" #~ msgid "frequency can only be either 80Mhz or 160MHz" #~ msgstr "ang frequency ay dapat 80Mhz or 160MHz lamang" -#~ msgid "heap must be a list" -#~ msgstr "list dapat ang heap" - #~ msgid "impossible baudrate" #~ msgstr "impossibleng baudrate" -#~ msgid "incorrect padding" -#~ msgstr "mali ang padding" - -#~ msgid "invalid I2C peripheral" -#~ msgstr "maling I2C peripheral" - -#~ msgid "invalid SPI peripheral" -#~ msgstr "hindi wastong SPI peripheral" - #~ msgid "invalid alarm" #~ msgstr "mali ang alarm" -#~ msgid "invalid arguments" -#~ msgstr "mali ang mga argumento" - #~ msgid "invalid buffer length" #~ msgstr "mali ang buffer length" -#~ msgid "invalid cert" -#~ msgstr "mali ang cert" - #~ msgid "invalid data bits" #~ msgstr "mali ang data bits" -#~ msgid "invalid dupterm index" -#~ msgstr "mali ang dupterm index" - -#~ msgid "invalid format" -#~ msgstr "hindi wastong pag-format" - -#~ msgid "invalid key" -#~ msgstr "mali ang key" - #~ msgid "invalid pin" #~ msgstr "mali ang pin" @@ -2971,52 +3029,25 @@ msgstr "zero step" #~ msgstr "" #~ "nabigo ang paglalaan ng memorya, naglalaan ng %u bytes para sa native code" -#~ msgid "must specify all of sck/mosi/miso" -#~ msgstr "dapat tukuyin lahat ng SCK/MOSI/MISO" - #, fuzzy #~ msgid "name must be a string" #~ msgstr "ang keywords dapat strings" -#~ msgid "non-hex digit found" -#~ msgstr "non-hex digit nahanap" - #~ msgid "not a valid ADC Channel: %d" #~ msgstr "hindi tamang ADC Channel: %d" -#~ msgid "odd-length string" -#~ msgstr "odd-length string" - #~ msgid "pin does not have IRQ capabilities" #~ msgstr "walang IRQ capabilities ang pin" #~ msgid "position must be 2-tuple" #~ msgstr "position ay dapat 2-tuple" -#~ msgid "queue overflow" -#~ msgstr "puno na ang pila (overflow)" - #~ msgid "row must be packed and word aligned" #~ msgstr "row ay dapat packed at ang word nakahanay" #~ msgid "scan failed" #~ msgstr "nabigo ang pag-scan" -#~ msgid "struct: cannot index" -#~ msgstr "struct: hindi ma-index" - -#~ msgid "struct: index out of range" -#~ msgstr "struct: index hindi maabot" - -#~ msgid "struct: no fields" -#~ msgstr "struct: walang fields" - -#~ msgid "syntax error in JSON" -#~ msgstr "sintaks error sa JSON" - -#~ msgid "syntax error in uctypes descriptor" -#~ msgstr "may pagkakamali sa sintaks sa uctypes descriptor" - #~ msgid "too many arguments" #~ msgstr "masyadong maraming argumento" diff --git a/locale/fr.po b/locale/fr.po index 6f82b8f9d4..bad559397f 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:11-0600\n" +"POT-Creation-Date: 2019-11-17 20:54-0600\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -442,6 +442,10 @@ msgstr "On ne peut faire de sous-classes de tranches" msgid "Cannot transfer without MOSI and MISO pins." msgstr "Pas de transfert sans broches MOSI et MISO." +#: extmod/moductypes.c +msgid "Cannot unambiguously get sizeof scalar" +msgstr "Impossible d'obtenir la taille du scalaire sans ambigüité" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Impossible d'écrire sans broche MOSI." @@ -555,6 +559,10 @@ msgstr "Le mode Drive n'est pas utilisé quand la direction est 'input'." msgid "EXTINT channel already in use" msgstr "Canal EXTINT déjà utilisé" +#: extmod/modure.c +msgid "Error in regex" +msgstr "Erreur dans l'expression régulière" + #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c @@ -762,10 +770,14 @@ msgstr "" msgid "Group full" msgstr "Groupe plein" -#: py/objstringio.c +#: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "opération d'E/S sur un fichier fermé" +#: extmod/machine_i2c.c +msgid "I2C operation not supported" +msgstr "opération sur I2C non supportée" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1125,7 +1137,7 @@ msgstr "adresse hors limites" msgid "Read-only" msgstr "Lecture seule" -#: py/moduerrno.c +#: extmod/vfs_fat.c py/moduerrno.c msgid "Read-only filesystem" msgstr "Système de fichier en lecture seule" @@ -1187,6 +1199,10 @@ msgstr "Tranche et valeur de tailles différentes" msgid "Slices not supported" msgstr "Tranches non supportées" +#: extmod/modure.c +msgid "Splitting with sub-captures" +msgstr "Fractionnement avec des sous-captures" + #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "La pile doit être au moins de 256" @@ -1436,6 +1452,19 @@ msgstr "__init__() doit retourner None, pas '%s'" msgid "__new__ arg must be a user-type" msgstr "l'argument __new__ doit être d'un type défini par l'utilisateur" +#: extmod/modubinascii.c extmod/moduhashlib.c +msgid "a bytes-like object is required" +msgstr "un objet 'bytes-like' est requis" + +#: lib/embed/abort_.c +msgid "abort() called" +msgstr "abort() appelé" + +#: extmod/machine_mem.c +#, c-format +msgid "address %08x is not aligned to %d bytes" +msgstr "l'adresse %08x n'est pas alignée sur %d octets" + #: shared-bindings/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "adresse hors limites" @@ -1493,6 +1522,10 @@ msgstr "opération binaire '%q' non implémentée" msgid "bits must be 7, 8 or 9" msgstr "bits doivent être 7, 8 ou 9" +#: extmod/machine_spi.c +msgid "bits must be 8" +msgstr "les bits doivent être 8" + #: shared-bindings/audiomixer/Mixer.c #, fuzzy msgid "bits_per_sample must be 8 or 16" @@ -1526,6 +1559,10 @@ msgstr "les tranches de tampon doivent être de longueurs égales" msgid "buffer too small" msgstr "tampon trop petit" +#: extmod/machine_spi.c +msgid "buffers must be the same length" +msgstr "les tampons doivent être de la même longueur" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "les boutons doivent être des digitalio.DigitalInOut" @@ -1771,6 +1808,10 @@ msgstr "division complexe par zéro" msgid "complex values not supported" msgstr "valeurs complexes non supportées" +#: extmod/moduzlib.c +msgid "compression header" +msgstr "entête de compression" + #: py/parse.c msgid "constant must be an integer" msgstr "constante doit être un entier" @@ -1815,6 +1856,10 @@ msgstr "division par zéro" msgid "empty" msgstr "vide" +#: extmod/moduheapq.c extmod/modutimeq.c +msgid "empty heap" +msgstr "tas vide" + #: py/objstr.c msgid "empty separator" msgstr "séparateur vide" @@ -1886,6 +1931,10 @@ msgstr "le system de fichier doit fournir une méthode 'mount'" msgid "first argument to super() must be type" msgstr "le premier argument de super() doit être un type" +#: extmod/machine_spi.c +msgid "firstbit must be MSB" +msgstr "le 1er bit doit être le MSB" + #: py/objint.c msgid "float too big" msgstr "nombre à virgule flottante trop grand" @@ -1954,6 +2003,10 @@ msgstr "le générateur a ignoré GeneratorExit" msgid "graphic must be 2048 bytes long" msgstr "graphic doit être long de 2048 octets" +#: extmod/moduheapq.c +msgid "heap must be a list" +msgstr "le tas doit être une liste" + #: py/compile.c msgid "identifier redefined as global" msgstr "identifiant redéfini comme global" @@ -1970,6 +2023,10 @@ msgstr "format incomplet" msgid "incomplete format key" msgstr "clé de format incomplète" +#: extmod/modubinascii.c +msgid "incorrect padding" +msgstr "espacement incorrect" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -1996,10 +2053,38 @@ msgstr "entier requis" msgid "interval must be in range %s-%s" msgstr "" +#: extmod/machine_i2c.c +msgid "invalid I2C peripheral" +msgstr "périphérique I2C invalide" + +#: extmod/machine_spi.c +msgid "invalid SPI peripheral" +msgstr "périphérique SPI invalide" + +#: lib/netutils/netutils.c +msgid "invalid arguments" +msgstr "arguments invalides" + +#: extmod/modussl_axtls.c +msgid "invalid cert" +msgstr "certificat invalide" + +#: extmod/uos_dupterm.c +msgid "invalid dupterm index" +msgstr "index invalide pour dupterm" + +#: extmod/modframebuf.c +msgid "invalid format" +msgstr "format invalide" + #: py/objstr.c msgid "invalid format specifier" msgstr "spécification de format invalide" +#: extmod/modussl_axtls.c +msgid "invalid key" +msgstr "clé invalide" + #: py/compile.c msgid "invalid micropython decorator" msgstr "décorateur micropython invalide" @@ -2132,6 +2217,10 @@ msgstr "héritages multiples non supportés" msgid "must raise an object" msgstr "doit lever un objet" +#: extmod/machine_spi.c +msgid "must specify all of sck/mosi/miso" +msgstr "sck, mosi et miso doivent tous être spécifiés" + #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "doit utiliser un argument nommé pour une fonction key" @@ -2200,6 +2289,10 @@ msgid "non-default argument follows default argument" msgstr "" "un argument sans valeur par défaut suit un argument avec valeur par défaut" +#: extmod/modubinascii.c +msgid "non-hex digit found" +msgstr "chiffre non-héxadécimale trouvé" + #: py/compile.c msgid "non-keyword arg after */**" msgstr "argument non-nommé après */**" @@ -2267,6 +2360,10 @@ msgstr "l'objet de type '%s' n'a pas de len()" msgid "object with buffer protocol required" msgstr "un objet avec un protocole de tampon est nécessaire" +#: extmod/modubinascii.c +msgid "odd-length string" +msgstr "chaîne de longueur impaire" + #: py/objstr.c py/objstrunicode.c #, fuzzy msgid "offset out of bounds" @@ -2361,6 +2458,10 @@ msgstr "le 3e argument de pow() ne peut être 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() avec 3 arguments nécessite des entiers" +#: extmod/modutimeq.c +msgid "queue overflow" +msgstr "dépassement de file" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "'rawbuf' n'est pas de la même taille que 'buf'" @@ -2478,6 +2579,18 @@ msgid "string not supported; use bytes or bytearray" msgstr "" "chaîne de carac. non supportée; utilisez des bytes ou un tableau de bytes" +#: extmod/moductypes.c +msgid "struct: cannot index" +msgstr "struct: indexage impossible" + +#: extmod/moductypes.c +msgid "struct: index out of range" +msgstr "struct: index hors limites" + +#: extmod/moductypes.c +msgid "struct: no fields" +msgstr "struct: aucun champs" + #: py/objstr.c msgid "substring not found" msgstr "sous-chaîne non trouvée" @@ -2486,6 +2599,14 @@ msgstr "sous-chaîne non trouvée" msgid "super() can't find self" msgstr "super() ne peut pas trouver self" +#: extmod/modujson.c +msgid "syntax error in JSON" +msgstr "erreur de syntaxe JSON" + +#: extmod/moductypes.c +msgid "syntax error in uctypes descriptor" +msgstr "erreur de syntaxe dans le descripteur d'uctypes" + #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" msgstr "le seuil doit être dans la gamme 0-65536" @@ -2719,9 +2840,6 @@ msgstr "'step' nul" #~ msgid "Cannot set STA config" #~ msgstr "Impossible de configurer STA" -#~ msgid "Cannot unambiguously get sizeof scalar" -#~ msgstr "Impossible d'obtenir la taille du scalaire sans ambigüité" - #~ msgid "Cannot update i/f status" #~ msgstr "le status i/f ne peut être mis à jour" @@ -2746,9 +2864,6 @@ msgstr "'step' nul" #~ msgid "Error in ffi_prep_cif" #~ msgstr "Erreur dans ffi_prep_cif" -#~ msgid "Error in regex" -#~ msgstr "Erreur dans l'expression régulière" - #, fuzzy #~ msgid "Failed to acquire mutex" #~ msgstr "Echec de l'obtention de mutex" @@ -2823,9 +2938,6 @@ msgstr "'step' nul" #~ msgid "GPIO16 does not support pull up." #~ msgstr "Le GPIO16 ne supporte pas le tirage (pull-up)" -#~ msgid "I2C operation not supported" -#~ msgstr "opération sur I2C non supportée" - #~ msgid "Invalid bit clock pin" #~ msgstr "Broche invalide pour 'bit clock'" @@ -2894,9 +3006,6 @@ msgstr "'step' nul" #~ msgid "Soft device assert, id: 0x%08lX, pc: 0x%08lX" #~ msgstr "Assertion en mode 'soft-device', id: 0x%08lX, pc: 0x%08lX" -#~ msgid "Splitting with sub-captures" -#~ msgstr "Fractionnement avec des sous-captures" - #~ msgid "Tile indices must be 0 - 255" #~ msgstr "Les indices des tuiles doivent être compris entre 0 et 255 " @@ -2922,27 +3031,12 @@ msgstr "'step' nul" #~ msgid "Voice index too high" #~ msgstr "Index de la voix trop grand" -#~ msgid "a bytes-like object is required" -#~ msgstr "un objet 'bytes-like' est requis" - -#~ msgid "abort() called" -#~ msgstr "abort() appelé" - -#~ msgid "address %08x is not aligned to %d bytes" -#~ msgstr "l'adresse %08x n'est pas alignée sur %d octets" - #~ msgid "bad GATT role" #~ msgstr "mauvais rôle GATT" -#~ msgid "bits must be 8" -#~ msgstr "les bits doivent être 8" - #~ msgid "buffer too long" #~ msgstr "tampon trop long" -#~ msgid "buffers must be the same length" -#~ msgstr "les tampons doivent être de la même longueur" - #~ msgid "can query only one param" #~ msgstr "ne peut demander qu'un seul paramètre" @@ -2962,72 +3056,36 @@ msgstr "'step' nul" #~ msgstr "" #~ "'characteristics' inclut un objet qui n'est pas une 'Characteristic'" -#~ msgid "compression header" -#~ msgstr "entête de compression" - #~ msgid "either pos or kw args are allowed" #~ msgstr "soit 'pos', soit 'kw' est permis en argument" -#~ msgid "empty heap" -#~ msgstr "tas vide" - #~ msgid "expected a DigitalInOut" #~ msgstr "objet DigitalInOut attendu" #~ msgid "expecting a pin" #~ msgstr "une broche (Pin) est attendue" -#~ msgid "firstbit must be MSB" -#~ msgstr "le 1er bit doit être le MSB" - #~ msgid "flash location must be below 1MByte" #~ msgstr "l'emplacement en mémoire flash doit être inférieur à 1Mo" #~ msgid "frequency can only be either 80Mhz or 160MHz" #~ msgstr "la fréquence doit être soit 80MHz soit 160MHz" -#~ msgid "heap must be a list" -#~ msgstr "le tas doit être une liste" - #~ msgid "impossible baudrate" #~ msgstr "débit impossible" -#~ msgid "incorrect padding" -#~ msgstr "espacement incorrect" - #~ msgid "interval not in range 0.0020 to 10.24" #~ msgstr "intervalle hors bornes 0.0020 à 10.24" -#~ msgid "invalid I2C peripheral" -#~ msgstr "périphérique I2C invalide" - -#~ msgid "invalid SPI peripheral" -#~ msgstr "périphérique SPI invalide" - #~ msgid "invalid alarm" #~ msgstr "alarme invalide" -#~ msgid "invalid arguments" -#~ msgstr "arguments invalides" - #~ msgid "invalid buffer length" #~ msgstr "longueur de tampon invalide" -#~ msgid "invalid cert" -#~ msgstr "certificat invalide" - #~ msgid "invalid data bits" #~ msgstr "bits de données invalides" -#~ msgid "invalid dupterm index" -#~ msgstr "index invalide pour dupterm" - -#~ msgid "invalid format" -#~ msgstr "format invalide" - -#~ msgid "invalid key" -#~ msgstr "clé invalide" - #~ msgid "invalid pin" #~ msgstr "broche invalide" @@ -3041,22 +3099,13 @@ msgstr "'step' nul" #~ msgstr "" #~ "l'allocation de mémoire a échoué en allouant %u octets pour un code natif" -#~ msgid "must specify all of sck/mosi/miso" -#~ msgstr "sck, mosi et miso doivent tous être spécifiés" - #, fuzzy #~ msgid "name must be a string" #~ msgstr "les noms doivent être des chaînes de caractère" -#~ msgid "non-hex digit found" -#~ msgstr "chiffre non-héxadécimale trouvé" - #~ msgid "not a valid ADC Channel: %d" #~ msgstr "canal ADC non valide : %d" -#~ msgid "odd-length string" -#~ msgstr "chaîne de longueur impaire" - #~ msgid "pin does not have IRQ capabilities" #~ msgstr "la broche ne supporte pas les interruptions (IRQ)" @@ -3064,30 +3113,12 @@ msgstr "'step' nul" #~ msgid "position must be 2-tuple" #~ msgstr "position doit être un 2-tuple" -#~ msgid "queue overflow" -#~ msgstr "dépassement de file" - #~ msgid "scan failed" #~ msgstr "échec du scan" #~ msgid "services includes an object that is not a Service" #~ msgstr "'services' inclut un object qui n'est pas un 'Service'" -#~ msgid "struct: cannot index" -#~ msgstr "struct: indexage impossible" - -#~ msgid "struct: index out of range" -#~ msgstr "struct: index hors limites" - -#~ msgid "struct: no fields" -#~ msgstr "struct: aucun champs" - -#~ msgid "syntax error in JSON" -#~ msgstr "erreur de syntaxe JSON" - -#~ msgid "syntax error in uctypes descriptor" -#~ msgstr "erreur de syntaxe dans le descripteur d'uctypes" - #~ msgid "tile index out of bounds" #~ msgstr "indice de tuile hors limites" diff --git a/locale/it_IT.po b/locale/it_IT.po index f7b7b3a528..c280b0e87a 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:11-0600\n" +"POT-Creation-Date: 2019-11-17 20:54-0600\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -437,6 +437,10 @@ msgstr "Impossibile subclasare slice" msgid "Cannot transfer without MOSI and MISO pins." msgstr "Impossibile trasferire senza i pin MOSI e MISO." +#: extmod/moductypes.c +msgid "Cannot unambiguously get sizeof scalar" +msgstr "Impossibile ricavare la grandezza scalare di sizeof inequivocabilmente" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Impossibile scrivere senza pin MOSI." @@ -551,6 +555,10 @@ msgstr "" msgid "EXTINT channel already in use" msgstr "Canale EXTINT già in uso" +#: extmod/modure.c +msgid "Error in regex" +msgstr "Errore nella regex" + #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c @@ -756,10 +764,14 @@ msgstr "" msgid "Group full" msgstr "Gruppo pieno" -#: py/objstringio.c +#: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "operazione I/O su file chiuso" +#: extmod/machine_i2c.c +msgid "I2C operation not supported" +msgstr "operazione I2C non supportata" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1114,7 +1126,7 @@ msgstr "indirizzo fuori limite" msgid "Read-only" msgstr "Sola lettura" -#: py/moduerrno.c +#: extmod/vfs_fat.c py/moduerrno.c msgid "Read-only filesystem" msgstr "Filesystem in sola lettura" @@ -1177,6 +1189,10 @@ msgstr "" msgid "Slices not supported" msgstr "Slice non supportate" +#: extmod/modure.c +msgid "Splitting with sub-captures" +msgstr "Suddivisione con sotto-catture" + #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "La dimensione dello stack deve essere almeno 256" @@ -1406,6 +1422,19 @@ msgstr "__init__() deve ritornare None, non '%s'" msgid "__new__ arg must be a user-type" msgstr "" +#: extmod/modubinascii.c extmod/moduhashlib.c +msgid "a bytes-like object is required" +msgstr "un oggetto byte-like è richiesto" + +#: lib/embed/abort_.c +msgid "abort() called" +msgstr "abort() chiamato" + +#: extmod/machine_mem.c +#, c-format +msgid "address %08x is not aligned to %d bytes" +msgstr "l'indirizzo %08x non è allineato a %d bytes" + #: shared-bindings/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "indirizzo fuori limite" @@ -1463,6 +1492,10 @@ msgstr "operazione binaria %q non implementata" msgid "bits must be 7, 8 or 9" msgstr "i bit devono essere 7, 8 o 9" +#: extmod/machine_spi.c +msgid "bits must be 8" +msgstr "i bit devono essere 8" + #: shared-bindings/audiomixer/Mixer.c #, fuzzy msgid "bits_per_sample must be 8 or 16" @@ -1496,6 +1529,10 @@ msgstr "slice del buffer devono essere della stessa lunghezza" msgid "buffer too small" msgstr "buffer troppo piccolo" +#: extmod/machine_spi.c +msgid "buffers must be the same length" +msgstr "i buffer devono essere della stessa lunghezza" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1729,6 +1766,10 @@ msgstr "complex divisione per zero" msgid "complex values not supported" msgstr "valori complessi non supportai" +#: extmod/moduzlib.c +msgid "compression header" +msgstr "compressione dell'header" + #: py/parse.c msgid "constant must be an integer" msgstr "la costante deve essere un intero" @@ -1774,6 +1815,10 @@ msgstr "divisione per zero" msgid "empty" msgstr "vuoto" +#: extmod/moduheapq.c extmod/modutimeq.c +msgid "empty heap" +msgstr "heap vuoto" + #: py/objstr.c msgid "empty separator" msgstr "separatore vuoto" @@ -1845,6 +1890,10 @@ msgstr "il filesystem deve fornire un metodo di mount" msgid "first argument to super() must be type" msgstr "" +#: extmod/machine_spi.c +msgid "firstbit must be MSB" +msgstr "il primo bit deve essere il più significativo (MSB)" + #: py/objint.c msgid "float too big" msgstr "float troppo grande" @@ -1914,6 +1963,10 @@ msgstr "" msgid "graphic must be 2048 bytes long" msgstr "graphic deve essere lunga 2048 byte" +#: extmod/moduheapq.c +msgid "heap must be a list" +msgstr "l'heap deve essere una lista" + #: py/compile.c msgid "identifier redefined as global" msgstr "identificatore ridefinito come globale" @@ -1930,6 +1983,10 @@ msgstr "formato incompleto" msgid "incomplete format key" msgstr "" +#: extmod/modubinascii.c +msgid "incorrect padding" +msgstr "padding incorretto" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -1956,10 +2013,38 @@ msgstr "intero richiesto" msgid "interval must be in range %s-%s" msgstr "" +#: extmod/machine_i2c.c +msgid "invalid I2C peripheral" +msgstr "periferica I2C invalida" + +#: extmod/machine_spi.c +msgid "invalid SPI peripheral" +msgstr "periferica SPI invalida" + +#: lib/netutils/netutils.c +msgid "invalid arguments" +msgstr "argomenti non validi" + +#: extmod/modussl_axtls.c +msgid "invalid cert" +msgstr "certificato non valido" + +#: extmod/uos_dupterm.c +msgid "invalid dupterm index" +msgstr "indice dupterm non valido" + +#: extmod/modframebuf.c +msgid "invalid format" +msgstr "formato non valido" + #: py/objstr.c msgid "invalid format specifier" msgstr "specificatore di formato non valido" +#: extmod/modussl_axtls.c +msgid "invalid key" +msgstr "chiave non valida" + #: py/compile.c msgid "invalid micropython decorator" msgstr "decoratore non valido in micropython" @@ -2093,6 +2178,10 @@ msgstr "ereditarietà multipla non supportata" msgid "must raise an object" msgstr "deve lanciare un oggetto" +#: extmod/machine_spi.c +msgid "must specify all of sck/mosi/miso" +msgstr "è necessario specificare tutte le sck/mosi/miso" + #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -2160,6 +2249,10 @@ msgstr "" msgid "non-default argument follows default argument" msgstr "argomento non predefinito segue argmoento predfinito" +#: extmod/modubinascii.c +msgid "non-hex digit found" +msgstr "trovata cifra non esadecimale" + #: py/compile.c msgid "non-keyword arg after */**" msgstr "argomento non nominato dopo */**" @@ -2228,6 +2321,10 @@ msgstr "l'oggetto di tipo '%s' non implementa len()" msgid "object with buffer protocol required" msgstr "" +#: extmod/modubinascii.c +msgid "odd-length string" +msgstr "stringa di lunghezza dispari" + #: py/objstr.c py/objstrunicode.c #, fuzzy msgid "offset out of bounds" @@ -2319,6 +2416,10 @@ msgstr "il terzo argomento di pow() non può essere 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() con 3 argomenti richiede interi" +#: extmod/modutimeq.c +msgid "queue overflow" +msgstr "overflow della coda" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "" @@ -2435,6 +2536,18 @@ msgstr "indici della stringa devono essere interi, non %s" msgid "string not supported; use bytes or bytearray" msgstr "" +#: extmod/moductypes.c +msgid "struct: cannot index" +msgstr "struct: impossibile indicizzare" + +#: extmod/moductypes.c +msgid "struct: index out of range" +msgstr "struct: indice fuori intervallo" + +#: extmod/moductypes.c +msgid "struct: no fields" +msgstr "struct: nessun campo" + #: py/objstr.c msgid "substring not found" msgstr "sottostringa non trovata" @@ -2443,6 +2556,14 @@ msgstr "sottostringa non trovata" msgid "super() can't find self" msgstr "" +#: extmod/modujson.c +msgid "syntax error in JSON" +msgstr "errore di sintassi nel JSON" + +#: extmod/moductypes.c +msgid "syntax error in uctypes descriptor" +msgstr "errore di sintassi nel descrittore uctypes" + #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" msgstr "la soglia deve essere nell'intervallo 0-65536" @@ -2674,10 +2795,6 @@ msgstr "zero step" #~ msgid "Cannot set STA config" #~ msgstr "Impossibile impostare la configurazione della STA" -#~ msgid "Cannot unambiguously get sizeof scalar" -#~ msgstr "" -#~ "Impossibile ricavare la grandezza scalare di sizeof inequivocabilmente" - #~ msgid "Cannot update i/f status" #~ msgstr "Impossibile aggiornare status di i/f" @@ -2703,9 +2820,6 @@ msgstr "zero step" #~ msgid "Error in ffi_prep_cif" #~ msgstr "Errore in ffi_prep_cif" -#~ msgid "Error in regex" -#~ msgstr "Errore nella regex" - #, fuzzy #~ msgid "Failed to acquire mutex" #~ msgstr "Impossibile allocare buffer RX" @@ -2777,9 +2891,6 @@ msgstr "zero step" #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 non supporta pull-up" -#~ msgid "I2C operation not supported" -#~ msgstr "operazione I2C non supportata" - #~ msgid "Invalid bit clock pin" #~ msgstr "Pin del clock di bit non valido" @@ -2837,9 +2948,6 @@ msgstr "zero step" #~ msgid "STA required" #~ msgstr "STA richiesta" -#~ msgid "Splitting with sub-captures" -#~ msgstr "Suddivisione con sotto-catture" - #~ msgid "UART(%d) does not exist" #~ msgstr "UART(%d) non esistente" @@ -2858,24 +2966,9 @@ msgstr "zero step" #~ msgid "[addrinfo error %d]" #~ msgstr "[errore addrinfo %d]" -#~ msgid "a bytes-like object is required" -#~ msgstr "un oggetto byte-like è richiesto" - -#~ msgid "abort() called" -#~ msgstr "abort() chiamato" - -#~ msgid "address %08x is not aligned to %d bytes" -#~ msgstr "l'indirizzo %08x non è allineato a %d bytes" - -#~ msgid "bits must be 8" -#~ msgstr "i bit devono essere 8" - #~ msgid "buffer too long" #~ msgstr "buffer troppo lungo" -#~ msgid "buffers must be the same length" -#~ msgstr "i buffer devono essere della stessa lunghezza" - #~ msgid "can query only one param" #~ msgstr "è possibile interrogare solo un parametro" @@ -2891,15 +2984,9 @@ msgstr "zero step" #~ msgid "can't set STA config" #~ msgstr "impossibile impostare le configurazioni della STA" -#~ msgid "compression header" -#~ msgstr "compressione dell'header" - #~ msgid "either pos or kw args are allowed" #~ msgstr "sono permesse solo gli argomenti pos o kw" -#~ msgid "empty heap" -#~ msgstr "heap vuoto" - #~ msgid "expected a DigitalInOut" #~ msgstr "DigitalInOut atteso" @@ -2909,54 +2996,24 @@ msgstr "zero step" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" -#~ msgid "firstbit must be MSB" -#~ msgstr "il primo bit deve essere il più significativo (MSB)" - #~ msgid "flash location must be below 1MByte" #~ msgstr "Locazione della flash deve essere inferiore a 1mb" #~ msgid "frequency can only be either 80Mhz or 160MHz" #~ msgstr "la frequenza può essere o 80Mhz o 160Mhz" -#~ msgid "heap must be a list" -#~ msgstr "l'heap deve essere una lista" - #~ msgid "impossible baudrate" #~ msgstr "baudrate impossibile" -#~ msgid "incorrect padding" -#~ msgstr "padding incorretto" - -#~ msgid "invalid I2C peripheral" -#~ msgstr "periferica I2C invalida" - -#~ msgid "invalid SPI peripheral" -#~ msgstr "periferica SPI invalida" - #~ msgid "invalid alarm" #~ msgstr "alarm non valido" -#~ msgid "invalid arguments" -#~ msgstr "argomenti non validi" - #~ msgid "invalid buffer length" #~ msgstr "lunghezza del buffer non valida" -#~ msgid "invalid cert" -#~ msgstr "certificato non valido" - #~ msgid "invalid data bits" #~ msgstr "bit dati invalidi" -#~ msgid "invalid dupterm index" -#~ msgstr "indice dupterm non valido" - -#~ msgid "invalid format" -#~ msgstr "formato non valido" - -#~ msgid "invalid key" -#~ msgstr "chiave non valida" - #~ msgid "invalid pin" #~ msgstr "pin non valido" @@ -2970,52 +3027,25 @@ msgstr "zero step" #~ msgstr "" #~ "allocazione di memoria fallita, allocazione di %d byte per codice nativo" -#~ msgid "must specify all of sck/mosi/miso" -#~ msgstr "è necessario specificare tutte le sck/mosi/miso" - #, fuzzy #~ msgid "name must be a string" #~ msgstr "argomenti nominati devono essere stringhe" -#~ msgid "non-hex digit found" -#~ msgstr "trovata cifra non esadecimale" - #~ msgid "not a valid ADC Channel: %d" #~ msgstr "canale ADC non valido: %d" -#~ msgid "odd-length string" -#~ msgstr "stringa di lunghezza dispari" - #~ msgid "pin does not have IRQ capabilities" #~ msgstr "il pin non implementa IRQ" #~ msgid "position must be 2-tuple" #~ msgstr "position deve essere una 2-tuple" -#~ msgid "queue overflow" -#~ msgstr "overflow della coda" - #~ msgid "row must be packed and word aligned" #~ msgstr "la riga deve essere compattata e allineata alla parola" #~ msgid "scan failed" #~ msgstr "scansione fallita" -#~ msgid "struct: cannot index" -#~ msgstr "struct: impossibile indicizzare" - -#~ msgid "struct: index out of range" -#~ msgstr "struct: indice fuori intervallo" - -#~ msgid "struct: no fields" -#~ msgstr "struct: nessun campo" - -#~ msgid "syntax error in JSON" -#~ msgstr "errore di sintassi nel JSON" - -#~ msgid "syntax error in uctypes descriptor" -#~ msgstr "errore di sintassi nel descrittore uctypes" - #~ msgid "too many arguments" #~ msgstr "troppi argomenti" diff --git a/locale/ko.po b/locale/ko.po index 2c785e2902..fa67fda828 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:11-0600\n" +"POT-Creation-Date: 2019-11-17 20:54-0600\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -432,6 +432,10 @@ msgstr "" msgid "Cannot transfer without MOSI and MISO pins." msgstr "" +#: extmod/moductypes.c +msgid "Cannot unambiguously get sizeof scalar" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "" @@ -543,6 +547,10 @@ msgstr "" msgid "EXTINT channel already in use" msgstr "" +#: extmod/modure.c +msgid "Error in regex" +msgstr "Regex에 오류가 있습니다." + #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c @@ -744,10 +752,14 @@ msgstr "" msgid "Group full" msgstr "" -#: py/objstringio.c +#: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "" +#: extmod/machine_i2c.c +msgid "I2C operation not supported" +msgstr "" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1083,7 +1095,7 @@ msgstr "" msgid "Read-only" msgstr "" -#: py/moduerrno.c +#: extmod/vfs_fat.c py/moduerrno.c msgid "Read-only filesystem" msgstr "" @@ -1143,6 +1155,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: extmod/modure.c +msgid "Splitting with sub-captures" +msgstr "" + #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "" @@ -1365,6 +1381,19 @@ msgstr "" msgid "__new__ arg must be a user-type" msgstr "" +#: extmod/modubinascii.c extmod/moduhashlib.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/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "" @@ -1422,6 +1451,10 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "비트(bits)는 7, 8 또는 9 여야합니다" +#: extmod/machine_spi.c +msgid "bits must be 8" +msgstr "비트(bits)는 8이어야합니다" + #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample은 8 또는 16이어야합니다." @@ -1452,6 +1485,10 @@ msgstr "" msgid "buffer too small" msgstr "" +#: extmod/machine_spi.c +msgid "buffers must be the same length" +msgstr "" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1682,6 +1719,10 @@ msgstr "" msgid "complex values not supported" msgstr "" +#: extmod/moduzlib.c +msgid "compression header" +msgstr "" + #: py/parse.c msgid "constant must be an integer" msgstr "" @@ -1724,6 +1765,10 @@ msgstr "" msgid "empty" msgstr "" +#: extmod/moduheapq.c extmod/modutimeq.c +msgid "empty heap" +msgstr "" + #: py/objstr.c msgid "empty separator" msgstr "" @@ -1794,6 +1839,10 @@ msgstr "" msgid "first argument to super() must be type" msgstr "" +#: extmod/machine_spi.c +msgid "firstbit must be MSB" +msgstr "" + #: py/objint.c msgid "float too big" msgstr "float이 너무 큽니다" @@ -1862,6 +1911,10 @@ msgstr "" 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 "" @@ -1878,6 +1931,10 @@ msgstr "" msgid "incomplete format key" msgstr "" +#: extmod/modubinascii.c +msgid "incorrect padding" +msgstr "" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -1904,10 +1961,38 @@ msgstr "정수가 필요합니다" msgid "interval must be in range %s-%s" msgstr "" +#: extmod/machine_i2c.c +msgid "invalid I2C peripheral" +msgstr "ICT주변 기기가 유효하지 않습니다" + +#: extmod/machine_spi.c +msgid "invalid SPI peripheral" +msgstr "SPI주변 기기가 유효하지 않습니다" + +#: lib/netutils/netutils.c +msgid "invalid arguments" +msgstr "" + +#: extmod/modussl_axtls.c +msgid "invalid cert" +msgstr "cert가 유효하지 않습니다" + +#: extmod/uos_dupterm.c +msgid "invalid dupterm index" +msgstr "Dupterm index가 유효하지 않습니다" + +#: extmod/modframebuf.c +msgid "invalid format" +msgstr "형식가 유효하지 않습니다" + #: py/objstr.c msgid "invalid format specifier" msgstr "형식 지정자(format specifier)가 유효하지 않습니다" +#: extmod/modussl_axtls.c +msgid "invalid key" +msgstr "키가 유효하지 않습니다" + #: py/compile.c msgid "invalid micropython decorator" msgstr "" @@ -2036,6 +2121,10 @@ msgstr "" msgid "must raise an object" msgstr "" +#: extmod/machine_spi.c +msgid "must specify all of sck/mosi/miso" +msgstr "" + #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -2102,6 +2191,10 @@ msgstr "" 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 "" @@ -2168,6 +2261,10 @@ msgstr "" msgid "object with buffer protocol required" msgstr "" +#: extmod/modubinascii.c +msgid "odd-length string" +msgstr "" + #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "" @@ -2255,6 +2352,10 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: extmod/modutimeq.c +msgid "queue overflow" +msgstr "" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "" @@ -2367,6 +2468,18 @@ msgstr "" msgid "string not supported; use bytes or bytearray" msgstr "" +#: extmod/moductypes.c +msgid "struct: cannot index" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: index out of range" +msgstr "" + +#: extmod/moductypes.c +msgid "struct: no fields" +msgstr "" + #: py/objstr.c msgid "substring not found" msgstr "" @@ -2375,6 +2488,14 @@ msgstr "" 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 "" @@ -2588,9 +2709,6 @@ msgstr "" #~ msgid "Data too large for the advertisement packet" #~ msgstr "광고 (브로드 캐스트) 패킷에 대한 데이터가 너무 큽니다" -#~ msgid "Error in regex" -#~ msgstr "Regex에 오류가 있습니다." - #~ msgid "Failed to add service" #~ msgstr "서비스를 추가하지 못했습니다" @@ -2605,24 +2723,3 @@ msgstr "" #~ msgid "Failed to continue scanning, err 0x%04x" #~ msgstr "스캔을 계속할 수 없습니다, 오류 0x%04x" - -#~ msgid "bits must be 8" -#~ msgstr "비트(bits)는 8이어야합니다" - -#~ msgid "invalid I2C peripheral" -#~ msgstr "ICT주변 기기가 유효하지 않습니다" - -#~ msgid "invalid SPI peripheral" -#~ msgstr "SPI주변 기기가 유효하지 않습니다" - -#~ msgid "invalid cert" -#~ msgstr "cert가 유효하지 않습니다" - -#~ msgid "invalid dupterm index" -#~ msgstr "Dupterm index가 유효하지 않습니다" - -#~ msgid "invalid format" -#~ msgstr "형식가 유효하지 않습니다" - -#~ msgid "invalid key" -#~ msgstr "키가 유효하지 않습니다" diff --git a/locale/pl.po b/locale/pl.po index e1a3ccfd9c..34381c08dd 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:11-0600\n" +"POT-Creation-Date: 2019-11-17 20:54-0600\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -431,6 +431,10 @@ msgstr "Nie można dziedziczyć ze slice" msgid "Cannot transfer without MOSI and MISO pins." msgstr "Nie można przesyłać bez nóżek MOSI i MISO." +#: extmod/moductypes.c +msgid "Cannot unambiguously get sizeof scalar" +msgstr "Wielkość skalara jest niejednoznaczna" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Nie można pisać bez nóżki MOSI." @@ -542,6 +546,10 @@ msgstr "Tryb sterowania nieużywany w trybie wejścia." msgid "EXTINT channel already in use" msgstr "Kanał EXTINT w użyciu" +#: extmod/modure.c +msgid "Error in regex" +msgstr "Błąd w regex" + #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c @@ -743,10 +751,14 @@ msgstr "" msgid "Group full" msgstr "Grupa pełna" -#: py/objstringio.c +#: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Operacja I/O na zamkniętym pliku" +#: extmod/machine_i2c.c +msgid "I2C operation not supported" +msgstr "Operacja I2C nieobsługiwana" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1089,7 +1101,7 @@ msgstr "Zakres poza granicami" msgid "Read-only" msgstr "Tylko do odczytu" -#: py/moduerrno.c +#: extmod/vfs_fat.c py/moduerrno.c msgid "Read-only filesystem" msgstr "System plików tylko do odczytu" @@ -1149,6 +1161,10 @@ msgstr "Fragment i wartość są różnych długości." msgid "Slices not supported" msgstr "Fragmenty nieobsługiwane" +#: extmod/modure.c +msgid "Splitting with sub-captures" +msgstr "Podział z podgrupami" + #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "Stos musi mieć co najmniej 256 bajtów" @@ -1384,6 +1400,19 @@ msgstr "__init__() powinien zwracać None, nie '%s'" msgid "__new__ arg must be a user-type" msgstr "Argument __new__ musi być typu użytkownika" +#: extmod/modubinascii.c extmod/moduhashlib.c +msgid "a bytes-like object is required" +msgstr "wymagany obiekt typu bytes" + +#: lib/embed/abort_.c +msgid "abort() called" +msgstr "Wywołano abort()" + +#: extmod/machine_mem.c +#, c-format +msgid "address %08x is not aligned to %d bytes" +msgstr "adres %08x nie jest wyrównany do %d bajtów" + #: shared-bindings/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "adres poza zakresem" @@ -1441,6 +1470,10 @@ msgstr "brak dwu-argumentowego operatora %q" msgid "bits must be 7, 8 or 9" msgstr "bits musi być 7, 8 lub 9" +#: extmod/machine_spi.c +msgid "bits must be 8" +msgstr "bits musi być 8" + #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample musi być 8 lub 16" @@ -1471,6 +1504,10 @@ msgstr "fragmenty bufora muszą mieć tę samą długość" msgid "buffer too small" msgstr "zbyt mały bufor" +#: extmod/machine_spi.c +msgid "buffers must be the same length" +msgstr "bufory muszą mieć tę samą długość" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "buttons musi być digitalio.DigitalInOut" @@ -1701,6 +1738,10 @@ msgstr "zespolone dzielenie przez zero" msgid "complex values not supported" msgstr "wartości zespolone nieobsługiwane" +#: extmod/moduzlib.c +msgid "compression header" +msgstr "nagłówek kompresji" + #: py/parse.c msgid "constant must be an integer" msgstr "stała musi być liczbą całkowitą" @@ -1744,6 +1785,10 @@ msgstr "dzielenie przez zero" msgid "empty" msgstr "puste" +#: extmod/moduheapq.c extmod/modutimeq.c +msgid "empty heap" +msgstr "pusta sterta" + #: py/objstr.c msgid "empty separator" msgstr "pusty separator" @@ -1814,6 +1859,10 @@ msgstr "system plików musi mieć metodę mount" msgid "first argument to super() must be type" msgstr "pierwszy argument super() musi być typem" +#: extmod/machine_spi.c +msgid "firstbit must be MSB" +msgstr "firstbit musi być MSB" + #: py/objint.c msgid "float too big" msgstr "float zbyt wielki" @@ -1882,6 +1931,10 @@ msgstr "generator zignorował GeneratorExit" msgid "graphic must be 2048 bytes long" msgstr "graphic musi mieć 2048 bajtów długości" +#: extmod/moduheapq.c +msgid "heap must be a list" +msgstr "heap musi być listą" + #: py/compile.c msgid "identifier redefined as global" msgstr "nazwa przedefiniowana jako globalna" @@ -1898,6 +1951,10 @@ msgstr "niepełny format" msgid "incomplete format key" msgstr "niepełny klucz formatu" +#: extmod/modubinascii.c +msgid "incorrect padding" +msgstr "złe wypełnienie" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -1924,10 +1981,38 @@ msgstr "wymagana liczba całkowita" msgid "interval must be in range %s-%s" msgstr "" +#: extmod/machine_i2c.c +msgid "invalid I2C peripheral" +msgstr "złe I2C" + +#: extmod/machine_spi.c +msgid "invalid SPI peripheral" +msgstr "złe SPI" + +#: lib/netutils/netutils.c +msgid "invalid arguments" +msgstr "złe arguemnty" + +#: extmod/modussl_axtls.c +msgid "invalid cert" +msgstr "zły ceryfikat" + +#: extmod/uos_dupterm.c +msgid "invalid dupterm index" +msgstr "zły indeks dupterm" + +#: extmod/modframebuf.c +msgid "invalid format" +msgstr "zły format" + #: py/objstr.c msgid "invalid format specifier" msgstr "zła specyfikacja formatu" +#: extmod/modussl_axtls.c +msgid "invalid key" +msgstr "zły klucz" + #: py/compile.c msgid "invalid micropython decorator" msgstr "zły dekorator micropythona" @@ -2056,6 +2141,10 @@ msgstr "wielokrotne dziedzicznie niewspierane" msgid "must raise an object" msgstr "wyjątek musi być obiektem" +#: extmod/machine_spi.c +msgid "must specify all of sck/mosi/miso" +msgstr "sck/mosi/miso muszą być podane" + #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "funkcja key musi być podana jako argument nazwany" @@ -2122,6 +2211,10 @@ msgstr "" msgid "non-default argument follows default argument" msgstr "argument z wartością domyślną przed argumentem bez" +#: extmod/modubinascii.c +msgid "non-hex digit found" +msgstr "cyfra nieszesnastkowa" + #: py/compile.c msgid "non-keyword arg after */**" msgstr "argument nienazwany po */**" @@ -2188,6 +2281,10 @@ msgstr "obiekt typu '%s' nie ma len()" msgid "object with buffer protocol required" msgstr "wymagany obiekt z protokołem buforu" +#: extmod/modubinascii.c +msgid "odd-length string" +msgstr "łańcuch o nieparzystej długości" + #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "offset poza zakresem" @@ -2276,6 +2373,10 @@ msgstr "trzeci argument pow() nie może być 0" msgid "pow() with 3 arguments requires integers" msgstr "trzyargumentowe pow() wymaga liczb całkowitych" +#: extmod/modutimeq.c +msgid "queue overflow" +msgstr "przepełnienie kolejki" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "rawbuf nie jest tej samej wielkości co buf" @@ -2389,6 +2490,18 @@ msgstr "indeksy łańcucha muszą być całkowite, nie %s" msgid "string not supported; use bytes or bytearray" msgstr "łańcuchy nieobsługiwane; użyj bytes lub bytearray" +#: extmod/moductypes.c +msgid "struct: cannot index" +msgstr "struct: nie można indeksować" + +#: extmod/moductypes.c +msgid "struct: index out of range" +msgstr "struct: indeks poza zakresem" + +#: extmod/moductypes.c +msgid "struct: no fields" +msgstr "struct: brak pól" + #: py/objstr.c msgid "substring not found" msgstr "brak pod-łańcucha" @@ -2397,6 +2510,14 @@ msgstr "brak pod-łańcucha" msgid "super() can't find self" msgstr "super() nie może znaleźć self" +#: extmod/modujson.c +msgid "syntax error in JSON" +msgstr "błąd składni w JSON" + +#: extmod/moductypes.c +msgid "syntax error in uctypes descriptor" +msgstr "błąd składni w deskryptorze uctypes" + #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" msgstr "threshold musi być w zakresie 0-65536" @@ -2613,9 +2734,6 @@ msgstr "zerowy krok" #~ msgid "Can't connect in Peripheral mode" #~ msgstr "Nie można się łączyć w trybie Peripheral" -#~ msgid "Cannot unambiguously get sizeof scalar" -#~ msgstr "Wielkość skalara jest niejednoznaczna" - #~ msgid "Characteristic UUID doesn't match Service UUID" #~ msgstr "UUID charakterystyki inny niż UUID serwisu" @@ -2625,9 +2743,6 @@ msgstr "zerowy krok" #~ msgid "Data too large for the advertisement packet" #~ msgstr "Zbyt dużo danych pakietu rozgłoszeniowego" -#~ msgid "Error in regex" -#~ msgstr "Błąd w regex" - #~ msgid "Failed to acquire mutex" #~ msgstr "Nie udało się uzyskać blokady" @@ -2674,9 +2789,6 @@ msgstr "zerowy krok" #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Nie udało się zatrzymać rozgłaszania, błąd 0x%04x" -#~ msgid "I2C operation not supported" -#~ msgstr "Operacja I2C nieobsługiwana" - #~ msgid "Invalid bit clock pin" #~ msgstr "Zła nóżka zegara" @@ -2697,9 +2809,6 @@ msgstr "zerowy krok" #~ msgid "Soft device assert, id: 0x%08lX, pc: 0x%08lX" #~ msgstr "Soft device assert, id: 0x%08lX, pc: 0x%08lX" -#~ msgid "Splitting with sub-captures" -#~ msgstr "Podział z podgrupami" - #~ msgid "Tile indices must be 0 - 255" #~ msgstr "Indeks kafelka musi być pomiędzy 0 a 255 włącznie" @@ -2709,99 +2818,21 @@ msgstr "zerowy krok" #~ msgid "Voice index too high" #~ msgstr "Zbyt wysoki indeks głosu" -#~ msgid "a bytes-like object is required" -#~ msgstr "wymagany obiekt typu bytes" - -#~ msgid "abort() called" -#~ msgstr "Wywołano abort()" - -#~ msgid "address %08x is not aligned to %d bytes" -#~ msgstr "adres %08x nie jest wyrównany do %d bajtów" - #~ msgid "bad GATT role" #~ msgstr "zła rola GATT" -#~ msgid "bits must be 8" -#~ msgstr "bits musi być 8" - -#~ msgid "buffers must be the same length" -#~ msgstr "bufory muszą mieć tę samą długość" - #~ msgid "characteristics includes an object that is not a Characteristic" #~ msgstr "" #~ "charakterystyki zawierają obiekt, który nie jest typu Characteristic" -#~ msgid "compression header" -#~ msgstr "nagłówek kompresji" - -#~ msgid "empty heap" -#~ msgstr "pusta sterta" - -#~ msgid "firstbit must be MSB" -#~ msgstr "firstbit musi być MSB" - -#~ msgid "heap must be a list" -#~ msgstr "heap musi być listą" - -#~ msgid "incorrect padding" -#~ msgstr "złe wypełnienie" - #~ msgid "interval not in range 0.0020 to 10.24" #~ msgstr "przedział poza zakresem 0.0020 do 10.24" -#~ msgid "invalid I2C peripheral" -#~ msgstr "złe I2C" - -#~ msgid "invalid SPI peripheral" -#~ msgstr "złe SPI" - -#~ msgid "invalid arguments" -#~ msgstr "złe arguemnty" - -#~ msgid "invalid cert" -#~ msgstr "zły ceryfikat" - -#~ msgid "invalid dupterm index" -#~ msgstr "zły indeks dupterm" - -#~ msgid "invalid format" -#~ msgstr "zły format" - -#~ msgid "invalid key" -#~ msgstr "zły klucz" - -#~ msgid "must specify all of sck/mosi/miso" -#~ msgstr "sck/mosi/miso muszą być podane" - #~ msgid "name must be a string" #~ msgstr "nazwa musi być łańcuchem" -#~ msgid "non-hex digit found" -#~ msgstr "cyfra nieszesnastkowa" - -#~ msgid "odd-length string" -#~ msgstr "łańcuch o nieparzystej długości" - -#~ msgid "queue overflow" -#~ msgstr "przepełnienie kolejki" - #~ msgid "services includes an object that is not a Service" #~ msgstr "obiekt typu innego niż Service w services" -#~ msgid "struct: cannot index" -#~ msgstr "struct: nie można indeksować" - -#~ msgid "struct: index out of range" -#~ msgstr "struct: indeks poza zakresem" - -#~ msgid "struct: no fields" -#~ msgstr "struct: brak pól" - -#~ msgid "syntax error in JSON" -#~ msgstr "błąd składni w JSON" - -#~ msgid "syntax error in uctypes descriptor" -#~ msgstr "błąd składni w deskryptorze uctypes" - #~ msgid "tile index out of bounds" #~ msgstr "indeks kafelka poza zakresem" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index f89cc428c5..01a9f04702 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:11-0600\n" +"POT-Creation-Date: 2019-11-17 20:54-0600\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -433,6 +433,10 @@ msgstr "" msgid "Cannot transfer without MOSI and MISO pins." msgstr "Não é possível transferir sem os pinos MOSI e MISO." +#: extmod/moductypes.c +msgid "Cannot unambiguously get sizeof scalar" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Não é possível ler sem um pino MOSI" @@ -546,6 +550,10 @@ msgstr "" msgid "EXTINT channel already in use" msgstr "Canal EXTINT em uso" +#: extmod/modure.c +msgid "Error in regex" +msgstr "Erro no regex" + #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c @@ -751,10 +759,14 @@ msgstr "" msgid "Group full" msgstr "Grupo cheio" -#: py/objstringio.c +#: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Operação I/O no arquivo fechado" +#: extmod/machine_i2c.c +msgid "I2C operation not supported" +msgstr "I2C operação não suportada" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1097,7 +1109,7 @@ msgstr "" msgid "Read-only" msgstr "Somente leitura" -#: py/moduerrno.c +#: extmod/vfs_fat.c py/moduerrno.c msgid "Read-only filesystem" msgstr "Sistema de arquivos somente leitura" @@ -1158,6 +1170,10 @@ msgstr "" msgid "Slices not supported" msgstr "" +#: extmod/modure.c +msgid "Splitting with sub-captures" +msgstr "" + #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "O tamanho da pilha deve ser pelo menos 256" @@ -1380,6 +1396,19 @@ msgstr "" msgid "__new__ arg must be a user-type" msgstr "" +#: extmod/modubinascii.c extmod/moduhashlib.c +msgid "a bytes-like object is required" +msgstr "" + +#: lib/embed/abort_.c +msgid "abort() called" +msgstr "abort() chamado" + +#: extmod/machine_mem.c +#, c-format +msgid "address %08x is not aligned to %d bytes" +msgstr "endereço %08x não está alinhado com %d bytes" + #: shared-bindings/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "" @@ -1437,6 +1466,10 @@ msgstr "" msgid "bits must be 7, 8 or 9" msgstr "" +#: extmod/machine_spi.c +msgid "bits must be 8" +msgstr "bits devem ser 8" + #: shared-bindings/audiomixer/Mixer.c #, fuzzy msgid "bits_per_sample must be 8 or 16" @@ -1470,6 +1503,10 @@ msgstr "" msgid "buffer too small" msgstr "" +#: extmod/machine_spi.c +msgid "buffers must be the same length" +msgstr "buffers devem ser o mesmo tamanho" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "" @@ -1700,6 +1737,10 @@ msgstr "" msgid "complex values not supported" msgstr "" +#: extmod/moduzlib.c +msgid "compression header" +msgstr "" + #: py/parse.c msgid "constant must be an integer" msgstr "constante deve ser um inteiro" @@ -1742,6 +1783,10 @@ msgstr "divisão por zero" msgid "empty" msgstr "vazio" +#: extmod/moduheapq.c extmod/modutimeq.c +msgid "empty heap" +msgstr "heap vazia" + #: py/objstr.c msgid "empty separator" msgstr "" @@ -1813,6 +1858,10 @@ msgstr "sistema de arquivos deve fornecer método de montagem" msgid "first argument to super() must be type" msgstr "" +#: extmod/machine_spi.c +msgid "firstbit must be MSB" +msgstr "firstbit devem ser MSB" + #: py/objint.c msgid "float too big" msgstr "float muito grande" @@ -1881,6 +1930,10 @@ msgstr "" msgid "graphic must be 2048 bytes long" msgstr "" +#: extmod/moduheapq.c +msgid "heap must be a list" +msgstr "heap deve ser uma lista" + #: py/compile.c msgid "identifier redefined as global" msgstr "" @@ -1897,6 +1950,10 @@ msgstr "formato incompleto" msgid "incomplete format key" msgstr "" +#: extmod/modubinascii.c +msgid "incorrect padding" +msgstr "preenchimento incorreto" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -1923,10 +1980,38 @@ msgstr "inteiro requerido" msgid "interval must be in range %s-%s" msgstr "" +#: extmod/machine_i2c.c +msgid "invalid I2C peripheral" +msgstr "periférico I2C inválido" + +#: extmod/machine_spi.c +msgid "invalid SPI peripheral" +msgstr "periférico SPI inválido" + +#: lib/netutils/netutils.c +msgid "invalid arguments" +msgstr "argumentos inválidos" + +#: extmod/modussl_axtls.c +msgid "invalid cert" +msgstr "certificado inválido" + +#: extmod/uos_dupterm.c +msgid "invalid dupterm index" +msgstr "Índice de dupterm inválido" + +#: extmod/modframebuf.c +msgid "invalid format" +msgstr "formato inválido" + #: py/objstr.c msgid "invalid format specifier" msgstr "" +#: extmod/modussl_axtls.c +msgid "invalid key" +msgstr "chave inválida" + #: py/compile.c msgid "invalid micropython decorator" msgstr "" @@ -2055,6 +2140,10 @@ msgstr "" msgid "must raise an object" msgstr "" +#: extmod/machine_spi.c +msgid "must specify all of sck/mosi/miso" +msgstr "deve especificar todos sck/mosi/miso" + #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "" @@ -2121,6 +2210,10 @@ msgstr "" 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 "" @@ -2187,6 +2280,10 @@ msgstr "" msgid "object with buffer protocol required" msgstr "" +#: extmod/modubinascii.c +msgid "odd-length string" +msgstr "" + #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "" @@ -2274,6 +2371,10 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" +#: extmod/modutimeq.c +msgid "queue overflow" +msgstr "estouro de fila" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "" @@ -2388,6 +2489,18 @@ msgstr "" msgid "string not supported; use bytes or bytearray" msgstr "" +#: extmod/moductypes.c +msgid "struct: cannot index" +msgstr "struct: não pode indexar" + +#: extmod/moductypes.c +msgid "struct: index out of range" +msgstr "struct: índice fora do intervalo" + +#: extmod/moductypes.c +msgid "struct: no fields" +msgstr "struct: sem campos" + #: py/objstr.c msgid "substring not found" msgstr "" @@ -2396,6 +2509,14 @@ msgstr "" msgid "super() can't find self" msgstr "" +#: extmod/modujson.c +msgid "syntax error in JSON" +msgstr "erro de sintaxe no JSON" + +#: 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 "Limite deve estar no alcance de 0-65536" @@ -2629,9 +2750,6 @@ msgstr "passo zero" #~ msgid "Error in ffi_prep_cif" #~ msgstr "Erro no ffi_prep_cif" -#~ msgid "Error in regex" -#~ msgstr "Erro no regex" - #, fuzzy #~ msgid "Failed to acquire mutex" #~ msgstr "Falha ao alocar buffer RX" @@ -2695,9 +2813,6 @@ msgstr "passo zero" #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 não suporta pull up." -#~ msgid "I2C operation not supported" -#~ msgstr "I2C operação não suportada" - #~ msgid "Invalid bit clock pin" #~ msgstr "Pino de bit clock inválido" @@ -2768,21 +2883,9 @@ msgstr "passo zero" #~ msgid "Use esptool to erase flash and re-upload Python instead" #~ msgstr "Use o esptool para apagar o flash e recarregar o Python" -#~ msgid "abort() called" -#~ msgstr "abort() chamado" - -#~ msgid "address %08x is not aligned to %d bytes" -#~ msgstr "endereço %08x não está alinhado com %d bytes" - -#~ msgid "bits must be 8" -#~ msgstr "bits devem ser 8" - #~ msgid "buffer too long" #~ msgstr "buffer muito longo" -#~ msgid "buffers must be the same length" -#~ msgstr "buffers devem ser o mesmo tamanho" - #~ msgid "can query only one param" #~ msgstr "pode consultar apenas um parâmetro" @@ -2801,63 +2904,30 @@ msgstr "passo zero" #~ msgid "either pos or kw args are allowed" #~ msgstr "pos ou kw args são permitidos" -#~ msgid "empty heap" -#~ msgstr "heap vazia" - #~ msgid "expecting a pin" #~ msgstr "esperando um pino" #~ msgid "ffi_prep_closure_loc" #~ msgstr "ffi_prep_closure_loc" -#~ msgid "firstbit must be MSB" -#~ msgstr "firstbit devem ser MSB" - #~ msgid "flash location must be below 1MByte" #~ msgstr "o local do flash deve estar abaixo de 1 MByte" #~ msgid "frequency can only be either 80Mhz or 160MHz" #~ msgstr "A frequência só pode ser 80Mhz ou 160MHz" -#~ msgid "heap must be a list" -#~ msgstr "heap deve ser uma lista" - #~ msgid "impossible baudrate" #~ msgstr "taxa de transmissão impossível" -#~ msgid "incorrect padding" -#~ msgstr "preenchimento incorreto" - -#~ msgid "invalid I2C peripheral" -#~ msgstr "periférico I2C inválido" - -#~ msgid "invalid SPI peripheral" -#~ msgstr "periférico SPI inválido" - #~ msgid "invalid alarm" #~ msgstr "Alarme inválido" -#~ msgid "invalid arguments" -#~ msgstr "argumentos inválidos" - #~ msgid "invalid buffer length" #~ msgstr "comprimento de buffer inválido" -#~ msgid "invalid cert" -#~ msgstr "certificado inválido" - #~ msgid "invalid data bits" #~ msgstr "Bits de dados inválidos" -#~ msgid "invalid dupterm index" -#~ msgstr "Índice de dupterm inválido" - -#~ msgid "invalid format" -#~ msgstr "formato inválido" - -#~ msgid "invalid key" -#~ msgstr "chave inválida" - #~ msgid "invalid pin" #~ msgstr "Pino inválido" @@ -2870,9 +2940,6 @@ msgstr "passo zero" #~ msgid "memory allocation failed, allocating %u bytes for native code" #~ msgstr "alocação de memória falhou, alocando %u bytes para código nativo" -#~ msgid "must specify all of sck/mosi/miso" -#~ msgstr "deve especificar todos sck/mosi/miso" - #, fuzzy #~ msgid "name must be a string" #~ msgstr "heap deve ser uma lista" @@ -2883,27 +2950,12 @@ msgstr "passo zero" #~ msgid "pin does not have IRQ capabilities" #~ msgstr "Pino não tem recursos de IRQ" -#~ msgid "queue overflow" -#~ msgstr "estouro de fila" - #~ msgid "row must be packed and word aligned" #~ msgstr "Linha deve ser comprimida e com as palavras alinhadas" #~ msgid "scan failed" #~ msgstr "varredura falhou" -#~ msgid "struct: cannot index" -#~ msgstr "struct: não pode indexar" - -#~ msgid "struct: index out of range" -#~ msgstr "struct: índice fora do intervalo" - -#~ msgid "struct: no fields" -#~ msgstr "struct: sem campos" - -#~ msgid "syntax error in JSON" -#~ msgstr "erro de sintaxe no JSON" - #~ msgid "too many arguments" #~ msgstr "muitos argumentos" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 0111774c14..750cdd9d88 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:11-0600\n" +"POT-Creation-Date: 2019-11-17 20:54-0600\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -432,6 +432,10 @@ msgstr "Wúfǎ zi fēnlèi" msgid "Cannot transfer without MOSI and MISO pins." msgstr "Méiyǒu MOSI/MISO jiù wúfǎ zhuǎnyí." +#: extmod/moductypes.c +msgid "Cannot unambiguously get sizeof scalar" +msgstr "Wúfǎ míngquè de huòdé biāoliàng de dàxiǎo" + #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." msgstr "Wúfǎ xiě rù MOSI de yǐn jiǎo." @@ -543,6 +547,10 @@ msgstr "Fāngxiàng shūrù shí qūdòng móshì méiyǒu shǐyòng." msgid "EXTINT channel already in use" msgstr "EXTINT píndào yǐjīng shǐyòng" +#: extmod/modure.c +msgid "Error in regex" +msgstr "Zhèngzé biǎodá shì cuòwù" + #: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c #: shared-bindings/terminalio/Terminal.c @@ -744,10 +752,14 @@ msgstr "Jítuán yǐjīng shǐyòngguò" msgid "Group full" msgstr "Fēnzǔ yǐ mǎn" -#: py/objstringio.c +#: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Wénjiàn shàng de I/ O cāozuò" +#: extmod/machine_i2c.c +msgid "I2C operation not supported" +msgstr "I2C cāozuò bù zhīchí" + #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" @@ -1093,7 +1105,7 @@ msgstr "Fànwéi chāochū biānjiè" msgid "Read-only" msgstr "Zhǐ dú" -#: py/moduerrno.c +#: extmod/vfs_fat.c py/moduerrno.c msgid "Read-only filesystem" msgstr "Zhǐ dú wénjiàn xìtǒng" @@ -1153,6 +1165,10 @@ msgstr "Qiēpiàn hé zhí bùtóng chángdù." msgid "Slices not supported" msgstr "Qiēpiàn bù shòu zhīchí" +#: extmod/modure.c +msgid "Splitting with sub-captures" +msgstr "Yǔ zi bǔhuò fēnliè" + #: shared-bindings/supervisor/__init__.c msgid "Stack size must be at least 256" msgstr "Duīzhàn dàxiǎo bìxū zhìshǎo 256" @@ -1393,6 +1409,19 @@ msgstr "__Init__() yīnggāi fǎnhuí not, ér bùshì '%s'" msgid "__new__ arg must be a user-type" msgstr "__new__ cānshù bìxū shì yònghù lèixíng" +#: extmod/modubinascii.c extmod/moduhashlib.c +msgid "a bytes-like object is required" +msgstr "xūyào yīgè zì jié lèi duìxiàng" + +#: lib/embed/abort_.c +msgid "abort() called" +msgstr "zhōngzhǐ () diàoyòng" + +#: extmod/machine_mem.c +#, c-format +msgid "address %08x is not aligned to %d bytes" +msgstr "wèi zhǐ %08x wèi yǔ %d wèi yuán zǔ duìqí" + #: shared-bindings/i2cslave/I2CSlave.c msgid "address out of bounds" msgstr "dìzhǐ chāochū biānjiè" @@ -1450,6 +1479,10 @@ msgstr "èrjìnzhì bǎn qián bǎn %q wèi zhíxíng" msgid "bits must be 7, 8 or 9" msgstr "bǐtè bìxū shì 7,8 huò 9" +#: extmod/machine_spi.c +msgid "bits must be 8" +msgstr "bǐtè bìxū shì 8" + #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "měi jiàn yàngběn bìxū wèi 8 huò 16" @@ -1480,6 +1513,10 @@ msgstr "huǎnchōng qū qiēpiàn bìxū chángdù xiāngděng" msgid "buffer too small" msgstr "huǎnchōng qū tài xiǎo" +#: extmod/machine_spi.c +msgid "buffers must be the same length" +msgstr "huǎnchōng qū bìxū shì chángdù xiāngtóng" + #: shared-bindings/_pew/PewPew.c msgid "buttons must be digitalio.DigitalInOut" msgstr "ànniǔ bìxū shì digitalio.DigitalInOut" @@ -1712,6 +1749,10 @@ msgstr "fùzá de fēngé wèi 0" msgid "complex values not supported" msgstr "bù zhīchí fùzá de zhí" +#: extmod/moduzlib.c +msgid "compression header" +msgstr "yāsuō tóu bù" + #: py/parse.c msgid "constant must be an integer" msgstr "chángshù bìxū shì yīgè zhěngshù" @@ -1755,6 +1796,10 @@ msgstr "bèi líng chú" msgid "empty" msgstr "kòngxián" +#: extmod/moduheapq.c extmod/modutimeq.c +msgid "empty heap" +msgstr "kōng yīn yīnxiào" + #: py/objstr.c msgid "empty separator" msgstr "kōng fēngé fú" @@ -1825,6 +1870,10 @@ msgstr "wénjiàn xìtǒng bìxū tígōng guà zài fāngfǎ" msgid "first argument to super() must be type" msgstr "chāojí () de dì yī gè cānshù bìxū shì lèixíng" +#: extmod/machine_spi.c +msgid "firstbit must be MSB" +msgstr "dì yī wèi bìxū shì MSB" + #: py/objint.c msgid "float too big" msgstr "fú diǎn tài dà" @@ -1893,6 +1942,10 @@ msgstr "shēngchéng qì hūlüè shēngchéng qì tuìchū" msgid "graphic must be 2048 bytes long" msgstr "túxíng bìxū wèi 2048 zì jié" +#: extmod/moduheapq.c +msgid "heap must be a list" +msgstr "duī bìxū shì yīgè lièbiǎo" + #: py/compile.c msgid "identifier redefined as global" msgstr "biāozhì fú chóngxīn dìngyì wèi quánjú" @@ -1909,6 +1962,10 @@ msgstr "géshì bù wánzhěng" msgid "incomplete format key" msgstr "géshì bù wánzhěng de mì yào" +#: extmod/modubinascii.c +msgid "incorrect padding" +msgstr "bù zhèngquè de tiánchōng" + #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" @@ -1935,10 +1992,38 @@ msgstr "xūyào zhěngshù" msgid "interval must be in range %s-%s" msgstr "Jiàngé bìxū zài %s-%s fànwéi nèi" +#: extmod/machine_i2c.c +msgid "invalid I2C peripheral" +msgstr "wúxiào de I2C wàiwéi qì" + +#: extmod/machine_spi.c +msgid "invalid SPI peripheral" +msgstr "wúxiào de SPI wàiwéi qì" + +#: lib/netutils/netutils.c +msgid "invalid arguments" +msgstr "wúxiào de cānshù" + +#: extmod/modussl_axtls.c +msgid "invalid cert" +msgstr "zhèngshū wúxiào" + +#: extmod/uos_dupterm.c +msgid "invalid dupterm index" +msgstr "dupterm suǒyǐn wúxiào" + +#: extmod/modframebuf.c +msgid "invalid format" +msgstr "wúxiào géshì" + #: py/objstr.c msgid "invalid format specifier" msgstr "wúxiào de géshì biāozhù" +#: extmod/modussl_axtls.c +msgid "invalid key" +msgstr "wúxiào de mì yào" + #: py/compile.c msgid "invalid micropython decorator" msgstr "wúxiào de MicroPython zhuāngshì qì" @@ -2068,6 +2153,10 @@ msgstr "bù zhīchí duō gè jìchéng" msgid "must raise an object" msgstr "bìxū tíchū duìxiàng" +#: extmod/machine_spi.c +msgid "must specify all of sck/mosi/miso" +msgstr "bìxū zhǐdìng suǒyǒu sck/mosi/misco" + #: py/modbuiltins.c msgid "must use keyword argument for key function" msgstr "bìxū shǐyòng guānjiàn cí cānshù" @@ -2135,6 +2224,10 @@ msgstr "Zài service_uuids bái míngdān zhōng zhǎodào fēi UUID" msgid "non-default argument follows default argument" msgstr "bùshì mòrèn cānshù zūnxún mòrèn cānshù" +#: extmod/modubinascii.c +msgid "non-hex digit found" +msgstr "zhǎodào fēi shíliù jìn zhì shùzì" + #: py/compile.c msgid "non-keyword arg after */**" msgstr "zài */** zhīhòu fēi guānjiàn cí cānshù" @@ -2201,6 +2294,10 @@ msgstr "lèixíng '%s' de duìxiàng méiyǒu chángdù" msgid "object with buffer protocol required" msgstr "xūyào huǎnchōng qū xiéyì de duìxiàng" +#: extmod/modubinascii.c +msgid "odd-length string" +msgstr "jīshù zìfú chuàn" + #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" msgstr "piānlí biānjiè" @@ -2288,6 +2385,10 @@ msgstr "pow() 3 cān shǔ bùnéng wéi 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() yǒu 3 cānshù xūyào zhěngshù" +#: extmod/modutimeq.c +msgid "queue overflow" +msgstr "duìliè yìchū" + #: shared-bindings/_pixelbuf/PixelBuf.c msgid "rawbuf is not the same size as buf" msgstr "yuánshǐ huǎnchōng qū hé huǎnchōng qū de dàxiǎo bùtóng" @@ -2402,6 +2503,18 @@ msgstr "zìfú chuàn zhǐshù bìxū shì zhěngshù, ér bùshì %s" msgid "string not supported; use bytes or bytearray" msgstr "zìfú chuàn bù zhīchí; shǐyòng zì jié huò zì jié zǔ" +#: extmod/moductypes.c +msgid "struct: cannot index" +msgstr "jiégòu: bùnéng suǒyǐn" + +#: extmod/moductypes.c +msgid "struct: index out of range" +msgstr "jiégòu: suǒyǐn chāochū fànwéi" + +#: extmod/moductypes.c +msgid "struct: no fields" +msgstr "jiégòu: méiyǒu zìduàn" + #: py/objstr.c msgid "substring not found" msgstr "wèi zhǎodào zi zìfú chuàn" @@ -2410,6 +2523,14 @@ msgstr "wèi zhǎodào zi zìfú chuàn" msgid "super() can't find self" msgstr "chāojí() zhǎo bù dào zìjǐ" +#: extmod/modujson.c +msgid "syntax error in JSON" +msgstr "JSON yǔfǎ cuòwù" + +#: extmod/moductypes.c +msgid "syntax error in uctypes descriptor" +msgstr "uctypes miáoshù fú zhōng de yǔfǎ cuòwù" + #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" msgstr "yùzhí bìxū zài fànwéi 0-65536" @@ -2629,9 +2750,6 @@ msgstr "líng bù" #~ msgid "Can't set CCCD for local Characteristic" #~ msgstr "Wúfǎ wéi běndì tèzhēng shèzhì CCCD" -#~ msgid "Cannot unambiguously get sizeof scalar" -#~ msgstr "Wúfǎ míngquè de huòdé biāoliàng de dàxiǎo" - #~ msgid "Characteristic UUID doesn't match Service UUID" #~ msgstr "Zìfú UUID bù fúhé fúwù UUID" @@ -2641,9 +2759,6 @@ msgstr "líng bù" #~ msgid "Data too large for the advertisement packet" #~ msgstr "Guǎnggào bāo de shùjù tài dà" -#~ msgid "Error in regex" -#~ msgstr "Zhèngzé biǎodá shì cuòwù" - #~ msgid "Expected a Peripheral" #~ msgstr "Qídài yīgè wàiwéi shèbèi" @@ -2701,9 +2816,6 @@ msgstr "líng bù" #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Wúfǎ tíngzhǐ guǎnggào, err 0x%04x" -#~ msgid "I2C operation not supported" -#~ msgstr "I2C cāozuò bù zhīchí" - #~ msgid "Invalid bit clock pin" #~ msgstr "Wúxiào de wèi shízhōng yǐn jiǎo" @@ -2737,9 +2849,6 @@ msgstr "líng bù" #~ msgid "Soft device assert, id: 0x%08lX, pc: 0x%08lX" #~ msgstr "Ruǎn shèbèi wéihù, id: 0X%08lX, pc: 0X%08lX" -#~ msgid "Splitting with sub-captures" -#~ msgstr "Yǔ zi bǔhuò fēnliè" - #~ msgid "Tile indices must be 0 - 255" #~ msgstr "Píng pū zhǐshù bìxū wèi 0 - 255" @@ -2749,105 +2858,27 @@ msgstr "líng bù" #~ msgid "Voice index too high" #~ msgstr "Yǔyīn suǒyǐn tài gāo" -#~ msgid "a bytes-like object is required" -#~ msgstr "xūyào yīgè zì jié lèi duìxiàng" - -#~ msgid "abort() called" -#~ msgstr "zhōngzhǐ () diàoyòng" - -#~ msgid "address %08x is not aligned to %d bytes" -#~ msgstr "wèi zhǐ %08x wèi yǔ %d wèi yuán zǔ duìqí" - #~ msgid "bad GATT role" #~ msgstr "zǒng xiédìng de bùliáng juésè" -#~ msgid "bits must be 8" -#~ msgstr "bǐtè bìxū shì 8" - -#~ msgid "buffers must be the same length" -#~ msgstr "huǎnchōng qū bìxū shì chángdù xiāngtóng" - #~ msgid "characteristics includes an object that is not a Characteristic" #~ msgstr "tèxìng bāokuò bùshì zìfú de wùtǐ" -#~ msgid "compression header" -#~ msgstr "yāsuō tóu bù" - -#~ msgid "empty heap" -#~ msgstr "kōng yīn yīnxiào" - #~ msgid "expected a DigitalInOut" #~ msgstr "qídài de DigitalInOut" -#~ msgid "firstbit must be MSB" -#~ msgstr "dì yī wèi bìxū shì MSB" - -#~ msgid "heap must be a list" -#~ msgstr "duī bìxū shì yīgè lièbiǎo" - -#~ msgid "incorrect padding" -#~ msgstr "bù zhèngquè de tiánchōng" - #~ msgid "interval not in range 0.0020 to 10.24" #~ msgstr "jùlí 0.0020 Zhì 10.24 Zhī jiān de jiàngé shíjiān" -#~ msgid "invalid I2C peripheral" -#~ msgstr "wúxiào de I2C wàiwéi qì" - -#~ msgid "invalid SPI peripheral" -#~ msgstr "wúxiào de SPI wàiwéi qì" - -#~ msgid "invalid arguments" -#~ msgstr "wúxiào de cānshù" - -#~ msgid "invalid cert" -#~ msgstr "zhèngshū wúxiào" - -#~ msgid "invalid dupterm index" -#~ msgstr "dupterm suǒyǐn wúxiào" - -#~ msgid "invalid format" -#~ msgstr "wúxiào géshì" - -#~ msgid "invalid key" -#~ msgstr "wúxiào de mì yào" - -#~ msgid "must specify all of sck/mosi/miso" -#~ msgstr "bìxū zhǐdìng suǒyǒu sck/mosi/misco" - #~ msgid "name must be a string" #~ msgstr "míngchēng bìxū shì yīgè zìfú chuàn" -#~ msgid "non-hex digit found" -#~ msgstr "zhǎodào fēi shíliù jìn zhì shùzì" - -#~ msgid "odd-length string" -#~ msgstr "jīshù zìfú chuàn" - -#~ msgid "queue overflow" -#~ msgstr "duìliè yìchū" - #~ msgid "row must be packed and word aligned" #~ msgstr "xíng bìxū dǎbāo bìngqiě zì duìqí" #~ msgid "services includes an object that is not a Service" #~ msgstr "fúwù bāokuò yīgè bùshì fúwù de wùjiàn" -#~ msgid "struct: cannot index" -#~ msgstr "jiégòu: bùnéng suǒyǐn" - -#~ msgid "struct: index out of range" -#~ msgstr "jiégòu: suǒyǐn chāochū fànwéi" - -#~ msgid "struct: no fields" -#~ msgstr "jiégòu: méiyǒu zìduàn" - -#~ msgid "syntax error in JSON" -#~ msgstr "JSON yǔfǎ cuòwù" - -#~ msgid "syntax error in uctypes descriptor" -#~ msgstr "uctypes miáoshù fú zhōng de yǔfǎ cuòwù" - #~ msgid "tile index out of bounds" #~ msgstr "kuài suǒyǐn chāochū fànwéi" From 8e9ac593963537f2504efdfeefe28782de68a53f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 Nov 2019 20:54:21 -0600 Subject: [PATCH 048/189] Makefile: Fix a problem where `xargs` invoked `xgettext` 2x On a Debian 10 system, the number of arguments to xargs was such that it would not fit in a single invocation (xargs --show-limits prints "bytes: Size of command buffer we are actually using: 131072"). In this situation, the output from the second invocation of xgettext would replace the output of the first one, so messages that appeared only in files early in the list would be lost. Strings in "extmod" were most frequently the victim, including "incorrect padding" from modubinascii.c. Unfortunately, when the github environment was similar enough to the environment where "make translate" was invoked, the problem was not found by "check-translate", because the same (incorrect, truncated) potfile would be generated on both systems. Apparently Ubuntu and Debian were different enough that the problem could become visible. xgettext has a mode where it reads files from stdin ('-f-'), but this does not have a zero-delimited variant documented. Still, we will assume that files with adversarial names are not committed to circuitpython or created by the build process, and print newline-delimited filenames from `find` to be processed by `xgettext -f-`. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b9c489fd40..d7127b517d 100644 --- a/Makefile +++ b/Makefile @@ -204,7 +204,7 @@ pseudoxml: all-source: locale/circuitpython.pot: all-source - find $(TRANSLATE_SOURCES) -iname "*.c" -print0 | (LC_ALL=C sort -z) | xargs -0 xgettext -L C -s --add-location=file --keyword=translate -o circuitpython.pot -p locale + find $(TRANSLATE_SOURCES) -iname "*.c" -print | (LC_ALL=C sort) | xgettext -f- -L C -s --add-location=file --keyword=translate -o circuitpython.pot -p locale translate: locale/circuitpython.pot for po in $(shell ls locale/*.po); do msgmerge -U $$po -s --no-fuzzy-matching --add-location=file locale/circuitpython.pot; done From 37fd08e637300f3fba792401b1d8b105a7a7c6f5 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 17 Nov 2019 21:18:25 -0600 Subject: [PATCH 049/189] workflows: Don't try to upload when running in someone's fork .. which we can tell by whether the environment variable is non-empty --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 10c34355d1..404cd19a67 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -190,7 +190,7 @@ jobs: name: ${{ matrix.board }} path: bin/${{ matrix.board }} - name: Upload to S3 - run: aws s3 cp bin/ s3://adafruit-circuit-python/bin/ --recursive --no-progress --region us-east-1 + run: "[ -z \"$AWS_ACCESS_KEY_ID\" ] || aws s3 cp bin/ s3://adafruit-circuit-python/bin/ --recursive --no-progress --region us-east-1" env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} @@ -199,7 +199,7 @@ jobs: run: | pip install uritemplate - name: Upload to Release - run: python3 -u upload_release_files.py + run: "[ -z \"$ADABOT_GITHUB_ACCESS_TOKEN\" ] || python3 -u upload_release_files.py" working-directory: tools env: UPLOAD_URL: ${{ github.event.release.upload_url }} From acde22a43603faf65510b3a9ba78ba5ac1f45b44 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 16 Nov 2019 15:22:20 -0600 Subject: [PATCH 050/189] circuitpy_mpconfig.h: Move includes after include-guard To benefit from gcc's "once-only headers" implementation, the "wrapper-#ifndef" must be the first non-comment part of the file, according to the manual for various gcc/cpp versions. --- py/circuitpy_mpconfig.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index b1e7bc05aa..efab6a4d6f 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -28,11 +28,11 @@ // sure that the same feature set and settings are used, such as in atmel-samd // and nrf. -#include - #ifndef __INCLUDED_MPCONFIG_CIRCUITPY_H #define __INCLUDED_MPCONFIG_CIRCUITPY_H +#include + // This is CircuitPython. #define CIRCUITPY 1 From 45d1b290ee13ee4080e9718909c33053583314b8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 16 Nov 2019 15:24:56 -0600 Subject: [PATCH 051/189] circuitpy_mpconfig.h: Express HOOKS in terms of RUN_BACKGROUND_TASKS .. this means that when we want to modify RUN_BACKGROUND_TASKS, only one change is needed instead of 3 --- py/circuitpy_mpconfig.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index efab6a4d6f..61d3242919 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -658,8 +658,8 @@ void run_background_tasks(void); // TODO: Used in wiznet5k driver, but may not be needed in the long run. #define MICROPY_THREAD_YIELD() -#define MICROPY_VM_HOOK_LOOP run_background_tasks(); -#define MICROPY_VM_HOOK_RETURN run_background_tasks(); +#define MICROPY_VM_HOOK_LOOP RUN_BACKGROUND_TASKS; +#define MICROPY_VM_HOOK_RETURN RUN_BACKGROUND_TASKS; #define CIRCUITPY_AUTORELOAD_DELAY_MS 500 #define CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS 1000 From 7f744a2369a5036cadfa05575da1704f709c98bb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 18 Nov 2019 08:22:41 -0600 Subject: [PATCH 052/189] Supervisor: move most of systick to the supervisor This code is shared by most parts, except where not all the #ifdefs inside the tick function were present in all ports. This mostly would have broken gamepad tick support on non-samd ports. The "ms32" and "ms64" variants of the tick functions are introduced because there is no 64-bit atomic read. Disabling interrupts avoids a low probability bug where milliseconds could be off by ~49.5 days once every ~49.5 days (2^32 ms). Avoiding disabling interrupts when only the low 32 bits are needed is a minor optimization. Testing performed: on metro m4 express, USB still works and time.monotonic_ns() still counts up --- drivers/wiznet5k/internet/dns/dns.c | 4 +- ports/atmel-samd/background.c | 5 +- ports/atmel-samd/common-hal/busio/UART.c | 13 ++-- ports/atmel-samd/common-hal/time/__init__.c | 4 +- ports/atmel-samd/mphalport.c | 6 +- ports/atmel-samd/mphalport.h | 6 +- ports/atmel-samd/tick.c | 36 ++------- ports/atmel-samd/tick.h | 2 - ports/cxd56/common-hal/time/__init__.c | 4 +- ports/cxd56/mphalport.c | 6 +- ports/cxd56/mphalport.h | 2 - ports/cxd56/tick.c | 15 +--- ports/cxd56/tick.h | 2 - ports/nrf/common-hal/_bleio/Adapter.c | 3 +- .../common-hal/_bleio/CharacteristicBuffer.c | 5 +- ports/nrf/common-hal/busio/UART.c | 12 +-- ports/nrf/common-hal/time/__init__.c | 2 +- ports/nrf/mphalport.c | 5 +- ports/nrf/mphalport.h | 5 +- ports/nrf/tick.c | 33 ++------ ports/nrf/tick.h | 2 - ports/stm32f4/common-hal/time/__init__.c | 2 +- ports/stm32f4/mphalport.c | 6 +- ports/stm32f4/mphalport.h | 4 +- ports/stm32f4/tick.c | 32 +++----- ports/stm32f4/tick.h | 2 - py/circuitpy_mpconfig.h | 1 + shared-module/displayio/Display.c | 11 +-- shared-module/displayio/EPaperDisplay.c | 5 +- shared-module/displayio/display_core.c | 5 +- shared-module/network/__init__.c | 4 +- shared-module/usb_hid/Device.c | 5 +- supervisor/shared/rgb_led_status.c | 9 ++- supervisor/shared/safe_mode.c | 5 +- supervisor/shared/tick.c | 76 +++++++++++++++++++ supervisor/shared/tick.h | 37 +++++++++ supervisor/supervisor.mk | 1 + 37 files changed, 214 insertions(+), 163 deletions(-) create mode 100644 supervisor/shared/tick.c create mode 100644 supervisor/shared/tick.h diff --git a/drivers/wiznet5k/internet/dns/dns.c b/drivers/wiznet5k/internet/dns/dns.c index daf4db1230..8b9e966708 100644 --- a/drivers/wiznet5k/internet/dns/dns.c +++ b/drivers/wiznet5k/internet/dns/dns.c @@ -52,7 +52,7 @@ #include #include -#include "tick.h" +#include "supervisor/shared/tick.h" //#include "Ethernet/socket.h" //#include "Internet/DNS/dns.h" @@ -125,7 +125,7 @@ uint16_t DNS_MSGID; // DNS message ID uint32_t HAL_GetTick(void) { - return ticks_ms; + return supervisor_ticks_ms32(); } uint32_t hal_sys_tick; diff --git a/ports/atmel-samd/background.c b/ports/atmel-samd/background.c index 386ba07158..3b698768b8 100644 --- a/ports/atmel-samd/background.c +++ b/ports/atmel-samd/background.c @@ -28,6 +28,7 @@ #include "audio_dma.h" #include "tick.h" #include "supervisor/filesystem.h" +#include "supervisor/shared/tick.h" #include "supervisor/usb.h" #include "py/runtime.h" @@ -71,9 +72,9 @@ void run_background_tasks(void) { running_background_tasks = false; assert_heap_ok(); - last_finished_tick = ticks_ms; + last_finished_tick = supervisor_ticks_ms64(); } bool background_tasks_ok(void) { - return ticks_ms - last_finished_tick < 1000; + return supervisor_ticks_ms64() - last_finished_tick < 1000; } diff --git a/ports/atmel-samd/common-hal/busio/UART.c b/ports/atmel-samd/common-hal/busio/UART.c index 2505e894af..42493a6b6e 100644 --- a/ports/atmel-samd/common-hal/busio/UART.c +++ b/ports/atmel-samd/common-hal/busio/UART.c @@ -34,8 +34,7 @@ #include "py/runtime.h" #include "py/stream.h" #include "supervisor/shared/translate.h" - -#include "tick.h" +#include "supervisor/shared/tick.h" #include "hpl_sercom_config.h" #include "peripheral_clk_config.h" @@ -272,10 +271,10 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t usart_async_get_io_descriptor(usart_desc_p, &io); size_t total_read = 0; - uint64_t start_ticks = ticks_ms; + uint64_t start_ticks = supervisor_ticks_ms64(); // Busy-wait until timeout or until we've read enough chars. - while (ticks_ms - start_ticks <= self->timeout_ms) { + 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); @@ -289,7 +288,7 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t } if (num_read > 0) { // Reset the timeout on every character read. - start_ticks = ticks_ms; + start_ticks = supervisor_ticks_ms64(); } RUN_BACKGROUND_TASKS; // Allow user to break out of a timeout with a KeyboardInterrupt. @@ -330,9 +329,9 @@ size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, // Wait until write is complete or timeout. bool done = false; - uint64_t start_ticks = ticks_ms; + uint64_t start_ticks = supervisor_ticks_ms64(); // Busy-wait for timeout. - while (ticks_ms - start_ticks < self->timeout_ms) { + while (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) { if (usart_async_is_tx_empty(usart_desc_p)) { done = true; break; diff --git a/ports/atmel-samd/common-hal/time/__init__.c b/ports/atmel-samd/common-hal/time/__init__.c index 0d60adef20..2d82b3d1ad 100644 --- a/ports/atmel-samd/common-hal/time/__init__.c +++ b/ports/atmel-samd/common-hal/time/__init__.c @@ -28,10 +28,10 @@ #include "shared-bindings/time/__init__.h" -#include "tick.h" +#include "supervisor/shared/tick.h" inline uint64_t common_hal_time_monotonic() { - return ticks_ms; + return supervisor_ticks_ms64(); } void common_hal_time_delay_ms(uint32_t delay) { diff --git a/ports/atmel-samd/mphalport.c b/ports/atmel-samd/mphalport.c index 957bf6073e..96433d729f 100644 --- a/ports/atmel-samd/mphalport.c +++ b/ports/atmel-samd/mphalport.c @@ -45,12 +45,12 @@ #include "mpconfigboard.h" #include "mphalport.h" #include "reset.h" -#include "tick.h" +#include "supervisor/shared/tick.h" extern uint32_t common_hal_mcu_processor_get_frequency(void); void mp_hal_delay_ms(mp_uint_t delay) { - uint64_t start_tick = ticks_ms; + uint64_t start_tick = supervisor_ticks_ms64(); uint64_t duration = 0; while (duration < delay) { RUN_BACKGROUND_TASKS; @@ -59,7 +59,7 @@ void mp_hal_delay_ms(mp_uint_t delay) { MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { break; } - duration = (ticks_ms - start_tick); + duration = (supervisor_ticks_ms64() - start_tick); // TODO(tannewt): Go to sleep for a little while while we wait. } } diff --git a/ports/atmel-samd/mphalport.h b/ports/atmel-samd/mphalport.h index 64269b201f..8a762e2584 100644 --- a/ports/atmel-samd/mphalport.h +++ b/ports/atmel-samd/mphalport.h @@ -31,11 +31,11 @@ #include "lib/oofatfs/ff.h" -// Global millisecond tick count (driven by SysTick interrupt). -extern volatile uint64_t ticks_ms; +#include "supervisor/shared/tick.h" +// Global millisecond tick count (driven by SysTick interrupt). static inline mp_uint_t mp_hal_ticks_ms(void) { - return ticks_ms; + return supervisor_ticks_ms32(); } // Number of bytes in receive buffer volatile uint8_t usb_rx_count; diff --git a/ports/atmel-samd/tick.c b/ports/atmel-samd/tick.c index 4d7bb9dca7..f996440ae3 100644 --- a/ports/atmel-samd/tick.c +++ b/ports/atmel-samd/tick.c @@ -28,47 +28,21 @@ #include "peripheral_clk_config.h" -#include "supervisor/shared/autoreload.h" -#include "supervisor/filesystem.h" +#include "supervisor/shared/tick.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Processor.h" -#if CIRCUITPY_GAMEPAD -#include "shared-module/gamepad/__init__.h" -#endif - -#if CIRCUITPY_GAMEPADSHIFT -#include "shared-module/gamepadshift/__init__.h" -#endif -// Global millisecond tick count -volatile uint64_t ticks_ms = 0; - void SysTick_Handler(void) { // SysTick interrupt handler called when the SysTick timer reaches zero // (every millisecond). common_hal_mcu_disable_interrupts(); - ticks_ms += 1; // Read the control register to reset the COUNTFLAG. (void) SysTick->CTRL; common_hal_mcu_enable_interrupts(); -#if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0 - filesystem_tick(); -#endif -#ifdef CIRCUITPY_AUTORELOAD_DELAY_MS - autoreload_tick(); -#endif -#ifdef CIRCUITPY_GAMEPAD_TICKS - if (!(ticks_ms & CIRCUITPY_GAMEPAD_TICKS)) { - #if CIRCUITPY_GAMEPAD - gamepad_tick(); - #endif - #if CIRCUITPY_GAMEPADSHIFT - gamepadshift_tick(); - #endif - } -#endif + // Do things common to all ports when the tick occurs + supervisor_tick(); } void tick_init() { @@ -115,7 +89,7 @@ void current_tick(uint64_t* ms, uint32_t* us_until_ms) { uint32_t tick_status = SysTick->CTRL; uint32_t current_us = SysTick->VAL; uint32_t tick_status2 = SysTick->CTRL; - uint64_t current_ms = ticks_ms; + uint64_t current_ms = supervisor_ticks_ms64(); // The second clause ensures our value actually rolled over. Its possible it hit zero between // the VAL read and CTRL read. if ((tick_status & SysTick_CTRL_COUNTFLAG_Msk) != 0 || @@ -129,5 +103,5 @@ void current_tick(uint64_t* ms, uint32_t* us_until_ms) { void wait_until(uint64_t ms, uint32_t us_until_ms) { uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000; - while (ticks_ms <= ms && SysTick->VAL / ticks_per_us >= us_until_ms) {} + while (supervisor_ticks_ms64() <= ms && SysTick->VAL / ticks_per_us >= us_until_ms) {} } diff --git a/ports/atmel-samd/tick.h b/ports/atmel-samd/tick.h index c8c8d739ab..334352df26 100644 --- a/ports/atmel-samd/tick.h +++ b/ports/atmel-samd/tick.h @@ -28,8 +28,6 @@ #include "py/mpconfig.h" -extern volatile uint64_t ticks_ms; - extern struct timer_descriptor ms_timer; void tick_init(void); diff --git a/ports/cxd56/common-hal/time/__init__.c b/ports/cxd56/common-hal/time/__init__.c index 8f7326b629..6f5eedd419 100644 --- a/ports/cxd56/common-hal/time/__init__.c +++ b/ports/cxd56/common-hal/time/__init__.c @@ -26,10 +26,10 @@ #include "py/mphal.h" -#include "tick.h" +#include "supervisor/shared/tick.h" uint64_t common_hal_time_monotonic(void) { - return ticks_ms; + return supervisor_ticks_ms64(); } void common_hal_time_delay_ms(uint32_t delay) { diff --git a/ports/cxd56/mphalport.c b/ports/cxd56/mphalport.c index 79d93f9759..1305706caa 100644 --- a/ports/cxd56/mphalport.c +++ b/ports/cxd56/mphalport.c @@ -31,7 +31,7 @@ #include "py/mpstate.h" -#include "tick.h" +#include "supervisor/shared/tick.h" #define DELAY_CORRECTION (700) #define DELAY_INTERVAL (50) @@ -57,7 +57,7 @@ mp_uint_t mp_hal_ticks_cpu(void) { } void mp_hal_delay_ms(mp_uint_t delay) { - uint64_t start_tick = ticks_ms; + uint64_t start_tick = supervisor_ticks_ms64(); uint64_t duration = 0; while (duration < delay) { #ifdef MICROPY_VM_HOOK_LOOP @@ -68,7 +68,7 @@ void mp_hal_delay_ms(mp_uint_t delay) { MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { break; } - duration = (ticks_ms - start_tick); + duration = (supervisor_ticks_ms64() - start_tick); // TODO(tannewt): Go to sleep for a little while while we wait. } } diff --git a/ports/cxd56/mphalport.h b/ports/cxd56/mphalport.h index 25bca97ad7..a2be10b8d0 100644 --- a/ports/cxd56/mphalport.h +++ b/ports/cxd56/mphalport.h @@ -31,6 +31,4 @@ #include "lib/utils/interrupt_char.h" -extern volatile uint64_t ticks_ms; - #endif // MICROPY_INCLUDED_CXD56_MPHALPORT_H diff --git a/ports/cxd56/tick.c b/ports/cxd56/tick.c index 6529db7901..671b82b744 100644 --- a/ports/cxd56/tick.c +++ b/ports/cxd56/tick.c @@ -27,19 +27,10 @@ #include "tick.h" #include "supervisor/shared/autoreload.h" -#include "supervisor/filesystem.h" - -// Global millisecond tick count -volatile uint64_t ticks_ms = 0; +#include "supervisor/shared/tick.h" void board_timerhook(void) { - ticks_ms += 1; - -#if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0 - filesystem_tick(); -#endif -#ifdef CIRCUITPY_AUTORELOAD_DELAY_MS - autoreload_tick(); -#endif + // Do things common to all ports when the tick occurs + supervisor_tick(); } diff --git a/ports/cxd56/tick.h b/ports/cxd56/tick.h index a0d9ee5263..d641d9cd4f 100644 --- a/ports/cxd56/tick.h +++ b/ports/cxd56/tick.h @@ -29,6 +29,4 @@ #include "py/mpconfig.h" -extern volatile uint64_t ticks_ms; - #endif // MICROPY_INCLUDED_CXD56_TICK_H diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index 295a42d63b..c3b8dcebe2 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -40,6 +40,7 @@ #include "py/objstr.h" #include "py/runtime.h" #include "supervisor/shared/safe_mode.h" +#include "supervisor/shared/tick.h" #include "supervisor/usb.h" #include "shared-bindings/_bleio/__init__.h" #include "shared-bindings/_bleio/Adapter.h" @@ -353,7 +354,7 @@ STATIC bool scan_on_ble_evt(ble_evt_t *ble_evt, void *scan_results_in) { ble_gap_evt_adv_report_t *report = &ble_evt->evt.gap_evt.params.adv_report; shared_module_bleio_scanresults_append(scan_results, - ticks_ms, + supervisor_ticks_ms64(), report->type.connectable, report->type.scan_response, report->rssi, diff --git a/ports/nrf/common-hal/_bleio/CharacteristicBuffer.c b/ports/nrf/common-hal/_bleio/CharacteristicBuffer.c index 5f280e121f..9f9b453de4 100644 --- a/ports/nrf/common-hal/_bleio/CharacteristicBuffer.c +++ b/ports/nrf/common-hal/_bleio/CharacteristicBuffer.c @@ -39,6 +39,7 @@ #include "shared-bindings/_bleio/__init__.h" #include "shared-bindings/_bleio/Connection.h" +#include "supervisor/shared/tick.h" #include "common-hal/_bleio/CharacteristicBuffer.h" STATIC void write_to_ringbuf(bleio_characteristic_buffer_obj_t *self, uint8_t *data, uint16_t len) { @@ -100,10 +101,10 @@ void common_hal_bleio_characteristic_buffer_construct(bleio_characteristic_buffe } int common_hal_bleio_characteristic_buffer_read(bleio_characteristic_buffer_obj_t *self, uint8_t *data, size_t len, int *errcode) { - uint64_t start_ticks = ticks_ms; + uint64_t start_ticks = supervisor_ticks_ms64(); // Wait for all bytes received or timeout - while ( (ringbuf_count(&self->ringbuf) < len) && (ticks_ms - start_ticks < self->timeout_ms) ) { + while ( (ringbuf_count(&self->ringbuf) < len) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { RUN_BACKGROUND_TASKS; // Allow user to break out of a timeout with a KeyboardInterrupt. if ( mp_hal_is_interrupted() ) { diff --git a/ports/nrf/common-hal/busio/UART.c b/ports/nrf/common-hal/busio/UART.c index 54a66ddbe7..982b8efa97 100644 --- a/ports/nrf/common-hal/busio/UART.c +++ b/ports/nrf/common-hal/busio/UART.c @@ -231,10 +231,10 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t } size_t rx_bytes = 0; - uint64_t start_ticks = ticks_ms; + uint64_t start_ticks = supervisor_ticks_ms64(); // Wait for all bytes received or timeout - while ( (ringbuf_count(&self->rbuf) < len) && (ticks_ms - start_ticks < self->timeout_ms) ) { + while ( (ringbuf_count(&self->rbuf) < len) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { RUN_BACKGROUND_TASKS; // Allow user to break out of a timeout with a KeyboardInterrupt. if ( mp_hal_is_interrupted() ) { @@ -265,15 +265,15 @@ size_t common_hal_busio_uart_write (busio_uart_obj_t *self, const uint8_t *data, if ( len == 0 ) return 0; - uint64_t start_ticks = ticks_ms; + uint64_t start_ticks = supervisor_ticks_ms64(); // Wait for on-going transfer to complete - while ( nrfx_uarte_tx_in_progress(self->uarte) && (ticks_ms - start_ticks < self->timeout_ms) ) { + while ( nrfx_uarte_tx_in_progress(self->uarte) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { RUN_BACKGROUND_TASKS; } // Time up - if ( !(ticks_ms - start_ticks < self->timeout_ms) ) { + if ( !(supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { *errcode = MP_EAGAIN; return MP_STREAM_ERROR; } @@ -290,7 +290,7 @@ size_t common_hal_busio_uart_write (busio_uart_obj_t *self, const uint8_t *data, _VERIFY_ERR(*errcode); (*errcode) = 0; - while ( nrfx_uarte_tx_in_progress(self->uarte) && (ticks_ms - start_ticks < self->timeout_ms) ) { + while ( nrfx_uarte_tx_in_progress(self->uarte) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { RUN_BACKGROUND_TASKS; } diff --git a/ports/nrf/common-hal/time/__init__.c b/ports/nrf/common-hal/time/__init__.c index e3cb481ef4..976f519db2 100644 --- a/ports/nrf/common-hal/time/__init__.c +++ b/ports/nrf/common-hal/time/__init__.c @@ -29,7 +29,7 @@ #include "tick.h" uint64_t common_hal_time_monotonic(void) { - return ticks_ms; + return supervisor_ticks_ms64(); } void common_hal_time_delay_ms(uint32_t delay) { diff --git a/ports/nrf/mphalport.c b/ports/nrf/mphalport.c index bcd9fb1145..3885d5a826 100644 --- a/ports/nrf/mphalport.c +++ b/ports/nrf/mphalport.c @@ -31,12 +31,13 @@ #include "py/mphal.h" #include "py/mpstate.h" #include "py/gc.h" +#include "supervisor/shared/tick.h" /*------------------------------------------------------------------*/ /* delay *------------------------------------------------------------------*/ void mp_hal_delay_ms(mp_uint_t delay) { - uint64_t start_tick = ticks_ms; + uint64_t start_tick = supervisor_ticks_ms64(); uint64_t duration = 0; while (duration < delay) { RUN_BACKGROUND_TASKS; @@ -45,7 +46,7 @@ void mp_hal_delay_ms(mp_uint_t delay) { MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { break; } - duration = (ticks_ms - start_tick); + duration = (supervisor_ticks_ms64() - start_tick); // TODO(tannewt): Go to sleep for a little while while we wait. } } diff --git a/ports/nrf/mphalport.h b/ports/nrf/mphalport.h index a1929a4ace..8bb351401a 100644 --- a/ports/nrf/mphalport.h +++ b/ports/nrf/mphalport.h @@ -33,12 +33,11 @@ #include "lib/utils/interrupt_char.h" #include "nrfx_uarte.h" #include "py/mpconfig.h" +#include "supervisor/shared/tick.h" extern nrfx_uarte_t serial_instance; -extern volatile uint64_t ticks_ms; - -#define mp_hal_ticks_ms() ((mp_uint_t) ticks_ms) +#define mp_hal_ticks_ms() ((mp_uint_t) supervisor_ticks_ms32()) #define mp_hal_delay_us(us) NRFX_DELAY_US((uint32_t) (us)) bool mp_hal_stdin_any(void); diff --git a/ports/nrf/tick.c b/ports/nrf/tick.c index 6d8fd13e0a..ac825a7f1f 100644 --- a/ports/nrf/tick.c +++ b/ports/nrf/tick.c @@ -26,31 +26,14 @@ #include "tick.h" -#include "supervisor/shared/autoreload.h" -#include "supervisor/filesystem.h" +#include "supervisor/shared/tick.h" #include "shared-module/gamepad/__init__.h" #include "shared-bindings/microcontroller/Processor.h" #include "nrf.h" -// Global millisecond tick count -volatile uint64_t ticks_ms = 0; - void SysTick_Handler(void) { - // SysTick interrupt handler called when the SysTick timer reaches zero - // (every millisecond). - ticks_ms += 1; - -#if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0 - filesystem_tick(); -#endif -#ifdef CIRCUITPY_AUTORELOAD_DELAY_MS - autoreload_tick(); -#endif -#ifdef CIRCUITPY_GAMEPAD_TICKS - if (!(ticks_ms & CIRCUITPY_GAMEPAD_TICKS)) { - gamepad_tick(); - } -#endif + // Do things common to all ports when the tick occurs + supervisor_tick(); } void tick_init() { @@ -61,11 +44,11 @@ void tick_init() { void tick_delay(uint32_t us) { uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000; uint32_t us_between_ticks = SysTick->VAL / ticks_per_us; - uint64_t start_ms = ticks_ms; + uint64_t start_ms = supervisor_ticks_ms64(); while (us > 1000) { - while (ticks_ms == start_ms) {} + while (supervisor_ticks_ms64() == start_ms) {} us -= us_between_ticks; - start_ms = ticks_ms; + start_ms = supervisor_ticks_ms64(); us_between_ticks = 1000; } while (SysTick->VAL > ((us_between_ticks - us) * ticks_per_us)) {} @@ -74,11 +57,11 @@ void tick_delay(uint32_t us) { // us counts down! void current_tick(uint64_t* ms, uint32_t* us_until_ms) { uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000; - *ms = ticks_ms; + *ms = supervisor_ticks_ms64(); *us_until_ms = SysTick->VAL / ticks_per_us; } void wait_until(uint64_t ms, uint32_t us_until_ms) { uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000; - while(ticks_ms <= ms && SysTick->VAL / ticks_per_us >= us_until_ms) {} + while(supervisor_ticks_ms64() <= ms && SysTick->VAL / ticks_per_us >= us_until_ms) {} } diff --git a/ports/nrf/tick.h b/ports/nrf/tick.h index 838e9fbea8..d638ad0251 100644 --- a/ports/nrf/tick.h +++ b/ports/nrf/tick.h @@ -30,8 +30,6 @@ #include -extern volatile uint64_t ticks_ms; - extern struct timer_descriptor ms_timer; void tick_init(void); diff --git a/ports/stm32f4/common-hal/time/__init__.c b/ports/stm32f4/common-hal/time/__init__.c index e3cb481ef4..976f519db2 100644 --- a/ports/stm32f4/common-hal/time/__init__.c +++ b/ports/stm32f4/common-hal/time/__init__.c @@ -29,7 +29,7 @@ #include "tick.h" uint64_t common_hal_time_monotonic(void) { - return ticks_ms; + return supervisor_ticks_ms64(); } void common_hal_time_delay_ms(uint32_t delay) { diff --git a/ports/stm32f4/mphalport.c b/ports/stm32f4/mphalport.c index ea864e7ceb..f78e9c7501 100644 --- a/ports/stm32f4/mphalport.c +++ b/ports/stm32f4/mphalport.c @@ -31,11 +31,13 @@ #include "py/mpstate.h" #include "py/gc.h" +#include "supervisor/shared/tick.h" + /*------------------------------------------------------------------*/ /* delay *------------------------------------------------------------------*/ void mp_hal_delay_ms(mp_uint_t delay) { - uint64_t start_tick = ticks_ms; + uint64_t start_tick = supervisor_ticks_ms64(); uint64_t duration = 0; while (duration < delay) { #ifdef MICROPY_VM_HOOK_LOOP @@ -46,7 +48,7 @@ void mp_hal_delay_ms(mp_uint_t delay) { MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { break; } - duration = (ticks_ms - start_tick); + duration = (supervisor_ticks_ms64() - start_tick); // TODO(tannewt): Go to sleep for a little while while we wait. } } diff --git a/ports/stm32f4/mphalport.h b/ports/stm32f4/mphalport.h index d184138f78..df2f0ca65a 100644 --- a/ports/stm32f4/mphalport.h +++ b/ports/stm32f4/mphalport.h @@ -32,10 +32,10 @@ #include "lib/utils/interrupt_char.h" #include "py/mpconfig.h" +#include "supervisor/shared/tick.h" -extern volatile uint64_t ticks_ms; -#define mp_hal_ticks_ms() ((mp_uint_t) ticks_ms) +#define mp_hal_ticks_ms() ((mp_uint_t) supervisor_ticks_ms32()) //#define mp_hal_delay_us(us) NRFX_DELAY_US((uint32_t) (us)) bool mp_hal_stdin_any(void); diff --git a/ports/stm32f4/tick.c b/ports/stm32f4/tick.c index 688f71dbd4..f4adf183aa 100644 --- a/ports/stm32f4/tick.c +++ b/ports/stm32f4/tick.c @@ -26,37 +26,23 @@ #include "tick.h" -#include "supervisor/shared/autoreload.h" #include "supervisor/filesystem.h" -#include "shared-module/gamepad/__init__.h" +#include "supervisor/shared/tick.h" #include "shared-bindings/microcontroller/Processor.h" #include "stm32f4xx.h" -// Global millisecond tick count -volatile uint64_t ticks_ms = 0; - void SysTick_Handler(void) { // SysTick interrupt handler called when the SysTick timer reaches zero // (every millisecond). - ticks_ms += 1; -#if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0 - filesystem_tick(); -#endif -#ifdef CIRCUITPY_AUTORELOAD_DELAY_MS - autoreload_tick(); -#endif -#ifdef CIRCUITPY_GAMEPAD_TICKS - if (!(ticks_ms & CIRCUITPY_GAMEPAD_TICKS)) { - gamepad_tick(); - } -#endif + // Do things common to all ports when the tick occurs + supervisor_tick(); } uint32_t HAL_GetTick(void) //override ST HAL { - return (uint32_t)ticks_ms; + return (uint32_t)supervisor_ticks_ms32(); } void tick_init() { @@ -72,11 +58,11 @@ void tick_init() { void tick_delay(uint32_t us) { uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; uint32_t us_between_ticks = SysTick->VAL / ticks_per_us; - uint64_t start_ms = ticks_ms; + uint64_t start_ms = supervisor_ticks_ms64(); while (us > 1000) { - while (ticks_ms == start_ms) {} + while (supervisor_ticks_ms64() == start_ms) {} us -= us_between_ticks; - start_ms = ticks_ms; + start_ms = supervisor_ticks_ms64(); us_between_ticks = 1000; } while (SysTick->VAL > ((us_between_ticks - us) * ticks_per_us)) {} @@ -85,11 +71,11 @@ void tick_delay(uint32_t us) { // us counts down! void current_tick(uint64_t* ms, uint32_t* us_until_ms) { uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; - *ms = ticks_ms; + *ms = supervisor_ticks_ms32(); *us_until_ms = SysTick->VAL / ticks_per_us; } void wait_until(uint64_t ms, uint32_t us_until_ms) { uint32_t ticks_per_us = SystemCoreClock / 1000 / 1000; - while(ticks_ms <= ms && SysTick->VAL / ticks_per_us >= us_until_ms) {} + while(supervisor_ticks_ms64() <= ms && SysTick->VAL / ticks_per_us >= us_until_ms) {} } diff --git a/ports/stm32f4/tick.h b/ports/stm32f4/tick.h index e4772fa2cf..999acc7a3c 100644 --- a/ports/stm32f4/tick.h +++ b/ports/stm32f4/tick.h @@ -30,8 +30,6 @@ #include -extern volatile uint64_t ticks_ms; - extern struct timer_descriptor ms_timer; void tick_init(void); diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 61d3242919..7853e4de95 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -32,6 +32,7 @@ #define __INCLUDED_MPCONFIG_CIRCUITPY_H #include +#include // This is CircuitPython. #define CIRCUITPY 1 diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 862d2cf598..11db0f8ff2 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -35,6 +35,7 @@ #include "shared-module/displayio/__init__.h" #include "shared-module/displayio/display_core.h" #include "supervisor/shared/display.h" +#include "supervisor/shared/tick.h" #include "supervisor/usb.h" #include @@ -313,7 +314,7 @@ uint16_t common_hal_displayio_display_get_rotation(displayio_display_obj_t* self bool common_hal_displayio_display_refresh(displayio_display_obj_t* self, uint32_t target_ms_per_frame, uint32_t maximum_ms_per_real_frame) { if (!self->auto_refresh && !self->first_manual_refresh) { - uint64_t current_time = ticks_ms; + uint64_t current_time = supervisor_ticks_ms64(); uint32_t current_ms_since_real_refresh = current_time - self->core.last_refresh; // Test to see if the real frame time is below our minimum. if (current_ms_since_real_refresh > maximum_ms_per_real_frame) { @@ -327,7 +328,7 @@ bool common_hal_displayio_display_refresh(displayio_display_obj_t* self, uint32_ } uint32_t remaining_time = target_ms_per_frame - (current_ms_since_real_refresh % target_ms_per_frame); // We're ahead of the game so wait until we align with the frame rate. - while (ticks_ms - self->last_refresh_call < remaining_time) { + while (supervisor_ticks_ms64() - self->last_refresh_call < remaining_time) { RUN_BACKGROUND_TASKS; } } @@ -350,20 +351,20 @@ STATIC void _update_backlight(displayio_display_obj_t* self) { if (!self->auto_brightness || self->updating_backlight) { return; } - if (ticks_ms - self->last_backlight_refresh < 100) { + if (supervisor_ticks_ms64() - self->last_backlight_refresh < 100) { return; } // TODO(tannewt): Fade the backlight based on it's existing value and a target value. The target // should account for ambient light when possible. common_hal_displayio_display_set_brightness(self, 1.0); - self->last_backlight_refresh = ticks_ms; + self->last_backlight_refresh = supervisor_ticks_ms64(); } void displayio_display_background(displayio_display_obj_t* self) { _update_backlight(self); - if (self->auto_refresh && (ticks_ms - self->core.last_refresh) > self->native_ms_per_frame) { + if (self->auto_refresh && (supervisor_ticks_ms64() - self->core.last_refresh) > self->native_ms_per_frame) { _refresh_display(self); } } diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index df1d5162b7..ad2559a83b 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -35,6 +35,7 @@ #include "shared-bindings/time/__init__.h" #include "shared-module/displayio/__init__.h" #include "supervisor/shared/display.h" +#include "supervisor/shared/tick.h" #include "supervisor/usb.h" #include @@ -175,7 +176,7 @@ uint32_t common_hal_displayio_epaperdisplay_get_time_to_refresh(displayio_epaper return 0; } // Refresh at seconds per frame rate. - uint32_t elapsed_time = ticks_ms - self->core.last_refresh; + uint32_t elapsed_time = supervisor_ticks_ms64() - self->core.last_refresh; if (elapsed_time > self->milliseconds_per_frame) { return 0; } @@ -339,7 +340,7 @@ void displayio_epaperdisplay_background(displayio_epaperdisplay_obj_t* self) { bool busy = common_hal_digitalio_digitalinout_get_value(&self->busy); refresh_done = busy != self->busy_state; } else { - refresh_done = ticks_ms - self->core.last_refresh > self->refresh_time; + refresh_done = supervisor_ticks_ms64() - self->core.last_refresh > self->refresh_time; } if (refresh_done) { self->refreshing = false; diff --git a/shared-module/displayio/display_core.c b/shared-module/displayio/display_core.c index a73ea81d1f..658daa8d69 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -35,6 +35,7 @@ #include "shared-bindings/time/__init__.h" #include "shared-module/displayio/__init__.h" #include "supervisor/shared/display.h" +#include "supervisor/shared/tick.h" #include #include @@ -281,7 +282,7 @@ void displayio_display_core_set_region_to_update(displayio_display_core_t* self, } void displayio_display_core_start_refresh(displayio_display_core_t* self) { - self->last_refresh = ticks_ms; + self->last_refresh = supervisor_ticks_ms64(); } void displayio_display_core_finish_refresh(displayio_display_core_t* self) { @@ -289,7 +290,7 @@ void displayio_display_core_finish_refresh(displayio_display_core_t* self) { displayio_group_finish_refresh(self->current_group); } self->full_refresh = false; - self->last_refresh = ticks_ms; + self->last_refresh = supervisor_ticks_ms64(); } void release_display_core(displayio_display_core_t* self) { diff --git a/shared-module/network/__init__.c b/shared-module/network/__init__.c index 96648b260c..925e9a2a30 100644 --- a/shared-module/network/__init__.c +++ b/shared-module/network/__init__.c @@ -31,6 +31,8 @@ #include "py/mphal.h" #include "py/mperrno.h" +#include "supervisor/shared/tick.h" + #include "shared-bindings/random/__init__.h" #include "shared-module/network/__init__.h" @@ -53,7 +55,7 @@ void network_module_deinit(void) { void network_module_background(void) { static uint32_t next_tick = 0; - uint32_t this_tick = ticks_ms; + uint32_t this_tick = supervisor_ticks_ms32(); if (this_tick < next_tick) return; next_tick = this_tick + 1000; diff --git a/shared-module/usb_hid/Device.c b/shared-module/usb_hid/Device.c index bed7d163f9..8744f2ed31 100644 --- a/shared-module/usb_hid/Device.c +++ b/shared-module/usb_hid/Device.c @@ -30,6 +30,7 @@ #include "shared-bindings/usb_hid/Device.h" #include "shared-module/usb_hid/Device.h" #include "supervisor/shared/translate.h" +#include "supervisor/shared/tick.h" #include "tusb.h" uint8_t common_hal_usb_hid_device_get_usage_page(usb_hid_device_obj_t *self) { @@ -46,8 +47,8 @@ void common_hal_usb_hid_device_send_report(usb_hid_device_obj_t *self, uint8_t* } // Wait until interface is ready, timeout = 2 seconds - uint64_t end_ticks = ticks_ms + 2000; - while ( (ticks_ms < end_ticks) && !tud_hid_ready() ) { + uint64_t end_ticks = supervisor_ticks_ms64() + 2000; + while ( (supervisor_ticks_ms64() < end_ticks) && !tud_hid_ready() ) { RUN_BACKGROUND_TASKS; } diff --git a/supervisor/shared/rgb_led_status.c b/supervisor/shared/rgb_led_status.c index 940cbf1f27..f751a7ffd5 100644 --- a/supervisor/shared/rgb_led_status.c +++ b/supervisor/shared/rgb_led_status.c @@ -27,6 +27,7 @@ #include "mphalport.h" #include "shared-bindings/microcontroller/Pin.h" #include "rgb_led_status.h" +#include "supervisor/shared/tick.h" #ifdef MICROPY_HW_NEOPIXEL uint8_t rgb_status_brightness = 63; @@ -360,7 +361,7 @@ void prep_rgb_status_animation(const pyexec_result_t* result, rgb_status_animation_t* status) { #if defined(MICROPY_HW_NEOPIXEL) || (defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK)) || (defined(CP_RGB_STATUS_LED)) new_status_color(ALL_DONE); - status->pattern_start = ticks_ms; + status->pattern_start = supervisor_ticks_ms32(); status->safe_mode = safe_mode; status->found_main = found_main; status->total_exception_cycle = 0; @@ -405,11 +406,11 @@ void prep_rgb_status_animation(const pyexec_result_t* result, void tick_rgb_status_animation(rgb_status_animation_t* status) { #if defined(MICROPY_HW_NEOPIXEL) || (defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK)) || (defined(CP_RGB_STATUS_LED)) - uint32_t tick_diff = ticks_ms - status->pattern_start; + uint32_t tick_diff = supervisor_ticks_ms32() - status->pattern_start; if (status->ok) { // All is good. Ramp ALL_DONE up and down. if (tick_diff > ALL_GOOD_CYCLE_MS) { - status->pattern_start = ticks_ms; + status->pattern_start = supervisor_ticks_ms32(); tick_diff = 0; } @@ -424,7 +425,7 @@ void tick_rgb_status_animation(rgb_status_animation_t* status) { } } else { if (tick_diff > status->total_exception_cycle) { - status->pattern_start = ticks_ms; + status->pattern_start = supervisor_ticks_ms32(); tick_diff = 0; } // First flash the file color. diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c index d8d3ab379c..363181da06 100644 --- a/supervisor/shared/safe_mode.c +++ b/supervisor/shared/safe_mode.c @@ -34,6 +34,7 @@ #include "supervisor/shared/rgb_led_colors.h" #include "supervisor/shared/rgb_led_status.h" #include "supervisor/shared/translate.h" +#include "supervisor/shared/tick.h" #define SAFE_MODE_DATA_GUARD 0xad0000af #define SAFE_MODE_DATA_GUARD_MASK 0xff0000ff @@ -59,14 +60,14 @@ safe_mode_t wait_for_safe_mode_reset(void) { common_hal_digitalio_digitalinout_construct(&status_led, MICROPY_HW_LED_STATUS); common_hal_digitalio_digitalinout_switch_to_output(&status_led, true, DRIVE_MODE_PUSH_PULL); #endif - uint64_t start_ticks = ticks_ms; + uint64_t start_ticks = supervisor_ticks_ms64(); uint64_t diff = 0; while (diff < 700) { #ifdef MICROPY_HW_LED_STATUS // Blink on for 100, off for 100, on for 100, off for 100 and on for 200 common_hal_digitalio_digitalinout_set_value(&status_led, diff > 100 && diff / 100 != 2 && diff / 100 != 4); #endif - diff = ticks_ms - start_ticks; + diff = supervisor_ticks_ms64() - start_ticks; } #ifdef MICROPY_HW_LED_STATUS common_hal_digitalio_digitalinout_deinit(&status_led); diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c new file mode 100644 index 0000000000..d4a6ac5d75 --- /dev/null +++ b/supervisor/shared/tick.c @@ -0,0 +1,76 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 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 + * 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/shared/tick.h" +#include "supervisor/filesystem.h" +#include "supervisor/shared/autoreload.h" + +static volatile uint64_t ticks_ms; + +#if CIRCUITPY_GAMEPAD +#include "shared-module/gamepad/__init__.h" +#endif + +#if CIRCUITPY_GAMEPADSHIFT +#include "shared-module/gamepadshift/__init__.h" +#endif + +#include "shared-bindings/microcontroller/__init__.h" + +void supervisor_tick(void) { + + ticks_ms ++; + + +#if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0 + filesystem_tick(); +#endif +#ifdef CIRCUITPY_AUTORELOAD_DELAY_MS + autoreload_tick(); +#endif +#ifdef CIRCUITPY_GAMEPAD_TICKS + if (!(ticks_ms & CIRCUITPY_GAMEPAD_TICKS)) { + #if CIRCUITPY_GAMEPAD + gamepad_tick(); + #endif + #if CIRCUITPY_GAMEPADSHIFT + gamepadshift_tick(); + #endif + } +#endif +} + +uint64_t supervisor_ticks_ms64() { + uint64_t result; + common_hal_mcu_disable_interrupts(); + result = ticks_ms; + common_hal_mcu_enable_interrupts(); + return result; +} + +uint32_t supervisor_ticks_ms32() { + return ticks_ms; +} diff --git a/supervisor/shared/tick.h b/supervisor/shared/tick.h new file mode 100644 index 0000000000..3defeb1081 --- /dev/null +++ b/supervisor/shared/tick.h @@ -0,0 +1,37 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 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 + * 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 __INCLUDED_SUPERVISOR_TICK_H +#define __INCLUDED_SUPERVISOR_TICK_H + +#include +#include + +extern void supervisor_tick(void); +extern uint32_t supervisor_ticks_ms32(void); +extern uint64_t supervisor_ticks_ms64(void); + +#endif diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index b2e4eb1dcf..5e997ee78e 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -10,6 +10,7 @@ SRC_SUPERVISOR = \ supervisor/shared/safe_mode.c \ supervisor/shared/stack.c \ supervisor/shared/status_leds.c \ + supervisor/shared/tick.c \ supervisor/shared/translate.c ifndef $(NO_USB) From 40a47d41dfea885ecfbc6a6fe1fc2ec5124a293b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 18 Nov 2019 10:51:16 -0600 Subject: [PATCH 053/189] samd: background: Allow monitoring time taken in background task If you define MONITOR_BACKGROUND_TASK, then a physical output pin (Metro M4 Express's "SCL" pin by default) will be set HIGH while in the background task and LOW at other times --- ports/atmel-samd/background.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ports/atmel-samd/background.c b/ports/atmel-samd/background.c index 3b698768b8..ca91a31de6 100644 --- a/ports/atmel-samd/background.c +++ b/ports/atmel-samd/background.c @@ -45,6 +45,23 @@ bool stack_ok_so_far = true; static bool running_background_tasks = false; +#ifdef MONITOR_BACKGROUND_TASKS +// PB03 is physical pin "SCL" on the Metro M4 express +// so you can't use this code AND an i2c peripheral +// at the same time unless you change this +STATIC void start_background_task(void) { + REG_PORT_DIRSET1 = (1<<3); + REG_PORT_OUTSET1 = (1<<3); +} + +STATIC void finish_background_task(void) { + REG_PORT_OUTCLR1 = (1<<3); +} +#else +STATIC void start_background_task(void) {} +STATIC void finish_background_task(void) {} +#endif + void background_tasks_reset(void) { running_background_tasks = false; } @@ -54,6 +71,9 @@ void run_background_tasks(void) { if (running_background_tasks) { return; } + + start_background_task(); + assert_heap_ok(); running_background_tasks = true; @@ -73,6 +93,7 @@ void run_background_tasks(void) { assert_heap_ok(); last_finished_tick = supervisor_ticks_ms64(); + finish_background_task(); } bool background_tasks_ok(void) { From 568636d562b4c64d0095ff2ac921b79eb69e520d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 18 Nov 2019 09:53:12 -0600 Subject: [PATCH 054/189] run_background_tasks: Do nothing unless there has been a tick This improves performance of running python code by 34%, based on the "pystone" benchmark on metro m4 express at 5000 passes (1127.65 -> 1521.6 passes/second). In addition, by instrumenting the tick function and monitoring on an oscilloscope, the time actually spent in run_background_tasks() on the metro m4 decreases from average 43% to 0.5%. (however, there's some additional overhead that is moved around and not accounted for in that "0.5%" figure, each time supervisor_run_background_tasks_if_tick is called but no tick has occurred) On the CPB, it increases pystone from 633 to 769, a smaller percentage increase of 21%. I did not measure the time actually spent in run_background_tasks() on CPB. Testing performed: on metro m4 and cpb, run pystone adapted from python3.4 (change time.time to time.monotonic for sub-second resolution) Besides running a 5000 pass test, I also ran a 50-pass test while scoping how long an output pin was set. Average: 34.59ms or 1445/s on m4, 67.61ms or 739/s on cbp, both matching the other pystone result reasonably well. import pystone import board import digitalio import time d = digitalio.DigitalInOut(board.D13) d.direction = digitalio.Direction.OUTPUT while True: d.value = 0 time.sleep(.01) d.value = 1 pystone.main(50) --- py/circuitpy_mpconfig.h | 4 ++-- supervisor/shared/tick.c | 12 ++++++++++++ supervisor/shared/tick.h | 1 + 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 7853e4de95..3e83d0c510 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -653,8 +653,8 @@ extern const struct _mp_obj_module_t ustack_module; FLASH_ROOT_POINTERS \ NETWORK_ROOT_POINTERS \ -void run_background_tasks(void); -#define RUN_BACKGROUND_TASKS (run_background_tasks()) +void supervisor_run_background_tasks_if_tick(void); +#define RUN_BACKGROUND_TASKS (supervisor_run_background_tasks_if_tick()) // TODO: Used in wiznet5k driver, but may not be needed in the long run. #define MICROPY_THREAD_YIELD() diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index d4a6ac5d75..7dc5a52d32 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -24,10 +24,13 @@ * THE SOFTWARE. */ +#include + #include "supervisor/shared/tick.h" #include "supervisor/filesystem.h" #include "supervisor/shared/autoreload.h" +static atomic_bool tick_up; static volatile uint64_t ticks_ms; #if CIRCUITPY_GAMEPAD @@ -44,6 +47,7 @@ void supervisor_tick(void) { ticks_ms ++; + atomic_store(&tick_up, true); #if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0 filesystem_tick(); @@ -74,3 +78,11 @@ uint64_t supervisor_ticks_ms64() { uint32_t supervisor_ticks_ms32() { return ticks_ms; } + +extern void run_background_tasks(void); + +void supervisor_run_background_tasks_if_tick() { + if (atomic_exchange(&tick_up, false)) { + run_background_tasks(); + } +} diff --git a/supervisor/shared/tick.h b/supervisor/shared/tick.h index 3defeb1081..b662734492 100644 --- a/supervisor/shared/tick.h +++ b/supervisor/shared/tick.h @@ -33,5 +33,6 @@ extern void supervisor_tick(void); extern uint32_t supervisor_ticks_ms32(void); extern uint64_t supervisor_ticks_ms64(void); +extern void supervisor_run_background_if_tick(void); #endif From a4797327cd4ea9fd53e00bf2ecfc82c30e413cec Mon Sep 17 00:00:00 2001 From: Hierophect Date: Mon, 18 Nov 2019 13:51:59 -0500 Subject: [PATCH 055/189] add microcontroller toggles for status LED --- .../feather_stm32f405_express/mpconfigboard.h | 10 ++--- .../stm32f4/common-hal/microcontroller/Pin.c | 38 +++++++++++++------ 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.h b/ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.h index e2295dc5e7..dc88f695a9 100644 --- a/ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.h +++ b/ports/stm32f4/boards/feather_stm32f405_express/mpconfigboard.h @@ -35,13 +35,13 @@ #define AUTORESET_DELAY_MS 500 #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) -#define MICROPY_HW_NEOPIXEL &pin_PC00 +#define MICROPY_HW_NEOPIXEL (&pin_PC00) // On-board flash -#define SPI_FLASH_MOSI_PIN &pin_PB05 -#define SPI_FLASH_MISO_PIN &pin_PB04 -#define SPI_FLASH_SCK_PIN &pin_PB03 -#define SPI_FLASH_CS_PIN &pin_PA15 +#define SPI_FLASH_MOSI_PIN (&pin_PB05) +#define SPI_FLASH_MISO_PIN (&pin_PB04) +#define SPI_FLASH_SCK_PIN (&pin_PB03) +#define SPI_FLASH_CS_PIN (&pin_PA15) #define DEFAULT_I2C_BUS_SCL (&pin_PB06) #define DEFAULT_I2C_BUS_SDA (&pin_PB07) diff --git a/ports/stm32f4/common-hal/microcontroller/Pin.c b/ports/stm32f4/common-hal/microcontroller/Pin.c index 9380bf139a..21290e03c9 100644 --- a/ports/stm32f4/common-hal/microcontroller/Pin.c +++ b/ports/stm32f4/common-hal/microcontroller/Pin.c @@ -26,6 +26,8 @@ */ #include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/digitalio/DigitalInOut.h" +#include "supervisor/shared/rgb_led_status.h" #include "py/mphal.h" #include "stm32f4/pins.h" @@ -34,13 +36,6 @@ #ifdef MICROPY_HW_NEOPIXEL bool neopixel_in_use; #endif -#ifdef MICROPY_HW_APA102_MOSI -bool apa102_sck_in_use; -bool apa102_mosi_in_use; -#endif -#ifdef SPEAKER_ENABLE_PIN -bool speaker_enable_in_use; -#endif #if MCU_PACKAGE == 144 #define GPIO_PORT_COUNT 7 @@ -64,6 +59,10 @@ void reset_all_pins(void) { for (uint8_t i = 0; i < GPIO_PORT_COUNT; i++) { HAL_GPIO_DeInit(ports[i], ~never_reset_pins[i]); } + + #ifdef MICROPY_HW_NEOPIXEL + neopixel_in_use = false; + #endif } // Mark pin as free and return it to a quiescent state. @@ -71,13 +70,18 @@ void reset_pin_number(uint8_t pin_port, uint8_t pin_number) { if (pin_port == 0x0F) { return; } - - // Clear claimed bit. + // Clear claimed bit & reset claimed_pins[pin_port] &= ~(1<port && pin_number == MICROPY_HW_NEOPIXEL->number) { + neopixel_in_use = false; + rgb_led_status_init(); + return; + } + #endif +} void never_reset_pin_number(uint8_t pin_port, uint8_t pin_number) { never_reset_pins[pin_port] |= 1<port] |= 1<number; + + #ifdef MICROPY_HW_NEOPIXEL + if (pin == MICROPY_HW_NEOPIXEL) { + neopixel_in_use = true; + } + #endif } bool pin_number_is_free(uint8_t pin_port, uint8_t pin_number) { @@ -101,6 +111,12 @@ bool pin_number_is_free(uint8_t pin_port, uint8_t pin_number) { } bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t *pin) { + #ifdef MICROPY_HW_NEOPIXEL + if (pin == MICROPY_HW_NEOPIXEL) { + return !neopixel_in_use; + } + #endif + return pin_number_is_free(pin->port, pin->number); } From a0ef667a1474133b1d6e4c3d74020a68f9ae1671 Mon Sep 17 00:00:00 2001 From: Ayan Pahwa Date: Tue, 19 Nov 2019 01:59:29 +0530 Subject: [PATCH 056/189] Supervisor: create code.py file with sample code --- supervisor/shared/filesystem.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/supervisor/shared/filesystem.c b/supervisor/shared/filesystem.c index c50d7f4eeb..225dd8d047 100644 --- a/supervisor/shared/filesystem.c +++ b/supervisor/shared/filesystem.c @@ -69,6 +69,18 @@ static void make_empty_file(FATFS *fatfs, const char *path) { f_close(&fp); } + +static void make_sample_code_file(FATFS *fatfs) { + FIL fs; + UINT *char_written = 0; + const byte buffer[] = "print('Hello World!')"; + + //Create or modify existing code.py file + f_open(fatfs, &fs, "/code.py", FA_WRITE | FA_CREATE_ALWAYS); + f_write(&fs, buffer, sizeof(buffer), char_written); + f_close(&fs); +} + // we don't make this function static because it needs a lot of stack and we // want it to be executed without using stack within main() function void filesystem_init(bool create_allowed, bool force_create) { @@ -98,6 +110,8 @@ void filesystem_init(bool create_allowed, bool force_create) { make_empty_file(&vfs_fat->fatfs, "/.metadata_never_index"); make_empty_file(&vfs_fat->fatfs, "/.Trashes"); make_empty_file(&vfs_fat->fatfs, "/.fseventsd/no_log"); + // make a sample code.py file + make_sample_code_file(&vfs_fat->fatfs); // create empty lib directory f_mkdir(&vfs_fat->fatfs, "/lib"); From 256abf550534b479e17dbb61170059491d8a23de Mon Sep 17 00:00:00 2001 From: Hierophect Date: Mon, 18 Nov 2019 16:13:27 -0500 Subject: [PATCH 057/189] Add board folders --- ports/stm32f4/boards/meowbit_v121/board.c | 39 ++ .../boards/meowbit_v121/mpconfigboard.h | 52 +++ .../boards/meowbit_v121/mpconfigboard.mk | 19 + ports/stm32f4/boards/meowbit_v121/pins.c | 33 ++ .../boards/meowbit_v121/stm32f4xx_hal_conf.h | 440 ++++++++++++++++++ ports/stm32f4/boards/pyb_nano_v2/board.c | 39 ++ .../boards/pyb_nano_v2/mpconfigboard.h | 52 +++ .../boards/pyb_nano_v2/mpconfigboard.mk | 19 + ports/stm32f4/boards/pyb_nano_v2/pins.c | 33 ++ .../boards/pyb_nano_v2/stm32f4xx_hal_conf.h | 440 ++++++++++++++++++ .../boards/stm32f411ce_blackpill/board.c | 39 ++ .../stm32f411ce_blackpill/mpconfigboard.h | 52 +++ .../stm32f411ce_blackpill/mpconfigboard.mk | 19 + .../boards/stm32f411ce_blackpill/pins.c | 33 ++ .../stm32f4xx_hal_conf.h | 440 ++++++++++++++++++ 15 files changed, 1749 insertions(+) create mode 100644 ports/stm32f4/boards/meowbit_v121/board.c create mode 100644 ports/stm32f4/boards/meowbit_v121/mpconfigboard.h create mode 100644 ports/stm32f4/boards/meowbit_v121/mpconfigboard.mk create mode 100644 ports/stm32f4/boards/meowbit_v121/pins.c create mode 100644 ports/stm32f4/boards/meowbit_v121/stm32f4xx_hal_conf.h create mode 100644 ports/stm32f4/boards/pyb_nano_v2/board.c create mode 100644 ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.h create mode 100644 ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.mk create mode 100644 ports/stm32f4/boards/pyb_nano_v2/pins.c create mode 100644 ports/stm32f4/boards/pyb_nano_v2/stm32f4xx_hal_conf.h create mode 100644 ports/stm32f4/boards/stm32f411ce_blackpill/board.c create mode 100644 ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h create mode 100644 ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk create mode 100644 ports/stm32f4/boards/stm32f411ce_blackpill/pins.c create mode 100644 ports/stm32f4/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h diff --git a/ports/stm32f4/boards/meowbit_v121/board.c b/ports/stm32f4/boards/meowbit_v121/board.c new file mode 100644 index 0000000000..82b0c506ed --- /dev/null +++ b/ports/stm32f4/boards/meowbit_v121/board.c @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 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 "boards/board.h" +#include "mpconfigboard.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/stm32f4/boards/meowbit_v121/mpconfigboard.h b/ports/stm32f4/boards/meowbit_v121/mpconfigboard.h new file mode 100644 index 0000000000..67ddc885ae --- /dev/null +++ b/ports/stm32f4/boards/meowbit_v121/mpconfigboard.h @@ -0,0 +1,52 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland 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 "Feather STM32F405 Express" +#define MICROPY_HW_MCU_NAME "STM32F405RG" + +#define FLASH_SIZE (0x100000) +#define FLASH_PAGE_SIZE (0x4000) + +#define AUTORESET_DELAY_MS 500 +#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) + +// On-board flash +#define SPI_FLASH_MOSI_PIN &pin_PB05 +#define SPI_FLASH_MISO_PIN &pin_PB04 +#define SPI_FLASH_SCK_PIN &pin_PB03 +#define SPI_FLASH_CS_PIN &pin_PA15 + +#define DEFAULT_I2C_BUS_SCL (&pin_PB06) +#define DEFAULT_I2C_BUS_SDA (&pin_PB07) + +#define DEFAULT_SPI_BUS_SCK (&pin_PB13) +#define DEFAULT_SPI_BUS_MOSI (&pin_PB15) +#define DEFAULT_SPI_BUS_MISO (&pin_PB14) + +#define DEFAULT_UART_BUS_RX (&pin_PB11) +#define DEFAULT_UART_BUS_TX (&pin_PB10) diff --git a/ports/stm32f4/boards/meowbit_v121/mpconfigboard.mk b/ports/stm32f4/boards/meowbit_v121/mpconfigboard.mk new file mode 100644 index 0000000000..5bad4e81f3 --- /dev/null +++ b/ports/stm32f4/boards/meowbit_v121/mpconfigboard.mk @@ -0,0 +1,19 @@ +USB_VID = 0x239A +USB_PID = 0x805A +USB_PRODUCT = "Feather STM32F405 Express" +USB_MANUFACTURER = "Adafruit Industries LLC" +USB_DEVICES = "CDC,MSC" + +SPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = GD25Q16C +LONGINT_IMPL = MPZ + +MCU_SERIES = m4 +MCU_VARIANT = stm32f4 +MCU_SUB_VARIANT = stm32f405xx +MCU_PACKAGE = 64 +CMSIS_MCU = STM32F405xx +LD_FILE = boards/STM32F405.ld +TEXT0_ADDR = 0x08000000 +TEXT1_ADDR = 0x08010000 \ No newline at end of file diff --git a/ports/stm32f4/boards/meowbit_v121/pins.c b/ports/stm32f4/boards/meowbit_v121/pins.c new file mode 100644 index 0000000000..4aa1f362ad --- /dev/null +++ b/ports/stm32f4/boards/meowbit_v121/pins.c @@ -0,0 +1,33 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PC04) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PC05) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PC07) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PC06) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PC03) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PC01) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB15) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB11) }, + + { 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_module_globals_table); diff --git a/ports/stm32f4/boards/meowbit_v121/stm32f4xx_hal_conf.h b/ports/stm32f4/boards/meowbit_v121/stm32f4xx_hal_conf.h new file mode 100644 index 0000000000..68a49b4ba8 --- /dev/null +++ b/ports/stm32f4/boards/meowbit_v121/stm32f4xx_hal_conf.h @@ -0,0 +1,440 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED + +#define HAL_ADC_MODULE_ENABLED +/* #define HAL_CRYP_MODULE_ENABLED */ +/* #define HAL_CAN_MODULE_ENABLED */ +/* #define HAL_CRC_MODULE_ENABLED */ +/* #define HAL_CRYP_MODULE_ENABLED */ +#define HAL_DAC_MODULE_ENABLED +/* #define HAL_DCMI_MODULE_ENABLED */ +/* #define HAL_DMA2D_MODULE_ENABLED */ +/* #define HAL_ETH_MODULE_ENABLED */ +/* #define HAL_NAND_MODULE_ENABLED */ +/* #define HAL_NOR_MODULE_ENABLED */ +/* #define HAL_PCCARD_MODULE_ENABLED */ +/* #define HAL_SRAM_MODULE_ENABLED */ +/* #define HAL_SDRAM_MODULE_ENABLED */ +/* #define HAL_HASH_MODULE_ENABLED */ +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +/* #define HAL_IWDG_MODULE_ENABLED */ +/* #define HAL_LTDC_MODULE_ENABLED */ +/* #define HAL_RNG_MODULE_ENABLED */ +/* #define HAL_RTC_MODULE_ENABLED */ +/* #define HAL_SAI_MODULE_ENABLED */ +/* #define HAL_SD_MODULE_ENABLED */ +/* #define HAL_MMC_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +/* #define HAL_IRDA_MODULE_ENABLED */ +/* #define HAL_SMARTCARD_MODULE_ENABLED */ +/* #define HAL_WWDG_MODULE_ENABLED */ +#define HAL_PCD_MODULE_ENABLED +/* #define HAL_HCD_MODULE_ENABLED */ +/* #define HAL_DSI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_CEC_MODULE_ENABLED */ +/* #define HAL_FMPI2C_MODULE_ENABLED */ +/* #define HAL_SPDIFRX_MODULE_ENABLED */ +/* #define HAL_DFSDM_MODULE_ENABLED */ +/* #define HAL_LPTIM_MODULE_ENABLED */ +/* #define HAL_EXTI_MODULE_ENABLED */ +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)12000000) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)40000) +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848_PHY_ADDRESS Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) + +#define PHY_READ_TO ((uint32_t)0x0000FFFFU) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ +#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ + +#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f4xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_FMPI2C_MODULE_ENABLED + #include "stm32f4xx_hal_fmpi2c.h" +#endif /* HAL_FMPI2C_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f4xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm32f4/boards/pyb_nano_v2/board.c b/ports/stm32f4/boards/pyb_nano_v2/board.c new file mode 100644 index 0000000000..82b0c506ed --- /dev/null +++ b/ports/stm32f4/boards/pyb_nano_v2/board.c @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 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 "boards/board.h" +#include "mpconfigboard.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.h b/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.h new file mode 100644 index 0000000000..67ddc885ae --- /dev/null +++ b/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.h @@ -0,0 +1,52 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland 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 "Feather STM32F405 Express" +#define MICROPY_HW_MCU_NAME "STM32F405RG" + +#define FLASH_SIZE (0x100000) +#define FLASH_PAGE_SIZE (0x4000) + +#define AUTORESET_DELAY_MS 500 +#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) + +// On-board flash +#define SPI_FLASH_MOSI_PIN &pin_PB05 +#define SPI_FLASH_MISO_PIN &pin_PB04 +#define SPI_FLASH_SCK_PIN &pin_PB03 +#define SPI_FLASH_CS_PIN &pin_PA15 + +#define DEFAULT_I2C_BUS_SCL (&pin_PB06) +#define DEFAULT_I2C_BUS_SDA (&pin_PB07) + +#define DEFAULT_SPI_BUS_SCK (&pin_PB13) +#define DEFAULT_SPI_BUS_MOSI (&pin_PB15) +#define DEFAULT_SPI_BUS_MISO (&pin_PB14) + +#define DEFAULT_UART_BUS_RX (&pin_PB11) +#define DEFAULT_UART_BUS_TX (&pin_PB10) diff --git a/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.mk b/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.mk new file mode 100644 index 0000000000..5bad4e81f3 --- /dev/null +++ b/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.mk @@ -0,0 +1,19 @@ +USB_VID = 0x239A +USB_PID = 0x805A +USB_PRODUCT = "Feather STM32F405 Express" +USB_MANUFACTURER = "Adafruit Industries LLC" +USB_DEVICES = "CDC,MSC" + +SPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = GD25Q16C +LONGINT_IMPL = MPZ + +MCU_SERIES = m4 +MCU_VARIANT = stm32f4 +MCU_SUB_VARIANT = stm32f405xx +MCU_PACKAGE = 64 +CMSIS_MCU = STM32F405xx +LD_FILE = boards/STM32F405.ld +TEXT0_ADDR = 0x08000000 +TEXT1_ADDR = 0x08010000 \ No newline at end of file diff --git a/ports/stm32f4/boards/pyb_nano_v2/pins.c b/ports/stm32f4/boards/pyb_nano_v2/pins.c new file mode 100644 index 0000000000..4aa1f362ad --- /dev/null +++ b/ports/stm32f4/boards/pyb_nano_v2/pins.c @@ -0,0 +1,33 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PC04) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PC05) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PC07) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PC06) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PC03) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PC01) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB15) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB11) }, + + { 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_module_globals_table); diff --git a/ports/stm32f4/boards/pyb_nano_v2/stm32f4xx_hal_conf.h b/ports/stm32f4/boards/pyb_nano_v2/stm32f4xx_hal_conf.h new file mode 100644 index 0000000000..68a49b4ba8 --- /dev/null +++ b/ports/stm32f4/boards/pyb_nano_v2/stm32f4xx_hal_conf.h @@ -0,0 +1,440 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED + +#define HAL_ADC_MODULE_ENABLED +/* #define HAL_CRYP_MODULE_ENABLED */ +/* #define HAL_CAN_MODULE_ENABLED */ +/* #define HAL_CRC_MODULE_ENABLED */ +/* #define HAL_CRYP_MODULE_ENABLED */ +#define HAL_DAC_MODULE_ENABLED +/* #define HAL_DCMI_MODULE_ENABLED */ +/* #define HAL_DMA2D_MODULE_ENABLED */ +/* #define HAL_ETH_MODULE_ENABLED */ +/* #define HAL_NAND_MODULE_ENABLED */ +/* #define HAL_NOR_MODULE_ENABLED */ +/* #define HAL_PCCARD_MODULE_ENABLED */ +/* #define HAL_SRAM_MODULE_ENABLED */ +/* #define HAL_SDRAM_MODULE_ENABLED */ +/* #define HAL_HASH_MODULE_ENABLED */ +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +/* #define HAL_IWDG_MODULE_ENABLED */ +/* #define HAL_LTDC_MODULE_ENABLED */ +/* #define HAL_RNG_MODULE_ENABLED */ +/* #define HAL_RTC_MODULE_ENABLED */ +/* #define HAL_SAI_MODULE_ENABLED */ +/* #define HAL_SD_MODULE_ENABLED */ +/* #define HAL_MMC_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +/* #define HAL_IRDA_MODULE_ENABLED */ +/* #define HAL_SMARTCARD_MODULE_ENABLED */ +/* #define HAL_WWDG_MODULE_ENABLED */ +#define HAL_PCD_MODULE_ENABLED +/* #define HAL_HCD_MODULE_ENABLED */ +/* #define HAL_DSI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_CEC_MODULE_ENABLED */ +/* #define HAL_FMPI2C_MODULE_ENABLED */ +/* #define HAL_SPDIFRX_MODULE_ENABLED */ +/* #define HAL_DFSDM_MODULE_ENABLED */ +/* #define HAL_LPTIM_MODULE_ENABLED */ +/* #define HAL_EXTI_MODULE_ENABLED */ +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)12000000) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)40000) +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848_PHY_ADDRESS Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) + +#define PHY_READ_TO ((uint32_t)0x0000FFFFU) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ +#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ + +#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f4xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_FMPI2C_MODULE_ENABLED + #include "stm32f4xx_hal_fmpi2c.h" +#endif /* HAL_FMPI2C_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f4xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/board.c b/ports/stm32f4/boards/stm32f411ce_blackpill/board.c new file mode 100644 index 0000000000..82b0c506ed --- /dev/null +++ b/ports/stm32f4/boards/stm32f411ce_blackpill/board.c @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 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 "boards/board.h" +#include "mpconfigboard.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h new file mode 100644 index 0000000000..67ddc885ae --- /dev/null +++ b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h @@ -0,0 +1,52 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland 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 "Feather STM32F405 Express" +#define MICROPY_HW_MCU_NAME "STM32F405RG" + +#define FLASH_SIZE (0x100000) +#define FLASH_PAGE_SIZE (0x4000) + +#define AUTORESET_DELAY_MS 500 +#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) + +// On-board flash +#define SPI_FLASH_MOSI_PIN &pin_PB05 +#define SPI_FLASH_MISO_PIN &pin_PB04 +#define SPI_FLASH_SCK_PIN &pin_PB03 +#define SPI_FLASH_CS_PIN &pin_PA15 + +#define DEFAULT_I2C_BUS_SCL (&pin_PB06) +#define DEFAULT_I2C_BUS_SDA (&pin_PB07) + +#define DEFAULT_SPI_BUS_SCK (&pin_PB13) +#define DEFAULT_SPI_BUS_MOSI (&pin_PB15) +#define DEFAULT_SPI_BUS_MISO (&pin_PB14) + +#define DEFAULT_UART_BUS_RX (&pin_PB11) +#define DEFAULT_UART_BUS_TX (&pin_PB10) diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk new file mode 100644 index 0000000000..5bad4e81f3 --- /dev/null +++ b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk @@ -0,0 +1,19 @@ +USB_VID = 0x239A +USB_PID = 0x805A +USB_PRODUCT = "Feather STM32F405 Express" +USB_MANUFACTURER = "Adafruit Industries LLC" +USB_DEVICES = "CDC,MSC" + +SPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = GD25Q16C +LONGINT_IMPL = MPZ + +MCU_SERIES = m4 +MCU_VARIANT = stm32f4 +MCU_SUB_VARIANT = stm32f405xx +MCU_PACKAGE = 64 +CMSIS_MCU = STM32F405xx +LD_FILE = boards/STM32F405.ld +TEXT0_ADDR = 0x08000000 +TEXT1_ADDR = 0x08010000 \ No newline at end of file diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/pins.c b/ports/stm32f4/boards/stm32f411ce_blackpill/pins.c new file mode 100644 index 0000000000..4aa1f362ad --- /dev/null +++ b/ports/stm32f4/boards/stm32f411ce_blackpill/pins.c @@ -0,0 +1,33 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PC04) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PC05) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PC07) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PC06) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PC03) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PC01) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB15) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB11) }, + + { 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_module_globals_table); diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h b/ports/stm32f4/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h new file mode 100644 index 0000000000..68a49b4ba8 --- /dev/null +++ b/ports/stm32f4/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h @@ -0,0 +1,440 @@ +/** + ****************************************************************************** + * @file stm32f4xx_hal_conf_template.h + * @author MCD Application Team + * @brief HAL configuration template file. + * This file should be copied to the application folder and renamed + * to stm32f4xx_hal_conf.h. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2017 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F4xx_HAL_CONF_H +#define __STM32F4xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED + +#define HAL_ADC_MODULE_ENABLED +/* #define HAL_CRYP_MODULE_ENABLED */ +/* #define HAL_CAN_MODULE_ENABLED */ +/* #define HAL_CRC_MODULE_ENABLED */ +/* #define HAL_CRYP_MODULE_ENABLED */ +#define HAL_DAC_MODULE_ENABLED +/* #define HAL_DCMI_MODULE_ENABLED */ +/* #define HAL_DMA2D_MODULE_ENABLED */ +/* #define HAL_ETH_MODULE_ENABLED */ +/* #define HAL_NAND_MODULE_ENABLED */ +/* #define HAL_NOR_MODULE_ENABLED */ +/* #define HAL_PCCARD_MODULE_ENABLED */ +/* #define HAL_SRAM_MODULE_ENABLED */ +/* #define HAL_SDRAM_MODULE_ENABLED */ +/* #define HAL_HASH_MODULE_ENABLED */ +#define HAL_I2C_MODULE_ENABLED +#define HAL_I2S_MODULE_ENABLED +/* #define HAL_IWDG_MODULE_ENABLED */ +/* #define HAL_LTDC_MODULE_ENABLED */ +/* #define HAL_RNG_MODULE_ENABLED */ +/* #define HAL_RTC_MODULE_ENABLED */ +/* #define HAL_SAI_MODULE_ENABLED */ +/* #define HAL_SD_MODULE_ENABLED */ +/* #define HAL_MMC_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +#define HAL_USART_MODULE_ENABLED +/* #define HAL_IRDA_MODULE_ENABLED */ +/* #define HAL_SMARTCARD_MODULE_ENABLED */ +/* #define HAL_WWDG_MODULE_ENABLED */ +#define HAL_PCD_MODULE_ENABLED +/* #define HAL_HCD_MODULE_ENABLED */ +/* #define HAL_DSI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_QSPI_MODULE_ENABLED */ +/* #define HAL_CEC_MODULE_ENABLED */ +/* #define HAL_FMPI2C_MODULE_ENABLED */ +/* #define HAL_SPDIFRX_MODULE_ENABLED */ +/* #define HAL_DFSDM_MODULE_ENABLED */ +/* #define HAL_LPTIM_MODULE_ENABLED */ +/* #define HAL_EXTI_MODULE_ENABLED */ +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED + +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)12000000) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)40000) +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## Ethernet peripheral configuration ##################### */ + +/* Section 1 : Ethernet peripheral configuration */ + +/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ +#define MAC_ADDR0 2U +#define MAC_ADDR1 0U +#define MAC_ADDR2 0U +#define MAC_ADDR3 0U +#define MAC_ADDR4 0U +#define MAC_ADDR5 0U + +/* Definition of the Ethernet driver buffers size and count */ +#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ +#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ +#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ +#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ + +/* Section 2: PHY configuration section */ + +/* DP83848_PHY_ADDRESS Address*/ +#define DP83848_PHY_ADDRESS 0x01U +/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ +#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) +/* PHY Configuration delay */ +#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) + +#define PHY_READ_TO ((uint32_t)0x0000FFFFU) +#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) + +/* Section 3: Common PHY Registers */ + +#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ +#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ + +#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ +#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ +#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ +#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ +#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ +#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ +#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ +#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ +#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ +#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ + +#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ +#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ +#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ + +/* Section 4: Extended PHY Registers */ +#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ + +#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ +#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver +* Activated: CRC code is present inside driver +* Deactivated: CRC code cleaned from driver +*/ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f4xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f4xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f4xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f4xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f4xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f4xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f4xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f4xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32f4xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DMA2D_MODULE_ENABLED + #include "stm32f4xx_hal_dma2d.h" +#endif /* HAL_DMA2D_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f4xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_DCMI_MODULE_ENABLED + #include "stm32f4xx_hal_dcmi.h" +#endif /* HAL_DCMI_MODULE_ENABLED */ + +#ifdef HAL_ETH_MODULE_ENABLED + #include "stm32f4xx_hal_eth.h" +#endif /* HAL_ETH_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f4xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f4xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f4xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f4xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_SDRAM_MODULE_ENABLED + #include "stm32f4xx_hal_sdram.h" +#endif /* HAL_SDRAM_MODULE_ENABLED */ + +#ifdef HAL_HASH_MODULE_ENABLED + #include "stm32f4xx_hal_hash.h" +#endif /* HAL_HASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f4xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f4xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f4xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LTDC_MODULE_ENABLED + #include "stm32f4xx_hal_ltdc.h" +#endif /* HAL_LTDC_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f4xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32f4xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f4xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED + #include "stm32f4xx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SD_MODULE_ENABLED + #include "stm32f4xx_hal_sd.h" +#endif /* HAL_SD_MODULE_ENABLED */ + +#ifdef HAL_MMC_MODULE_ENABLED + #include "stm32f4xx_hal_mmc.h" +#endif /* HAL_MMC_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f4xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f4xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f4xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f4xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f4xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f4xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f4xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f4xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_HCD_MODULE_ENABLED + #include "stm32f4xx_hal_hcd.h" +#endif /* HAL_HCD_MODULE_ENABLED */ + +#ifdef HAL_DSI_MODULE_ENABLED + #include "stm32f4xx_hal_dsi.h" +#endif /* HAL_DSI_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED + #include "stm32f4xx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f4xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_FMPI2C_MODULE_ENABLED + #include "stm32f4xx_hal_fmpi2c.h" +#endif /* HAL_FMPI2C_MODULE_ENABLED */ + +#ifdef HAL_SPDIFRX_MODULE_ENABLED + #include "stm32f4xx_hal_spdifrx.h" +#endif /* HAL_SPDIFRX_MODULE_ENABLED */ + +#ifdef HAL_DFSDM_MODULE_ENABLED + #include "stm32f4xx_hal_dfsdm.h" +#endif /* HAL_DFSDM_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED + #include "stm32f4xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F4xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ From 4a25c2344ee2d145386eb8a632d57d2926809a1c Mon Sep 17 00:00:00 2001 From: Hierophect Date: Mon, 18 Nov 2019 18:27:25 -0500 Subject: [PATCH 058/189] implement os urandom --- .../stm32f4xx_hal_conf.h | 2 +- .../boards/pyboard_v11/stm32f4xx_hal_conf.h | 2 +- .../stm32f4xx_hal_conf.h | 2 +- ports/stm32f4/common-hal/os/__init__.c | 37 +++++++++++++++++-- ports/stm32f4/peripherals/stm32f4/periph.h | 3 ++ 5 files changed, 39 insertions(+), 7 deletions(-) diff --git a/ports/stm32f4/boards/feather_stm32f405_express/stm32f4xx_hal_conf.h b/ports/stm32f4/boards/feather_stm32f405_express/stm32f4xx_hal_conf.h index 68a49b4ba8..8031403a91 100644 --- a/ports/stm32f4/boards/feather_stm32f405_express/stm32f4xx_hal_conf.h +++ b/ports/stm32f4/boards/feather_stm32f405_express/stm32f4xx_hal_conf.h @@ -55,7 +55,7 @@ #define HAL_I2S_MODULE_ENABLED /* #define HAL_IWDG_MODULE_ENABLED */ /* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ +#define HAL_RNG_MODULE_ENABLED /* #define HAL_RTC_MODULE_ENABLED */ /* #define HAL_SAI_MODULE_ENABLED */ /* #define HAL_SD_MODULE_ENABLED */ diff --git a/ports/stm32f4/boards/pyboard_v11/stm32f4xx_hal_conf.h b/ports/stm32f4/boards/pyboard_v11/stm32f4xx_hal_conf.h index 7a1a9428f8..4dc18cb7f4 100644 --- a/ports/stm32f4/boards/pyboard_v11/stm32f4xx_hal_conf.h +++ b/ports/stm32f4/boards/pyboard_v11/stm32f4xx_hal_conf.h @@ -55,7 +55,7 @@ #define HAL_I2S_MODULE_ENABLED /* #define HAL_IWDG_MODULE_ENABLED */ /* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ +#define HAL_RNG_MODULE_ENABLED /* #define HAL_RTC_MODULE_ENABLED */ /* #define HAL_SAI_MODULE_ENABLED */ /* #define HAL_SD_MODULE_ENABLED */ diff --git a/ports/stm32f4/boards/stm32f412zg_discovery/stm32f4xx_hal_conf.h b/ports/stm32f4/boards/stm32f412zg_discovery/stm32f4xx_hal_conf.h index b89240f982..f1b4013485 100644 --- a/ports/stm32f4/boards/stm32f412zg_discovery/stm32f4xx_hal_conf.h +++ b/ports/stm32f4/boards/stm32f412zg_discovery/stm32f4xx_hal_conf.h @@ -55,7 +55,7 @@ #define HAL_I2S_MODULE_ENABLED /* #define HAL_IWDG_MODULE_ENABLED */ /* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ +#define HAL_RNG_MODULE_ENABLED /* #define HAL_RTC_MODULE_ENABLED */ /* #define HAL_SAI_MODULE_ENABLED */ #define HAL_SD_MODULE_ENABLED diff --git a/ports/stm32f4/common-hal/os/__init__.c b/ports/stm32f4/common-hal/os/__init__.c index aa80a02f5e..0b3153286a 100644 --- a/ports/stm32f4/common-hal/os/__init__.c +++ b/ports/stm32f4/common-hal/os/__init__.c @@ -30,6 +30,11 @@ #include "py/objstr.h" #include "py/objtuple.h" +#include "py/mperrno.h" +#include "py/runtime.h" +#include "stm32f4xx_hal.h" +#include "stm32f4/periph.h" + STATIC const qstr os_uname_info_fields[] = { MP_QSTR_sysname, MP_QSTR_nodename, MP_QSTR_release, MP_QSTR_version, MP_QSTR_machine @@ -56,11 +61,35 @@ 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) { +#define RNG_TIMEOUT 5 - for (uint32_t i = 0; i < length; i++) { - buffer[i] = 4; //read in my coffee dregs; the truest random number, chosen by Nrthalotep - //todo: spurn the gods, replace with actual code. +bool common_hal_os_urandom(uint8_t *buffer, uint32_t length) { + #if (HAS_TRNG) + //init the RNG + __HAL_RCC_RNG_CLK_ENABLE(); + RNG_HandleTypeDef handle; + handle.Instance = RNG; + if (HAL_RNG_Init(&handle) != HAL_OK) mp_raise_ValueError(translate("RNG Init Error")); + + //Assign bytes + for (uint i = 0; i < length; i++) { + uint32_t temp; + uint32_t start = HAL_GetTick(); + //the HAL function has a timeout, but it isn't long enough, and isn't adjustable + while(!(__HAL_RNG_GET_FLAG(&handle,RNG_FLAG_DRDY)) && ((HAL_GetTick() - start) < RNG_TIMEOUT)); + // + if (HAL_RNG_GenerateRandomNumber(&handle, &temp) != HAL_OK) { + mp_raise_ValueError(translate("Random number generation error")); + } + *buffer = (uint8_t)temp; } + + //shut down the peripheral + if (HAL_RNG_DeInit(&handle) != HAL_OK) mp_raise_ValueError(translate("RNG DeInit Error")); + __HAL_RCC_RNG_CLK_DISABLE(); + return true; + #else + return false; + #endif } \ No newline at end of file diff --git a/ports/stm32f4/peripherals/stm32f4/periph.h b/ports/stm32f4/peripherals/stm32f4/periph.h index 4b00ce1d92..0d1374e850 100644 --- a/ports/stm32f4/peripherals/stm32f4/periph.h +++ b/ports/stm32f4/peripherals/stm32f4/periph.h @@ -142,11 +142,13 @@ typedef struct { #ifdef STM32F411xE #define HAS_DAC 0 +#define HAS_TRNG 0 #include "stm32f411xe/periph.h" #endif #ifdef STM32F412Zx #define HAS_DAC 0 +#define HAS_TRNG 1 #include "stm32f412zx/periph.h" #endif @@ -154,6 +156,7 @@ typedef struct { #ifdef STM32F405xx #define HAS_DAC 1 +#define HAS_TRNG 1 #include "stm32f405xx/periph.h" #endif From 11c2c3443f65e6d0342417c5dbc42302992710da Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 19 Nov 2019 13:55:58 -0800 Subject: [PATCH 059/189] Add support for extended (>31 byte) BLE advertisements. --- ports/nrf/common-hal/_bleio/Adapter.c | 37 +++++++++++++++++++++------ shared-bindings/_bleio/Adapter.c | 3 +++ 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index 295a42d63b..f7f1198534 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -508,8 +508,9 @@ mp_obj_t common_hal_bleio_adapter_connect(bleio_adapter_obj_t *self, bleio_addre // The nRF SD 6.1.0 can only do one concurrent advertisement so share the advertising handle. uint8_t adv_handle = BLE_GAP_ADV_SET_HANDLE_NOT_SET; -STATIC void check_data_fit(size_t data_len) { - if (data_len > BLE_GAP_ADV_SET_DATA_SIZE_MAX) { +STATIC void check_data_fit(size_t data_len, bool connectable) { + if (data_len > BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED || + (connectable && data_len > BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_CONNECTABLE_MAX_SUPPORTED)) { mp_raise_ValueError(translate("Data too large for advertisement packet")); } } @@ -525,11 +526,31 @@ uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, common_hal_bleio_adapter_stop_advertising(self); } + + bool extended = advertising_data_len > BLE_GAP_ADV_SET_DATA_SIZE_MAX || + scan_response_data_len > BLE_GAP_ADV_SET_DATA_SIZE_MAX; + + uint8_t adv_type; + if (extended) { + if (connectable) { + adv_type = BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED; + } else if (scan_response_data_len > 0) { + adv_type = BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_SCANNABLE_UNDIRECTED; + } else { + adv_type = BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED; + } + } else if (connectable) { + adv_type = BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED; + } else if (scan_response_data_len > 0) { + adv_type = BLE_GAP_ADV_TYPE_NONCONNECTABLE_SCANNABLE_UNDIRECTED; + } else { + adv_type = BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED; + } + uint32_t err_code; ble_gap_adv_params_t adv_params = { .interval = SEC_TO_UNITS(interval, UNIT_0_625_MS), - .properties.type = connectable ? BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED - : BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED, + .properties.type = adv_type, .duration = BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED, .filter_policy = BLE_GAP_ADV_FP_ANY, .primary_phy = BLE_GAP_PHY_1MBPS, @@ -564,15 +585,15 @@ void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool uint32_t err_code; - check_data_fit(advertising_data_bufinfo->len); - check_data_fit(scan_response_data_bufinfo->len); + check_data_fit(advertising_data_bufinfo->len, connectable); + check_data_fit(scan_response_data_bufinfo->len, connectable); // The advertising data buffers must not move, because the SoftDevice depends on them. // So make them long-lived and reuse them onwards. if (self->advertising_data == NULL) { - self->advertising_data = (uint8_t *) gc_alloc(BLE_GAP_ADV_SET_DATA_SIZE_MAX * sizeof(uint8_t), false, true); + self->advertising_data = (uint8_t *) gc_alloc(BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED * sizeof(uint8_t), false, true); } if (self->scan_response_data == NULL) { - self->scan_response_data = (uint8_t *) gc_alloc(BLE_GAP_ADV_SET_DATA_SIZE_MAX * sizeof(uint8_t), false, true); + self->scan_response_data = (uint8_t *) gc_alloc(BLE_GAP_ADV_SET_DATA_SIZE_EXTENDED_MAX_SUPPORTED * sizeof(uint8_t), false, true); } memcpy(self->advertising_data, advertising_data_bufinfo->buf, advertising_data_bufinfo->len); diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 24a70f4084..8efdb387ad 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -144,6 +144,9 @@ const mp_obj_property_t bleio_adapter_name_obj = { //| Starts advertising until `stop_advertising` is called or if connectable, another device //| connects to us. //| +//| .. warning: If data is longer than 31 bytes, then this will automatically advertise as an +//| extended advertisement that older BLE 4.x clients won't be able to scan for. +//| //| :param buf data: advertising data packet bytes //| :param buf scan_response: scan response data packet bytes. ``None`` if no scan response is needed. //| :param bool connectable: If `True` then other devices are allowed to connect to this peripheral. From fe6ec9a7d48986981e09a26d0ecc99af0a9febe7 Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Tue, 19 Nov 2019 14:53:58 -0800 Subject: [PATCH 060/189] Added Edgebadge alias for Pybadge --- lib/stm32lib | 1 + tools/build_board_info.py | 1 + 2 files changed, 2 insertions(+) create mode 160000 lib/stm32lib diff --git a/lib/stm32lib b/lib/stm32lib new file mode 160000 index 0000000000..b2487bdea9 --- /dev/null +++ b/lib/stm32lib @@ -0,0 +1 @@ +Subproject commit b2487bdea963af3343fc198681c9dc698e267303 diff --git a/tools/build_board_info.py b/tools/build_board_info.py index efa481a637..710cdb0c22 100644 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -48,6 +48,7 @@ extension_by_board = { aliases_by_board = { "circuitplayground_express": ["circuitplayground_express_4h", "circuitplayground_express_digikey_pycon2019"], + "pybadge": ["edgebadge"], "gemma_m0": ["gemma_m0_pycon2018"], "pewpew10": ["pewpew13"] } From d763559120a854a092f9d2c46c4e6a51492f3e84 Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Tue, 19 Nov 2019 16:17:30 -0800 Subject: [PATCH 061/189] Removing submodule that was accidentally stowed away in PR 2302 --- lib/stm32lib | 1 - 1 file changed, 1 deletion(-) delete mode 160000 lib/stm32lib diff --git a/lib/stm32lib b/lib/stm32lib deleted file mode 160000 index b2487bdea9..0000000000 --- a/lib/stm32lib +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b2487bdea963af3343fc198681c9dc698e267303 From fce7b89087a6aca8a2c72f62aee6b0639a5414c0 Mon Sep 17 00:00:00 2001 From: wallarug Date: Wed, 20 Nov 2019 21:34:24 +1100 Subject: [PATCH 062/189] removed Robo HAT MM1 M0 board. --- ports/atmel-samd/boards/robohatmm1_m0/board.c | 38 -------- .../boards/robohatmm1_m0/mpconfigboard.h | 42 --------- .../boards/robohatmm1_m0/mpconfigboard.mk | 29 ------ ports/atmel-samd/boards/robohatmm1_m0/pins.c | 92 ------------------- 4 files changed, 201 deletions(-) delete mode 100644 ports/atmel-samd/boards/robohatmm1_m0/board.c delete mode 100644 ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.h delete mode 100644 ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.mk delete mode 100644 ports/atmel-samd/boards/robohatmm1_m0/pins.c diff --git a/ports/atmel-samd/boards/robohatmm1_m0/board.c b/ports/atmel-samd/boards/robohatmm1_m0/board.c deleted file mode 100644 index c8e20206a1..0000000000 --- a/ports/atmel-samd/boards/robohatmm1_m0/board.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 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 "boards/board.h" - -void board_init(void) -{ -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} diff --git a/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.h b/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.h deleted file mode 100644 index c6856c68f8..0000000000 --- a/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.h +++ /dev/null @@ -1,42 +0,0 @@ -#define MICROPY_HW_BOARD_NAME "Robo HAT MM1 M0" -#define MICROPY_HW_MCU_NAME "samd21g18" - -#define MICROPY_HW_LED_STATUS (&pin_PB22) - -// Salae reads 12mhz which is the limit even though we set it to the safer 8mhz. -#define SPI_FLASH_BAUDRATE (8000000) - -// On-board flash -#define SPI_FLASH_MOSI_PIN &pin_PA12 -#define SPI_FLASH_MISO_PIN &pin_PA14 -#define SPI_FLASH_SCK_PIN &pin_PA13 -#define SPI_FLASH_CS_PIN &pin_PA15 - -// These are pins not to reset. -#define MICROPY_PORT_A ( 0 ) //PORT_PA06 -#define MICROPY_PORT_B ( 0 ) -#define MICROPY_PORT_C ( 0 ) - - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - -#define CALIBRATE_CRYSTALLESS 1 - -#define DEFAULT_I2C_BUS_SCL (&pin_PA23) -#define DEFAULT_I2C_BUS_SDA (&pin_PA22) - -#define DEFAULT_SPI_BUS_SCK (&pin_PB09) -#define DEFAULT_SPI_BUS_MOSI (&pin_PB08) -#define DEFAULT_SPI_BUS_MISO (&pin_PB11) - -//#define DEFAULT_UART_BUS_RX (&pin_PB03) -//#define DEFAULT_UART_BUS_TX (&pin_PB02) - -// USB is always used internally so skip the pin objects for it. -#define IGNORE_PIN_PA24 1 -#define IGNORE_PIN_PA25 1 - diff --git a/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.mk b/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.mk deleted file mode 100644 index e703fbfb9f..0000000000 --- a/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.mk +++ /dev/null @@ -1,29 +0,0 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld -USB_VID = 0x1209 -USB_PID = 0x4D43 -USB_PRODUCT = "Robo HAT MM1 M0" -USB_MANUFACTURER = "Robotics Masters" - -CHIP_VARIANT = SAMD21G18A -CHIP_FAMILY = samd21 - -SPI_FLASH_FILESYSTEM = 1 -EXTERNAL_FLASH_DEVICE_COUNT = 1 -EXTERNAL_FLASH_DEVICES = "W25Q64JV_IQ" -LONGINT_IMPL = MPZ - -# Non-Flash Edition -#INTERNAL_FLASH_FILESYSTEM = 1 -#LONGINT_IMPL = NONE - -CIRCUITPY_DISPLAYIO = 0 -CIRCUITPY_FREQUENCYIO = 0 - -CFLAGS_INLINE_LIMIT = 60 -SUPEROPT_GC = 0 - -# Include these Python libraries in firmware. -#FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel -#FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_INA219 -#FROZEN_MPY_DIRS += $(TOP)/frozen/RoboticsMasters_CircuitPython_MPU9250 diff --git a/ports/atmel-samd/boards/robohatmm1_m0/pins.c b/ports/atmel-samd/boards/robohatmm1_m0/pins.c deleted file mode 100644 index edaf0bc4c5..0000000000 --- a/ports/atmel-samd/boards/robohatmm1_m0/pins.c +++ /dev/null @@ -1,92 +0,0 @@ -#include "shared-bindings/board/__init__.h" -// Version 2.4 -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { - // SERVO Pins - { MP_ROM_QSTR(MP_QSTR_SERVO1), MP_ROM_PTR(&pin_PA18) }, - { MP_ROM_QSTR(MP_QSTR_SERVO2), MP_ROM_PTR(&pin_PA19) }, - { MP_ROM_QSTR(MP_QSTR_SERVO3), MP_ROM_PTR(&pin_PA20) }, - { MP_ROM_QSTR(MP_QSTR_SERVO4), MP_ROM_PTR(&pin_PA21) }, - { MP_ROM_QSTR(MP_QSTR_SERVO5), MP_ROM_PTR(&pin_PA11) }, - { MP_ROM_QSTR(MP_QSTR_SERVO6), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_SERVO7), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_SERVO8), MP_ROM_PTR(&pin_PA08) }, - - // RCC Pins - { MP_ROM_QSTR(MP_QSTR_RCC1), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_RCC2), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_RCC3), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_RCC4), MP_ROM_PTR(&pin_PA04) }, - - // Special Function - { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_POWER_OFF), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_POWER_DISABLE), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_POWER_ON), MP_ROM_PTR(&pin_PA27) }, - { MP_ROM_QSTR(MP_QSTR_POWER_ENABLE), MP_ROM_PTR(&pin_PA27) }, - { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_PA27) }, - - { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PB23) }, - { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PB22) }, - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB02) }, - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB03) }, - - // GROVE on SERCOM0 - { MP_ROM_QSTR(MP_QSTR_GROVE_SCL), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_GROVE_SDA), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_GROVE_RX), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_GROVE_TX), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_GROVE_D1), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_GROVE_D0), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_GROVE_A1), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_GROVE_A0), MP_ROM_PTR(&pin_PA08) }, - - // UART on SERCOM0 - { MP_ROM_QSTR(MP_QSTR_UART_TX), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_UART_RX), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_UART_CTS), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_UART_RTS), MP_ROM_PTR(&pin_PA07) }, - - // UART on SERCOM1 (Raspberry Pi) - { MP_ROM_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_PA16) }, - { MP_ROM_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_PA17) }, - { MP_ROM_QSTR(MP_QSTR_PI_RX), MP_ROM_PTR(&pin_PA16) }, - { MP_ROM_QSTR(MP_QSTR_PI_TX), MP_ROM_PTR(&pin_PA17) }, - - // I2C on SERCOM1 (External Connector) - { MP_ROM_QSTR(MP_QSTR_SDA1), MP_ROM_PTR(&pin_PA00) }, - { MP_ROM_QSTR(MP_QSTR_SCL1), MP_ROM_PTR(&pin_PA01) }, - - // SPI Flash on SERCOM2 - { MP_ROM_QSTR(MP_QSTR_FLASH_SCK), MP_ROM_PTR(&pin_PA13) }, - { MP_ROM_QSTR(MP_QSTR_FLASH_MISO), MP_ROM_PTR(&pin_PA14) }, - { MP_ROM_QSTR(MP_QSTR_FLASH_MOSI), MP_ROM_PTR(&pin_PA12) }, - { MP_ROM_QSTR(MP_QSTR_FLASH_CS), MP_ROM_PTR(&pin_PA15) }, - - // I2C on SERCOM3 (RPi & Internal) - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) }, - { MP_ROM_QSTR(MP_QSTR_PI_SDA), MP_ROM_PTR(&pin_PA22) }, - { MP_ROM_QSTR(MP_QSTR_PI_SCL), MP_ROM_PTR(&pin_PA23) }, - - // SPI on SERCOM4 - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_SS), MP_ROM_PTR(&pin_PB10) }, - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB11) }, - - // GPS on SERCOM5 - { MP_ROM_QSTR(MP_QSTR_GPS_TX), MP_ROM_PTR(&pin_PB02) }, - { MP_ROM_QSTR(MP_QSTR_GPS_RX), MP_ROM_PTR(&pin_PB03) }, - - // Raspberry Pi - { MP_ROM_QSTR(MP_QSTR_PI_GP25), MP_ROM_PTR(&pin_PA30) }, - { MP_ROM_QSTR(MP_QSTR_SWCLK), MP_ROM_PTR(&pin_PA30) }, - { MP_ROM_QSTR(MP_QSTR_PI_GP24), MP_ROM_PTR(&pin_PA31) }, - { MP_ROM_QSTR(MP_QSTR_SWDIO), MP_ROM_PTR(&pin_PA31) }, - - { 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); From 8d72233afd8e0f6988131529a02dfad0ac763599 Mon Sep 17 00:00:00 2001 From: wallarug Date: Thu, 21 Nov 2019 01:12:48 +1100 Subject: [PATCH 063/189] Removed robohatmm1_m0 from build. --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 404cd19a67..1d5793573f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -137,7 +137,6 @@ jobs: - "pyportal" - "pyportal_titano" - "pyruler" - - "robohatmm1_m0" - "robohatmm1_m4" - "sam32" - "serpente" From 0b558e87143b43471c5026b25470dfd8df3a8b13 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Wed, 20 Nov 2019 11:34:49 -0500 Subject: [PATCH 064/189] fix error in SPI busclock selection --- ports/stm32f4/common-hal/busio/SPI.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/ports/stm32f4/common-hal/busio/SPI.c b/ports/stm32f4/common-hal/busio/SPI.c index e20bd7a947..f19461e9fa 100644 --- a/ports/stm32f4/common-hal/busio/SPI.c +++ b/ports/stm32f4/common-hal/busio/SPI.c @@ -39,6 +39,17 @@ STATIC bool reserved_spi[6]; STATIC bool never_reset_spi[6]; +STATIC uint32_t get_busclock(SPI_TypeDef * instance) { + //SPI2 and 3 are on PCLK1, if they exist. + #ifdef SPI2 + if(instance == SPI2) return HAL_RCC_GetPCLK1Freq(); + #endif + #ifdef SPI3 + if(instance == SPI2) return HAL_RCC_GetPCLK1Freq(); + #endif + return HAL_RCC_GetPCLK2Freq(); +} + void spi_reset(void) { #ifdef SPI1 if(!never_reset_spi[0]) { @@ -205,7 +216,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, { mp_raise_ValueError(translate("SPI Init Error")); } - self->baudrate = (HAL_RCC_GetPCLK2Freq()/16); + self->baudrate = (get_busclock(SPIx)/16); self->prescaler = 16; self->polarity = 0; self->phase = 1; @@ -277,7 +288,7 @@ void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { self->miso = mp_const_none; } -static uint32_t stm32_baud_to_spi_div(uint32_t baudrate, uint16_t * prescaler) { +STATIC uint32_t stm32_baud_to_spi_div(uint32_t baudrate, uint16_t * prescaler, uint32_t busclock) { static const uint32_t baud_map[8][2] = { {2,SPI_BAUDRATEPRESCALER_2}, {4,SPI_BAUDRATEPRESCALER_4}, @@ -292,7 +303,7 @@ static uint32_t stm32_baud_to_spi_div(uint32_t baudrate, uint16_t * prescaler) { uint16_t divisor; do { divisor = baud_map[i][0]; - if (baudrate >= (HAL_RCC_GetPCLK2Freq()/divisor)) { + if (baudrate >= (busclock/divisor)) { *prescaler = divisor; return baud_map[i][1]; } @@ -331,9 +342,9 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self, } else { self->handle.Init.CLKPhase = SPI_PHASE_1EDGE; } - - self->handle.Init.BaudRatePrescaler = stm32_baud_to_spi_div(baudrate, &self->prescaler); - + + self->handle.Init.BaudRatePrescaler = stm32_baud_to_spi_div(baudrate, &self->prescaler, + get_busclock(self->handle.Instance)); self->handle.Init.Mode = SPI_MODE_MASTER; self->handle.Init.Direction = SPI_DIRECTION_2LINES; self->handle.Init.NSS = SPI_NSS_SOFT; From bd9893ab988ebbb5dd37f9016ddaab2b03abd11c Mon Sep 17 00:00:00 2001 From: Hierophect Date: Wed, 20 Nov 2019 12:00:45 -0500 Subject: [PATCH 065/189] clean up SPI module readability --- ports/stm32f4/common-hal/busio/SPI.c | 201 +++++++++------------------ 1 file changed, 69 insertions(+), 132 deletions(-) diff --git a/ports/stm32f4/common-hal/busio/SPI.c b/ports/stm32f4/common-hal/busio/SPI.c index f19461e9fa..a4960cce88 100644 --- a/ports/stm32f4/common-hal/busio/SPI.c +++ b/ports/stm32f4/common-hal/busio/SPI.c @@ -36,8 +36,13 @@ #include "supervisor/shared/translate.h" #include "common-hal/microcontroller/Pin.h" -STATIC bool reserved_spi[6]; -STATIC bool never_reset_spi[6]; +#define MAX_SPI 6 //TODO; replace this as part of periph cleanup +#define ALL_CLOCKS 0xFF +STATIC bool reserved_spi[MAX_SPI]; +STATIC bool never_reset_spi[MAX_SPI]; + +STATIC void spi_clock_enable(uint8_t mask); +STATIC void spi_clock_disable(uint8_t mask); STATIC uint32_t get_busclock(SPI_TypeDef * instance) { //SPI2 and 3 are on PCLK1, if they exist. @@ -51,42 +56,15 @@ STATIC uint32_t get_busclock(SPI_TypeDef * instance) { } void spi_reset(void) { - #ifdef SPI1 - if(!never_reset_spi[0]) { - reserved_spi[0] = false; - __HAL_RCC_SPI1_CLK_DISABLE(); + uint16_t never_reset_mask = 0x00; + for(int i=0;imiso->altfn_index; HAL_GPIO_Init(pin_port(miso->port), &GPIO_InitStruct); - #ifdef SPI1 - if(SPIx==SPI1) { - reserved_spi[0] = true; - __HAL_RCC_SPI1_CLK_ENABLE(); - } - #endif - #ifdef SPI2 - if(SPIx==SPI2) { - reserved_spi[1] = true; - __HAL_RCC_SPI2_CLK_ENABLE(); - } - #endif - #ifdef SPI3 - if(SPIx==SPI3) { - reserved_spi[2] = true; - __HAL_RCC_SPI3_CLK_ENABLE(); - } - #endif - #ifdef SPI4 - if(SPIx==SPI4) { - reserved_spi[3] = true; - __HAL_RCC_SPI4_CLK_ENABLE(); - } - #endif - #ifdef SPI5 - if(SPIx==SPI5) { - reserved_spi[4] = true; - __HAL_RCC_SPI5_CLK_ENABLE(); - } - #endif - #ifdef SPI6 - if(SPIx==SPI6) { - reserved_spi[5] = true; - __HAL_RCC_SPI6_CLK_ENABLE(); - } - #endif + spi_clock_enable(1<<(self->sck->spi_index - 1)); + reserved_spi[self->sck->spi_index - 1] = true; self->handle.Instance = SPIx; self->handle.Init.Mode = SPI_MODE_MASTER; @@ -244,42 +188,9 @@ bool common_hal_busio_spi_deinited(busio_spi_obj_t *self) { } void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { - #ifdef SPI1 - if(self->handle.Instance==SPI1) { - reserved_spi[0] = false; - __HAL_RCC_SPI1_CLK_DISABLE(); - } - #endif - #ifdef SPI2 - if(self->handle.Instance==SPI2) { - reserved_spi[1] = false; - __HAL_RCC_SPI2_CLK_DISABLE(); - } - #endif - #ifdef SPI3 - if(self->handle.Instance==SPI3) { - reserved_spi[2] = false; - __HAL_RCC_SPI3_CLK_DISABLE(); - } - #endif - #ifdef SPI4 - if(self->handle.Instance==SPI4) { - reserved_spi[3] = false; - __HAL_RCC_SPI4_CLK_DISABLE(); - } - #endif - #ifdef SPI5 - if(self->handle.Instance==SPI5) { - reserved_spi[4] = false; - __HAL_RCC_SPI5_CLK_DISABLE(); - } - #endif - #ifdef SPI6 - if(self->handle.Instance==SPI6) { - reserved_spi[5] = false; - __HAL_RCC_SPI6_CLK_DISABLE(); - } - #endif + spi_clock_disable(1<<(self->sck->spi_index - 1)); + reserved_spi[self->sck->spi_index - 1] = true; + reset_pin_number(self->sck->pin->port,self->sck->pin->number); reset_pin_number(self->mosi->pin->port,self->mosi->pin->number); reset_pin_number(self->miso->pin->port,self->miso->pin->number); @@ -323,26 +234,10 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self, //Deinit SPI HAL_SPI_DeInit(&self->handle); - if (bits == 8) { - self->handle.Init.DataSize = SPI_DATASIZE_8BIT; - } else if (bits == 16) { - self->handle.Init.DataSize = SPI_DATASIZE_16BIT; - } else { - return false; - } + self->handle.Init.DataSize = (bits == 16) ? SPI_DATASIZE_16BIT : SPI_DATASIZE_8BIT; + self->handle.Init.CLKPolarity = (polarity) ? SPI_POLARITY_HIGH : SPI_POLARITY_LOW; + self->handle.Init.CLKPhase = (phase) ? SPI_PHASE_2EDGE : SPI_PHASE_1EDGE; - if (polarity) { - self->handle.Init.CLKPolarity = SPI_POLARITY_HIGH; - } else { - self->handle.Init.CLKPolarity = SPI_POLARITY_LOW; - } - - if (phase) { - self->handle.Init.CLKPhase = SPI_PHASE_2EDGE; - } else { - self->handle.Init.CLKPhase = SPI_PHASE_1EDGE; - } - self->handle.Init.BaudRatePrescaler = stm32_baud_to_spi_div(baudrate, &self->prescaler, get_busclock(self->handle.Instance)); self->handle.Init.Mode = SPI_MODE_MASTER; @@ -373,10 +268,10 @@ bool common_hal_busio_spi_try_lock(busio_spi_obj_t *self) { // __disable_irq(); // __DMB(); - if (!self->has_lock) { - grabbed_lock = true; - self->has_lock = true; - } + if (!self->has_lock) { + grabbed_lock = true; + self->has_lock = true; + } // __DMB(); // __set_PRIMASK(store_primask); @@ -423,4 +318,46 @@ uint8_t common_hal_busio_spi_get_phase(busio_spi_obj_t* self) { uint8_t common_hal_busio_spi_get_polarity(busio_spi_obj_t* self) { return self->polarity; +} + +STATIC void spi_clock_enable(uint8_t mask) { + #ifdef SPI1 + if (mask & 1<<0) __HAL_RCC_SPI1_CLK_ENABLE(); + #endif + #ifdef SPI2 + if (mask & 1<<1) __HAL_RCC_SPI2_CLK_ENABLE(); + #endif + #ifdef SPI3 + if (mask & 1<<2) __HAL_RCC_SPI3_CLK_ENABLE(); + #endif + #ifdef SPI4 + if (mask & 1<<3) __HAL_RCC_SPI4_CLK_ENABLE(); + #endif + #ifdef SPI5 + if (mask & 1<<4) __HAL_RCC_SPI5_CLK_ENABLE(); + #endif + #ifdef SPI6 + if (mask & 1<<5) __HAL_RCC_SPI6_CLK_ENABLE(); + #endif +} + +STATIC void spi_clock_disable(uint8_t mask) { + #ifdef SPI1 + if (mask & 1<<0) __HAL_RCC_SPI1_CLK_DISABLE(); + #endif + #ifdef SPI2 + if (mask & 1<<1) __HAL_RCC_SPI2_CLK_DISABLE(); + #endif + #ifdef SPI3 + if (mask & 1<<2) __HAL_RCC_SPI3_CLK_DISABLE(); + #endif + #ifdef SPI4 + if (mask & 1<<3) __HAL_RCC_SPI4_CLK_DISABLE(); + #endif + #ifdef SPI5 + if (mask & 1<<4) __HAL_RCC_SPI5_CLK_DISABLE(); + #endif + #ifdef SPI6 + if (mask & 1<<5) __HAL_RCC_SPI6_CLK_DISABLE(); + #endif } \ No newline at end of file From 3d1b6d9fc8f1fd30acaf75ab10acba792873b8f7 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Wed, 20 Nov 2019 12:07:12 -0500 Subject: [PATCH 066/189] fix typo --- ports/stm32f4/common-hal/busio/SPI.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/stm32f4/common-hal/busio/SPI.c b/ports/stm32f4/common-hal/busio/SPI.c index a4960cce88..f98d29054d 100644 --- a/ports/stm32f4/common-hal/busio/SPI.c +++ b/ports/stm32f4/common-hal/busio/SPI.c @@ -50,7 +50,7 @@ STATIC uint32_t get_busclock(SPI_TypeDef * instance) { if(instance == SPI2) return HAL_RCC_GetPCLK1Freq(); #endif #ifdef SPI3 - if(instance == SPI2) return HAL_RCC_GetPCLK1Freq(); + if(instance == SPI3) return HAL_RCC_GetPCLK1Freq(); #endif return HAL_RCC_GetPCLK2Freq(); } From 9764006f81b6d8a14421f78777259bc3fd0ef015 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Wed, 20 Nov 2019 15:30:31 -0500 Subject: [PATCH 067/189] add F401 pin definition --- ports/stm32f4/peripherals/stm32f4/periph.h | 5 + .../peripherals/stm32f4/stm32f401xe/clocks.c | 61 +++++++ .../peripherals/stm32f4/stm32f401xe/gpio.c | 54 ++++++ .../peripherals/stm32f4/stm32f401xe/periph.c | 172 ++++++++++++++++++ .../peripherals/stm32f4/stm32f401xe/periph.h | 57 ++++++ .../peripherals/stm32f4/stm32f401xe/pins.c | 123 +++++++++++++ .../peripherals/stm32f4/stm32f401xe/pins.h | 121 ++++++++++++ 7 files changed, 593 insertions(+) create mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f401xe/clocks.c create mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f401xe/gpio.c create mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.c create mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.h create mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.c create mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.h diff --git a/ports/stm32f4/peripherals/stm32f4/periph.h b/ports/stm32f4/peripherals/stm32f4/periph.h index 4b00ce1d92..02304c626c 100644 --- a/ports/stm32f4/peripherals/stm32f4/periph.h +++ b/ports/stm32f4/peripherals/stm32f4/periph.h @@ -140,6 +140,11 @@ typedef struct { //Starter Lines +#ifdef STM32F411xE +#define HAS_DAC 0 +#include "stm32f401xe/periph.h" +#endif + #ifdef STM32F411xE #define HAS_DAC 0 #include "stm32f411xe/periph.h" diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/clocks.c b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/clocks.c new file mode 100644 index 0000000000..883c252d51 --- /dev/null +++ b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/clocks.c @@ -0,0 +1,61 @@ + +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland 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 "stm32f4xx_hal.h" + +void stm32f4_peripherals_clocks_init(void) { + //System clock init + RCC_ClkInitTypeDef RCC_ClkInitStruct; + RCC_OscInitTypeDef RCC_OscInitStruct; + + /* Enable Power Control clock */ + __HAL_RCC_PWR_CLK_ENABLE(); + + /* The voltage scaling allows optimizing the power consumption when the device is + clocked below the maximum system frequency, to update the voltage scaling value + regarding system frequency refer to product datasheet. */ + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2); + + /* Enable HSE Oscillator and activate PLL with HSE as source */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSEState = RCC_HSE_ON; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLM = 8; + RCC_OscInitStruct.PLL.PLLN = 336; + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4; + RCC_OscInitStruct.PLL.PLLQ = 7; + HAL_RCC_OscConfig(&RCC_OscInitStruct); + + /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 + clocks dividers */ + RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; + HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3); +} diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/gpio.c b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/gpio.c new file mode 100644 index 0000000000..45dc8fc6fa --- /dev/null +++ b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/gpio.c @@ -0,0 +1,54 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland 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 "stm32f4xx_hal.h" +#include "stm32f4/gpio.h" +#include "common-hal/microcontroller/Pin.h" + +void stm32f4_peripherals_gpio_init(void) { + //Enable all GPIO for now + GPIO_InitTypeDef GPIO_InitStruct = {0}; + /* GPIO Ports Clock Enable */ + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + __HAL_RCC_GPIOE_CLK_ENABLE(); + __HAL_RCC_GPIOH_CLK_ENABLE(); + + //Never reset pins + never_reset_pin_number(2,13); //PC13 anti tamp + never_reset_pin_number(2,14); //PC14 OSC32_IN + never_reset_pin_number(2,15); //PC15 OSC32_OUT + never_reset_pin_number(0,13); //PA13 SWDIO + never_reset_pin_number(0,14); //PA14 SWCLK +} + +//LEDs are inverted on F411 DISCO +void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { +} + + diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.c b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.c new file mode 100644 index 0000000000..859e9a1adb --- /dev/null +++ b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.c @@ -0,0 +1,172 @@ + /* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland 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 "py/obj.h" +#include "py/mphal.h" +#include "stm32f4/pins.h" +#include "stm32f4/periph.h" + +// I2C + +I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, I2C2, I2C3}; + +const mcu_i2c_sda_obj_t mcu_i2c_sda_list[5] = { + I2C_SDA(1, 4, &pin_PB07), + I2C_SDA(1, 4, &pin_PB09), + I2C_SDA(2, 9, &pin_PB03), + I2C_SDA(3, 4, &pin_PC09), + I2C_SDA(3, 9, &pin_PB04), +}; + +const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4] = { + I2C_SCL(1, 4, &pin_PB06), + I2C_SCL(1, 4, &pin_PB08), + I2C_SCL(2, 4, &pin_PB10), + I2C_SCL(3, 4, &pin_PA08) +}; + +// SPI + +SPI_TypeDef * mcu_spi_banks[4] = {SPI1, SPI2, SPI3, SPI4}; + +const mcu_spi_sck_obj_t mcu_spi_sck_list[9] = { + SPI(1, 5, &pin_PA05), + SPI(1, 5, &pin_PB03), + SPI(2, 5, &pin_PB10), + SPI(2, 5, &pin_PB13), + SPI(2, 5, &pin_PD03), + SPI(3, 6, &pin_PB03), + SPI(3, 6, &pin_PC10), + SPI(4, 5, &pin_PE02), + SPI(4, 5, &pin_PE12), +}; + +const mcu_spi_mosi_obj_t mcu_spi_mosi_list[9] = { + SPI(1, 5, &pin_PA07), + SPI(1, 5, &pin_PB05), + SPI(2, 5, &pin_PB15), + SPI(2, 5, &pin_PC03), + SPI(3, 6, &pin_PB05), + SPI(3, 6, &pin_PC12), + SPI(3, 5, &pin_PD06), + SPI(4, 5, &pin_PE06), + SPI(4, 5, &pin_PE14), +}; + +const mcu_spi_miso_obj_t mcu_spi_miso_list[8] = { + SPI(1, 5, &pin_PA06), + SPI(1, 5, &pin_PB04), + SPI(2, 5, &pin_PB14), + SPI(2, 5, &pin_PC02), + SPI(3, 6, &pin_PB04), + SPI(3, 6, &pin_PC11), + SPI(4, 5, &pin_PE05), + SPI(4, 5, &pin_PE13), +}; + +const mcu_spi_nss_obj_t mcu_spi_nss_list[9] = { + SPI(1, 5, &pin_PA04), + SPI(1, 5, &pin_PA15), + SPI(2, 5, &pin_PB09), + SPI(2, 5, &pin_PB12), + SPI(3, 6, &pin_PA04), + SPI(3, 6, &pin_PA15), + SPI(4, 6, &pin_PB12), + SPI(4, 5, &pin_PE04), + SPI(4, 5, &pin_PE11), +}; + +USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, NULL, NULL, NULL, USART6}; +bool mcu_uart_has_usart[MAX_UART] = {true, true, false, false, false, true}; + +const mcu_uart_tx_obj_t mcu_uart_tx_list[6] = { + UART(2, 7, &pin_PA02), + UART(1, 7, &pin_PA09), + UART(6, 8, &pin_PA11), + UART(1, 7, &pin_PB06), + UART(6, 8, &pin_PC06), + UART(2, 7, &pin_PD05), +}; + +const mcu_uart_rx_obj_t mcu_uart_rx_list[6] = { + UART(2, 7, &pin_PA03), + UART(1, 7, &pin_PA10), + UART(6, 8, &pin_PA12), + UART(1, 7, &pin_PB07), + UART(6, 8, &pin_PC07), + UART(2, 7, &pin_PD06), +}; + +//Timers +//TIM6 and TIM7 are basic timers that are only used by DAC, and don't have pins +TIM_TypeDef * mcu_tim_banks[14] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, NULL, TIM9, TIM10, + TIM11, NULL, NULL, NULL}; + +const mcu_tim_pin_obj_t mcu_tim_pin_list[44] = { + TIM(2,1,1,&pin_PA00), + TIM(5,2,1,&pin_PA00), + TIM(2,1,2,&pin_PA01), + TIM(5,2,2,&pin_PA01), + TIM(2,1,3,&pin_PA02), + TIM(5,2,3,&pin_PA02), + TIM(2,1,4,&pin_PA03), + TIM(5,2,4,&pin_PA03), + TIM(9,3,1,&pin_PA02), + TIM(9,3,2,&pin_PA03), + TIM(3,2,1,&pin_PA06), + TIM(3,2,2,&pin_PA07), + TIM(1,1,1,&pin_PA08), + TIM(1,1,2,&pin_PA09), + TIM(1,1,3,&pin_PA10), + TIM(1,1,4,&pin_PA11), + TIM(2,1,1,&pin_PA15), + TIM(3,2,3,&pin_PB00), + TIM(3,2,4,&pin_PB01), + TIM(2,1,2,&pin_PB03), + TIM(3,2,1,&pin_PB04), + TIM(3,2,2,&pin_PB05), + TIM(4,2,1,&pin_PB06), + TIM(4,2,2,&pin_PB07), + TIM(4,2,3,&pin_PB08), + TIM(10,2,1,&pin_PB08), + TIM(4,2,4,&pin_PB09), + TIM(11,2,1,&pin_PB09), + TIM(2,1,3,&pin_PB10), + TIM(3,2,1,&pin_PC06), + TIM(3,2,2,&pin_PC07), + TIM(3,2,3,&pin_PC08), + TIM(3,2,4,&pin_PC09), + TIM(4,2,1,&pin_PD12), + TIM(4,2,2,&pin_PD13), + TIM(4,2,3,&pin_PD14), + TIM(4,2,4,&pin_PD15), + TIM(9,3,1,&pin_PE05), + TIM(9,3,2,&pin_PE06), + TIM(1,1,1,&pin_PE09), + TIM(1,1,2,&pin_PE11), + TIM(1,1,3,&pin_PE13), + TIM(1,1,4,&pin_PE14), +}; diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.h b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.h new file mode 100644 index 0000000000..7d3f4dca22 --- /dev/null +++ b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.h @@ -0,0 +1,57 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland 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_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H +#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H + +//I2C +extern I2C_TypeDef * mcu_i2c_banks[3]; + +extern const mcu_i2c_sda_obj_t mcu_i2c_sda_list[5]; +extern const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4]; + +//SPI +extern SPI_TypeDef * mcu_spi_banks[4]; + +extern const mcu_spi_sck_obj_t mcu_spi_sck_list[9]; +extern const mcu_spi_mosi_obj_t mcu_spi_mosi_list[9]; +extern const mcu_spi_miso_obj_t mcu_spi_miso_list[8]; +extern const mcu_spi_nss_obj_t mcu_spi_nss_list[9]; + +//UART +extern USART_TypeDef * mcu_uart_banks[MAX_UART]; +extern bool mcu_uart_has_usart[MAX_UART]; + +extern const mcu_uart_tx_obj_t mcu_uart_tx_list[6]; +extern const mcu_uart_rx_obj_t mcu_uart_rx_list[6]; + +//Timers +#define TIM_BANK_ARRAY_LEN 14 +#define TIM_PIN_ARRAY_LEN 44 +TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; +const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; + +#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H \ No newline at end of file diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.c b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.c new file mode 100644 index 0000000000..7e88c3dcba --- /dev/null +++ b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.c @@ -0,0 +1,123 @@ + /* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland 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 "py/obj.h" +#include "py/mphal.h" +#include "stm32f4/pins.h" + +const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); +const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); +const mcu_pin_obj_t pin_PE04 = PIN(4, 4, NO_ADC); +const mcu_pin_obj_t pin_PE05 = PIN(4, 5, NO_ADC); +const mcu_pin_obj_t pin_PE06 = PIN(4, 6, NO_ADC); + +const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); //anti-tamp +const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); //OSC32_IN +const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); //OSC32_OUT + +const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_1,10)); +const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_1,11)); +const mcu_pin_obj_t pin_PC02 = PIN(2, 2, ADC_INPUT(ADC_1,12)); +const mcu_pin_obj_t pin_PC03 = PIN(2, 3, ADC_INPUT(ADC_1,13)); + +const mcu_pin_obj_t pin_PA00 = PIN(0, 0, ADC_INPUT(ADC_1,0)); +const mcu_pin_obj_t pin_PA01 = PIN(0, 1, ADC_INPUT(ADC_1,1)); +const mcu_pin_obj_t pin_PA02 = PIN(0, 2, ADC_INPUT(ADC_1,2)); +const mcu_pin_obj_t pin_PA03 = PIN(0, 3, ADC_INPUT(ADC_1,3)); +const mcu_pin_obj_t pin_PA04 = PIN(0, 4, ADC_INPUT(ADC_1,4)); +const mcu_pin_obj_t pin_PA05 = PIN(0, 5, ADC_INPUT(ADC_1,5)); +const mcu_pin_obj_t pin_PA06 = PIN(0, 6, ADC_INPUT(ADC_1,6)); +const mcu_pin_obj_t pin_PA07 = PIN(0, 7, ADC_INPUT(ADC_1,7)); + +const mcu_pin_obj_t pin_PC04 = PIN(2, 4, ADC_INPUT(ADC_1,14)); +const mcu_pin_obj_t pin_PC05 = PIN(2, 5, ADC_INPUT(ADC_1,15)); + +const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_1,8)); +const mcu_pin_obj_t pin_PB01 = PIN(1, 1, ADC_INPUT(ADC_1,9)); +const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); + +const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); +const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); +const mcu_pin_obj_t pin_PE09 = PIN(4, 9, NO_ADC); +const mcu_pin_obj_t pin_PE10 = PIN(4, 10, NO_ADC); +const mcu_pin_obj_t pin_PE11 = PIN(4, 11, NO_ADC); +const mcu_pin_obj_t pin_PE12 = PIN(4, 12, NO_ADC); +const mcu_pin_obj_t pin_PE13 = PIN(4, 13, NO_ADC); +const mcu_pin_obj_t pin_PE14 = PIN(4, 14, NO_ADC); +const mcu_pin_obj_t pin_PE15 = PIN(4, 15, NO_ADC); + +const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC); +const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC); +const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC); +const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC); +const mcu_pin_obj_t pin_PB15 = PIN(1, 15, NO_ADC); + +const mcu_pin_obj_t pin_PD08 = PIN(3, 8, NO_ADC); +const mcu_pin_obj_t pin_PD09 = PIN(3, 9, NO_ADC); +const mcu_pin_obj_t pin_PD10 = PIN(3, 10, NO_ADC); +const mcu_pin_obj_t pin_PD11 = PIN(3, 11, NO_ADC); +const mcu_pin_obj_t pin_PD12 = PIN(3, 12, NO_ADC); +const mcu_pin_obj_t pin_PD13 = PIN(3, 13, NO_ADC); +const mcu_pin_obj_t pin_PD14 = PIN(3, 14, NO_ADC); +const mcu_pin_obj_t pin_PD15 = PIN(3, 15, NO_ADC); + +const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC); +const mcu_pin_obj_t pin_PC07 = PIN(2, 7, NO_ADC); +const mcu_pin_obj_t pin_PC08 = PIN(2, 8, NO_ADC); +const mcu_pin_obj_t pin_PC09 = PIN(2, 9, NO_ADC); + +const mcu_pin_obj_t pin_PA08 = PIN(0, 8, NO_ADC); +const mcu_pin_obj_t pin_PA09 = PIN(0, 9, NO_ADC); +const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC); +const mcu_pin_obj_t pin_PA11 = PIN(0, 11, NO_ADC); +const mcu_pin_obj_t pin_PA12 = PIN(0, 12, NO_ADC); +const mcu_pin_obj_t pin_PA13 = PIN(0, 13, NO_ADC); //SWDIO +const mcu_pin_obj_t pin_PA14 = PIN(0, 14, NO_ADC); //SWCLK +const mcu_pin_obj_t pin_PA15 = PIN(0, 15, NO_ADC); //JTDI + +const mcu_pin_obj_t pin_PC10 = PIN(2, 10, NO_ADC); +const mcu_pin_obj_t pin_PC11 = PIN(2, 11, NO_ADC); +const mcu_pin_obj_t pin_PC12 = PIN(2, 12, NO_ADC); + +const mcu_pin_obj_t pin_PD00 = PIN(3, 0, NO_ADC); +const mcu_pin_obj_t pin_PD01 = PIN(3, 1, NO_ADC); +const mcu_pin_obj_t pin_PD02 = PIN(3, 2, NO_ADC); +const mcu_pin_obj_t pin_PD03 = PIN(3, 3, NO_ADC); +const mcu_pin_obj_t pin_PD04 = PIN(3, 4, NO_ADC); +const mcu_pin_obj_t pin_PD05 = PIN(3, 5, NO_ADC); +const mcu_pin_obj_t pin_PD06 = PIN(3, 6, NO_ADC); +const mcu_pin_obj_t pin_PD07 = PIN(3, 7, NO_ADC); + +const mcu_pin_obj_t pin_PB03 = PIN(1, 3, NO_ADC); +const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC); +const mcu_pin_obj_t pin_PB05 = PIN(1, 5, NO_ADC); +const mcu_pin_obj_t pin_PB06 = PIN(1, 6, NO_ADC); +const mcu_pin_obj_t pin_PB07 = PIN(1, 7, NO_ADC); +const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC); +const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC); + +const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC); +const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); \ No newline at end of file diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.h b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.h new file mode 100644 index 0000000000..37d3a5cf11 --- /dev/null +++ b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.h @@ -0,0 +1,121 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland 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_STM32F4_PERIPHERALS_STM32F411VE_PINS_H +#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PINS_H + +//Pins in datasheet order: DocID026289 Rev 7 page 38. LQFP100 only +//pg 38 +extern const mcu_pin_obj_t pin_PE02; +extern const mcu_pin_obj_t pin_PE03; +extern const mcu_pin_obj_t pin_PE04; +extern const mcu_pin_obj_t pin_PE05; +//pg 39 +extern const mcu_pin_obj_t pin_PE06; +extern const mcu_pin_obj_t pin_PC13; +extern const mcu_pin_obj_t pin_PC14; +extern const mcu_pin_obj_t pin_PC15; +extern const mcu_pin_obj_t pin_PC00; +extern const mcu_pin_obj_t pin_PC01; +extern const mcu_pin_obj_t pin_PC02; +extern const mcu_pin_obj_t pin_PC03; +//pg 40 +extern const mcu_pin_obj_t pin_PA00; +extern const mcu_pin_obj_t pin_PA01; +extern const mcu_pin_obj_t pin_PA02; +extern const mcu_pin_obj_t pin_PA03; +extern const mcu_pin_obj_t pin_PA04; +extern const mcu_pin_obj_t pin_PA05; +extern const mcu_pin_obj_t pin_PA06; +extern const mcu_pin_obj_t pin_PA07; +//pg 41 +extern const mcu_pin_obj_t pin_PC04; +extern const mcu_pin_obj_t pin_PC05; +extern const mcu_pin_obj_t pin_PB00; +extern const mcu_pin_obj_t pin_PB01; +extern const mcu_pin_obj_t pin_PB02; +extern const mcu_pin_obj_t pin_PE07; +extern const mcu_pin_obj_t pin_PE08; +extern const mcu_pin_obj_t pin_PE09; +extern const mcu_pin_obj_t pin_PE10; +extern const mcu_pin_obj_t pin_PE11; +extern const mcu_pin_obj_t pin_PE12; +extern const mcu_pin_obj_t pin_PE13; +extern const mcu_pin_obj_t pin_PE14; +extern const mcu_pin_obj_t pin_PE15; +//pg 42 +extern const mcu_pin_obj_t pin_PB10; +extern const mcu_pin_obj_t pin_PB12; +extern const mcu_pin_obj_t pin_PB13; +extern const mcu_pin_obj_t pin_PB14; +extern const mcu_pin_obj_t pin_PB15; +extern const mcu_pin_obj_t pin_PD08; +extern const mcu_pin_obj_t pin_PD09; +extern const mcu_pin_obj_t pin_PD10; +extern const mcu_pin_obj_t pin_PD11; +extern const mcu_pin_obj_t pin_PD12; +//pg 43 +extern const mcu_pin_obj_t pin_PD13; +extern const mcu_pin_obj_t pin_PD14; +extern const mcu_pin_obj_t pin_PD15; +extern const mcu_pin_obj_t pin_PC06; +extern const mcu_pin_obj_t pin_PC07; +extern const mcu_pin_obj_t pin_PC08; +extern const mcu_pin_obj_t pin_PC09; +extern const mcu_pin_obj_t pin_PA08; +extern const mcu_pin_obj_t pin_PA09; +//pg 44 +extern const mcu_pin_obj_t pin_PA10; +extern const mcu_pin_obj_t pin_PA11; +extern const mcu_pin_obj_t pin_PA12; +extern const mcu_pin_obj_t pin_PA13; +extern const mcu_pin_obj_t pin_PA14; +extern const mcu_pin_obj_t pin_PA15; +extern const mcu_pin_obj_t pin_PC10; +extern const mcu_pin_obj_t pin_PC11; +extern const mcu_pin_obj_t pin_PC12; +//pg 45 +extern const mcu_pin_obj_t pin_PD00; +extern const mcu_pin_obj_t pin_PD01; +extern const mcu_pin_obj_t pin_PD02; +extern const mcu_pin_obj_t pin_PD03; +extern const mcu_pin_obj_t pin_PD04; +extern const mcu_pin_obj_t pin_PD05; +extern const mcu_pin_obj_t pin_PD06; +extern const mcu_pin_obj_t pin_PD07; +extern const mcu_pin_obj_t pin_PB03; +extern const mcu_pin_obj_t pin_PB04; +extern const mcu_pin_obj_t pin_PB05; +extern const mcu_pin_obj_t pin_PB06; +//pg 46 +extern const mcu_pin_obj_t pin_PB07; +extern const mcu_pin_obj_t pin_PB08; +extern const mcu_pin_obj_t pin_PB09; +extern const mcu_pin_obj_t pin_PE00; +extern const mcu_pin_obj_t pin_PE01; + + +#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PINS_H From 70719597ab7b3785a6641b08ef3cb82d9b6b459b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 20 Nov 2019 10:15:11 -0600 Subject: [PATCH 068/189] supervisor: tick: Rewrite without atomics --- supervisor/shared/tick.c | 17 ++++++++++------- supervisor/shared/tick.h | 1 - 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 7dc5a52d32..0be3230823 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -24,14 +24,12 @@ * THE SOFTWARE. */ -#include - #include "supervisor/shared/tick.h" #include "supervisor/filesystem.h" #include "supervisor/shared/autoreload.h" -static atomic_bool tick_up; static volatile uint64_t ticks_ms; +static volatile uint32_t background_ticks_ms32; #if CIRCUITPY_GAMEPAD #include "shared-module/gamepad/__init__.h" @@ -47,8 +45,6 @@ void supervisor_tick(void) { ticks_ms ++; - atomic_store(&tick_up, true); - #if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0 filesystem_tick(); #endif @@ -82,7 +78,14 @@ uint32_t supervisor_ticks_ms32() { extern void run_background_tasks(void); void supervisor_run_background_tasks_if_tick() { - if (atomic_exchange(&tick_up, false)) { - run_background_tasks(); + uint32_t now32 = ticks_ms; + + if (now32 == background_ticks_ms32) { + return; } + background_ticks_ms32 = now32; + + run_background_tasks(); +} + } diff --git a/supervisor/shared/tick.h b/supervisor/shared/tick.h index b662734492..eb2af29ca4 100644 --- a/supervisor/shared/tick.h +++ b/supervisor/shared/tick.h @@ -28,7 +28,6 @@ #define __INCLUDED_SUPERVISOR_TICK_H #include -#include extern void supervisor_tick(void); extern uint32_t supervisor_ticks_ms32(void); From a9baa0f954ec757ef1e3990af136a4f0b3cb2b1e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 20 Nov 2019 10:15:33 -0600 Subject: [PATCH 069/189] supervisor: tick: document --- supervisor/shared/tick.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/supervisor/shared/tick.h b/supervisor/shared/tick.h index eb2af29ca4..e747de2d83 100644 --- a/supervisor/shared/tick.h +++ b/supervisor/shared/tick.h @@ -29,9 +29,32 @@ #include +/** @brief To be called once every ms + * + * The port must call supervisor_tick once per millisecond to perform regular tasks. + * This is called from the SysTick interrupt or similar, and is safe to call in an + * interrupt context. + */ extern void supervisor_tick(void); +/** @brief Get the lower 32 bits of the time in milliseconds + * + * This can be more efficient than supervisor_ticks_ms64, for sites where a wraparound + * of ~49.5 days is not harmful. + */ extern uint32_t supervisor_ticks_ms32(void); +/** @brief Get the full time in milliseconds + * + * Because common ARM mcus cannot atomically work with 64-bit quantities, this + * function must briefly disable interrupts in order to return the value. If + * only relative durations of less than about ~49.5 days need to be considered, + * then it may be possible to use supervisor_ticks_ms64 instead. + */ extern uint64_t supervisor_ticks_ms64(void); +/** @brief Run background ticks, but only about every millisecond. + * + * Normally, this is not called directly. Instead use the RUN_BACKGROUND_TASKS + * macro. + */ extern void supervisor_run_background_if_tick(void); #endif From 46c5775ba4b9c4905f8e3f4c1842c2c6c04d8fb0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 20 Nov 2019 10:15:44 -0600 Subject: [PATCH 070/189] supervisor: tick: add supervisor_fake_tick --- supervisor/shared/tick.c | 3 +++ supervisor/shared/tick.h | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 0be3230823..69256081c4 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -88,4 +88,7 @@ void supervisor_run_background_tasks_if_tick() { run_background_tasks(); } +void supervisor_fake_tick() { + uint32_t now32 = ticks_ms; + background_ticks_ms32 = (now32 - 1); } diff --git a/supervisor/shared/tick.h b/supervisor/shared/tick.h index e747de2d83..7ce8281ba9 100644 --- a/supervisor/shared/tick.h +++ b/supervisor/shared/tick.h @@ -36,6 +36,13 @@ * interrupt context. */ extern void supervisor_tick(void); +/** @brief Cause background tasks to be called soon + * + * Normally, background tasks are only run once per tick. For other cases where + * an event noticed from an interrupt context needs to be completed by a background + * task activity, the interrupt can call supervisor_fake_tick. + */ +extern void supervisor_fake_tick(void); /** @brief Get the lower 32 bits of the time in milliseconds * * This can be more efficient than supervisor_ticks_ms64, for sites where a wraparound From 006182f4e867840266a0c3a669fc7938ef03a9fc Mon Sep 17 00:00:00 2001 From: Hierophect Date: Wed, 20 Nov 2019 15:56:00 -0500 Subject: [PATCH 071/189] Remove meowbit for now --- ports/stm32f4/boards/meowbit_v121/board.c | 39 -- .../boards/meowbit_v121/mpconfigboard.h | 52 --- .../boards/meowbit_v121/mpconfigboard.mk | 19 - ports/stm32f4/boards/meowbit_v121/pins.c | 33 -- .../boards/meowbit_v121/stm32f4xx_hal_conf.h | 440 ------------------ 5 files changed, 583 deletions(-) delete mode 100644 ports/stm32f4/boards/meowbit_v121/board.c delete mode 100644 ports/stm32f4/boards/meowbit_v121/mpconfigboard.h delete mode 100644 ports/stm32f4/boards/meowbit_v121/mpconfigboard.mk delete mode 100644 ports/stm32f4/boards/meowbit_v121/pins.c delete mode 100644 ports/stm32f4/boards/meowbit_v121/stm32f4xx_hal_conf.h diff --git a/ports/stm32f4/boards/meowbit_v121/board.c b/ports/stm32f4/boards/meowbit_v121/board.c deleted file mode 100644 index 82b0c506ed..0000000000 --- a/ports/stm32f4/boards/meowbit_v121/board.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 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 "boards/board.h" -#include "mpconfigboard.h" - -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} diff --git a/ports/stm32f4/boards/meowbit_v121/mpconfigboard.h b/ports/stm32f4/boards/meowbit_v121/mpconfigboard.h deleted file mode 100644 index 67ddc885ae..0000000000 --- a/ports/stm32f4/boards/meowbit_v121/mpconfigboard.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland 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 "Feather STM32F405 Express" -#define MICROPY_HW_MCU_NAME "STM32F405RG" - -#define FLASH_SIZE (0x100000) -#define FLASH_PAGE_SIZE (0x4000) - -#define AUTORESET_DELAY_MS 500 -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) - -// On-board flash -#define SPI_FLASH_MOSI_PIN &pin_PB05 -#define SPI_FLASH_MISO_PIN &pin_PB04 -#define SPI_FLASH_SCK_PIN &pin_PB03 -#define SPI_FLASH_CS_PIN &pin_PA15 - -#define DEFAULT_I2C_BUS_SCL (&pin_PB06) -#define DEFAULT_I2C_BUS_SDA (&pin_PB07) - -#define DEFAULT_SPI_BUS_SCK (&pin_PB13) -#define DEFAULT_SPI_BUS_MOSI (&pin_PB15) -#define DEFAULT_SPI_BUS_MISO (&pin_PB14) - -#define DEFAULT_UART_BUS_RX (&pin_PB11) -#define DEFAULT_UART_BUS_TX (&pin_PB10) diff --git a/ports/stm32f4/boards/meowbit_v121/mpconfigboard.mk b/ports/stm32f4/boards/meowbit_v121/mpconfigboard.mk deleted file mode 100644 index 5bad4e81f3..0000000000 --- a/ports/stm32f4/boards/meowbit_v121/mpconfigboard.mk +++ /dev/null @@ -1,19 +0,0 @@ -USB_VID = 0x239A -USB_PID = 0x805A -USB_PRODUCT = "Feather STM32F405 Express" -USB_MANUFACTURER = "Adafruit Industries LLC" -USB_DEVICES = "CDC,MSC" - -SPI_FLASH_FILESYSTEM = 1 -EXTERNAL_FLASH_DEVICE_COUNT = 1 -EXTERNAL_FLASH_DEVICES = GD25Q16C -LONGINT_IMPL = MPZ - -MCU_SERIES = m4 -MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f405xx -MCU_PACKAGE = 64 -CMSIS_MCU = STM32F405xx -LD_FILE = boards/STM32F405.ld -TEXT0_ADDR = 0x08000000 -TEXT1_ADDR = 0x08010000 \ No newline at end of file diff --git a/ports/stm32f4/boards/meowbit_v121/pins.c b/ports/stm32f4/boards/meowbit_v121/pins.c deleted file mode 100644 index 4aa1f362ad..0000000000 --- a/ports/stm32f4/boards/meowbit_v121/pins.c +++ /dev/null @@ -1,33 +0,0 @@ -#include "shared-bindings/board/__init__.h" - -STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PC04) }, - { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PC05) }, - - { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PC07) }, - { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PC06) }, - { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PC03) }, - { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PC02) }, - { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PC01) }, - - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) }, - - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB13) }, - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB14) }, - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB15) }, - - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB10) }, - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB11) }, - - { 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_module_globals_table); diff --git a/ports/stm32f4/boards/meowbit_v121/stm32f4xx_hal_conf.h b/ports/stm32f4/boards/meowbit_v121/stm32f4xx_hal_conf.h deleted file mode 100644 index 68a49b4ba8..0000000000 --- a/ports/stm32f4/boards/meowbit_v121/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,440 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)12000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ From 5e857fdb67c2d92836d7ed73a179fcb6c5298fed Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 20 Nov 2019 13:53:50 -0800 Subject: [PATCH 072/189] Use BluetoothError in _bleio This better differentiates errors than using OSError everywhere. --- locale/ID.po | 165 ++++++---------- locale/circuitpython.pot | 126 ++---------- locale/de_DE.po | 182 +++++++---------- locale/en_US.po | 126 ++---------- locale/en_x_pirate.po | 126 ++---------- locale/es.po | 173 +++++++--------- locale/fil.po | 166 ++++++---------- locale/fr.po | 179 +++++++---------- locale/it_IT.po | 168 ++++++---------- locale/ko.po | 126 ++---------- locale/pl.po | 171 ++++++---------- locale/pt_BR.po | 161 +++++---------- locale/zh_Latn_pinyin.po | 186 ++++++++---------- ports/nrf/common-hal/_bleio/Adapter.c | 53 ++--- ports/nrf/common-hal/_bleio/Characteristic.c | 18 +- ports/nrf/common-hal/_bleio/Connection.c | 22 +-- ports/nrf/common-hal/_bleio/Connection.h | 1 + ports/nrf/common-hal/_bleio/Service.c | 12 +- ports/nrf/common-hal/_bleio/UUID.c | 13 +- ports/nrf/common-hal/_bleio/__init__.c | 78 ++++---- ports/nrf/common-hal/_bleio/__init__.h | 5 +- py/runtime.c | 2 - shared-bindings/_bleio/Adapter.c | 2 +- shared-bindings/_bleio/Characteristic.c | 4 +- shared-bindings/_bleio/CharacteristicBuffer.c | 8 +- shared-bindings/_bleio/Connection.c | 3 +- shared-bindings/_bleio/Descriptor.c | 4 +- shared-bindings/_bleio/Service.c | 2 +- shared-bindings/_bleio/__init__.c | 58 ++++++ shared-bindings/_bleio/__init__.h | 10 + 30 files changed, 825 insertions(+), 1525 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 9cdbb64ef3..6b93b231b8 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:54-0600\n" +"POT-Creation-Date: 2019-11-20 14:01-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -488,11 +488,6 @@ msgstr "" msgid "Corrupt raw code" msgstr "" -#: ports/nrf/common-hal/_bleio/UUID.c -#, c-format -msgid "Could not decode ble_uuid, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Tidak dapat menginisialisasi UART" @@ -587,11 +582,6 @@ msgstr "" msgid "Expected tuple of length %d, got %d" msgstr "" -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed initiate attribute read, err 0x%04x" -msgstr "" - #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -601,15 +591,6 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "Gagal untuk mendapatkan mutex, status: 0x%08lX" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to add characteristic, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to add descriptor, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "Gagal untuk mengalokasikan buffer RX" @@ -620,10 +601,6 @@ msgstr "Gagal untuk mengalokasikan buffer RX" msgid "Failed to allocate RX buffer of %d bytes" msgstr "Gagal untuk megalokasikan buffer RX dari %d byte" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to change softdevice state, NRF_ERROR_%q" -msgstr "" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "" @@ -632,96 +609,11 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to create service, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -#, fuzzy -msgid "Failed to discover services" -msgstr "Gagal untuk menemukan layanan, status: 0x%08lX" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, fuzzy -msgid "Failed to get local address" -msgstr "Gagal untuk mendapatkan alamat lokal, error: 0x%08lX" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, fuzzy -msgid "Failed to get softdevice state" -msgstr "Gagal untuk mendapatkan status softdevice, error: 0x%08lX" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to notify or indicate attribute value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to pair" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, fuzzy, c-format -msgid "Failed to read CCCD value, err 0x%04x" -msgstr "Gagal untuk membaca nilai atribut, status: 0x%08lX" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to read attribute value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, fuzzy, c-format -msgid "Failed to read gatts value, err 0x%04x" -msgstr "Gagal untuk menulis nilai gatts, status: 0x%08lX" - -#: ports/nrf/common-hal/_bleio/UUID.c -#, fuzzy, c-format -msgid "Failed to register Vendor-Specific UUID, err 0x%04x" -msgstr "Gagal untuk menambahkan Vendor Spesific UUID, status: 0x%08lX" - #: ports/nrf/sd_mutex.c #, fuzzy, c-format msgid "Failed to release mutex, err 0x%04x" msgstr "Gagal untuk melepaskan mutex, status: 0x%08lX" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to start advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, c-format -msgid "Failed to start connecting, error 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to start pairing, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, fuzzy, c-format -msgid "Failed to start scanning, err 0x%04x" -msgstr "Gagal untuk melakukan scanning, status: 0x%08lX" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to stop advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to write CCCD, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, fuzzy, c-format -msgid "Failed to write attribute value, err 0x%04x" -msgstr "Gagal untuk menulis nilai atribut, status: 0x%08lX" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, fuzzy, c-format -msgid "Failed to write gatts value, err 0x%04x" -msgstr "Gagal untuk menulis nilai gatts, status: 0x%08lX" - #: py/moduerrno.c msgid "File exists" msgstr "" @@ -784,6 +676,10 @@ msgstr "" msgid "Input/output error" msgstr "" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient authentication" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1323,6 +1219,21 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "" +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown gatt error: 0x%04x" +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)." @@ -2797,14 +2708,38 @@ msgstr "" #~ msgid "Failed to create mutex" #~ msgstr "Gagal untuk membuat mutex, status: 0x%08lX" +#, fuzzy +#~ msgid "Failed to discover services" +#~ msgstr "Gagal untuk menemukan layanan, status: 0x%08lX" + +#, fuzzy +#~ msgid "Failed to get local address" +#~ msgstr "Gagal untuk mendapatkan alamat lokal, error: 0x%08lX" + +#, fuzzy +#~ msgid "Failed to get softdevice state" +#~ msgstr "Gagal untuk mendapatkan status softdevice, error: 0x%08lX" + #, fuzzy #~ msgid "Failed to notify or indicate attribute value, err %0x04x" #~ msgstr "Gagal untuk melaporkan nilai atribut, status: 0x%08lX" +#, fuzzy, c-format +#~ msgid "Failed to read CCCD value, err 0x%04x" +#~ msgstr "Gagal untuk membaca nilai atribut, status: 0x%08lX" + #, fuzzy #~ msgid "Failed to read attribute value, err %0x04x" #~ msgstr "Gagal untuk membaca nilai atribut, status: 0x%08lX" +#, fuzzy, c-format +#~ msgid "Failed to read gatts value, err 0x%04x" +#~ msgstr "Gagal untuk menulis nilai gatts, status: 0x%08lX" + +#, fuzzy, c-format +#~ msgid "Failed to register Vendor-Specific UUID, err 0x%04x" +#~ msgstr "Gagal untuk menambahkan Vendor Spesific UUID, status: 0x%08lX" + #, fuzzy #~ msgid "Failed to release mutex" #~ msgstr "Gagal untuk melepaskan mutex, status: 0x%08lX" @@ -2821,6 +2756,10 @@ msgstr "" #~ msgid "Failed to start scanning" #~ msgstr "Gagal untuk melakukan scanning, status: 0x%08lX" +#, fuzzy, c-format +#~ msgid "Failed to start scanning, err 0x%04x" +#~ msgstr "Gagal untuk melakukan scanning, status: 0x%08lX" + #, fuzzy #~ msgid "Failed to stop advertising" #~ msgstr "Gagal untuk memberhentikan advertisement, status: 0x%08lX" @@ -2829,6 +2768,14 @@ msgstr "" #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Gagal untuk memberhentikan advertisement, status: 0x%08lX" +#, fuzzy, c-format +#~ msgid "Failed to write attribute value, err 0x%04x" +#~ msgstr "Gagal untuk menulis nilai atribut, status: 0x%08lX" + +#, fuzzy, c-format +#~ msgid "Failed to write gatts value, err 0x%04x" +#~ msgstr "Gagal untuk menulis nilai gatts, status: 0x%08lX" + #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 tidak mendukung pull up" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 2c01026f9f..74c5c22f67 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:54-0600\n" +"POT-Creation-Date: 2019-11-20 14:01-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -478,11 +478,6 @@ msgstr "" msgid "Corrupt raw code" msgstr "" -#: ports/nrf/common-hal/_bleio/UUID.c -#, c-format -msgid "Could not decode ble_uuid, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -576,11 +571,6 @@ msgstr "" msgid "Expected tuple of length %d, got %d" msgstr "" -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed initiate attribute read, err 0x%04x" -msgstr "" - #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -590,15 +580,6 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to add characteristic, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to add descriptor, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "" @@ -609,10 +590,6 @@ msgstr "" msgid "Failed to allocate RX buffer of %d bytes" msgstr "" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to change softdevice state, NRF_ERROR_%q" -msgstr "" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "" @@ -621,93 +598,11 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to create service, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to discover services" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to get local address" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to get softdevice state" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to notify or indicate attribute value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to pair" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to read CCCD value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to read attribute value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to read gatts value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/UUID.c -#, c-format -msgid "Failed to register Vendor-Specific UUID, err 0x%04x" -msgstr "" - #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to release mutex, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to start advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, c-format -msgid "Failed to start connecting, error 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to start pairing, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, c-format -msgid "Failed to start scanning, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to stop advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to write CCCD, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to write attribute value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to write gatts value, err 0x%04x" -msgstr "" - #: py/moduerrno.c msgid "File exists" msgstr "" @@ -770,6 +665,10 @@ msgstr "" msgid "Input/output error" msgstr "" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient authentication" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1301,6 +1200,21 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "" +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown gatt error: 0x%04x" +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)." diff --git a/locale/de_DE.po b/locale/de_DE.po index 38a6dffb68..628fafce29 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:54-0600\n" +"POT-Creation-Date: 2019-11-20 14:01-0800\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -482,11 +482,6 @@ msgstr "Beschädigte .mpy Datei" msgid "Corrupt raw code" msgstr "Beschädigter raw code" -#: ports/nrf/common-hal/_bleio/UUID.c -#, c-format -msgid "Could not decode ble_uuid, err 0x%04x" -msgstr "Konnte ble_uuid nicht decodieren. Status: 0x%04x" - #: ports/atmel-samd/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Konnte UART nicht initialisieren" @@ -580,11 +575,6 @@ msgstr "Erwartet eine Adresse" msgid "Expected tuple of length %d, got %d" msgstr "Habe ein Tupel der Länge %d erwartet aber %d erhalten" -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed initiate attribute read, err 0x%04x" -msgstr "" - #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "Kommando nicht gesendet." @@ -594,15 +584,6 @@ msgstr "Kommando nicht gesendet." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Mutex konnte nicht akquiriert werden. Status: 0x%04x" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to add characteristic, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to add descriptor, err 0x%04x" -msgstr "Deskriptor konnte nicht hinzugefügt werden. Status: 0x%04x" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "Konnte keinen RX Buffer allozieren" @@ -613,10 +594,6 @@ msgstr "Konnte keinen RX Buffer allozieren" msgid "Failed to allocate RX buffer of %d bytes" msgstr "Konnte keine RX Buffer mit %d allozieren" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to change softdevice state, NRF_ERROR_%q" -msgstr "" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "" @@ -625,93 +602,11 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "Verbindung nicht erfolgreich: timeout" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to create service, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to discover services" -msgstr "Es konnten keine Dienste gefunden werden" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to get local address" -msgstr "Lokale Adresse konnte nicht abgerufen werden" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to get softdevice state" -msgstr "Fehler beim Abrufen des Softdevice-Status" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to notify or indicate attribute value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to pair" -msgstr "Koppeln fehlgeschlagen" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to read CCCD value, err 0x%04x" -msgstr "Kann CCCD value nicht lesen. Status: 0x%04x" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to read attribute value, err 0x%04x" -msgstr "Kann Attributwert nicht lesen, Status: 0x%04x" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to read gatts value, err 0x%04x" -msgstr "gatts value konnte nicht gelesen werden. Status: 0x%04x" - -#: ports/nrf/common-hal/_bleio/UUID.c -#, c-format -msgid "Failed to register Vendor-Specific UUID, err 0x%04x" -msgstr "Kann keine herstellerspezifische UUID hinzufügen. Status: 0x%04x" - #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to release mutex, err 0x%04x" msgstr "Mutex konnte nicht freigegeben werden. Status: 0x%04x" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to start advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, c-format -msgid "Failed to start connecting, error 0x%04x" -msgstr "Verbindung konnte nicht hergestellt werden. Status: 0x%04x" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to start pairing, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, c-format -msgid "Failed to start scanning, err 0x%04x" -msgstr "Der Scanvorgang kann nicht gestartet werden. Status: 0x%04x" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to stop advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to write CCCD, err 0x%04x" -msgstr "Konnte CCCD nicht schreiben, Status: 0x%04x" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to write attribute value, err 0x%04x" -msgstr "Kann den Attributwert nicht schreiben. Status: 0x%04x" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to write gatts value, err 0x%04x" -msgstr "gatts value konnte nicht geschrieben werden. Status: 0x%04x" - #: py/moduerrno.c msgid "File exists" msgstr "Datei existiert" @@ -778,6 +673,10 @@ msgstr "Inkorrekte Puffergröße" msgid "Input/output error" msgstr "Eingabe-/Ausgabefehler" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient authentication" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1338,6 +1237,21 @@ msgstr "Schreiben in nvm nicht möglich." msgid "Unexpected nrfx uuid type" msgstr "Unerwarteter nrfx uuid-Typ" +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown gatt error: 0x%04x" +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)." @@ -2796,6 +2710,10 @@ msgstr "" #~ msgid "Characteristic already in use by another Service." #~ msgstr "Characteristic wird bereits von einem anderen Dienst verwendet." +#, c-format +#~ msgid "Could not decode ble_uuid, err 0x%04x" +#~ msgstr "Konnte ble_uuid nicht decodieren. Status: 0x%04x" + #~ msgid "Data too large for the advertisement packet" #~ msgstr "Daten sind zu groß für das advertisement packet" @@ -2821,6 +2739,10 @@ msgstr "" #~ msgid "Failed to add characteristic, err 0x%04x" #~ msgstr "Hinzufügen des Characteristic ist gescheitert. Status: 0x%04x" +#, c-format +#~ msgid "Failed to add descriptor, err 0x%04x" +#~ msgstr "Deskriptor konnte nicht hinzugefügt werden. Status: 0x%04x" + #~ msgid "Failed to add service" #~ msgstr "Dienst konnte nicht hinzugefügt werden" @@ -2842,12 +2764,40 @@ msgstr "" #~ msgid "Failed to create mutex" #~ msgstr "Erstellen des Mutex ist fehlgeschlagen" +#~ msgid "Failed to discover services" +#~ msgstr "Es konnten keine Dienste gefunden werden" + +#~ msgid "Failed to get local address" +#~ msgstr "Lokale Adresse konnte nicht abgerufen werden" + +#~ msgid "Failed to get softdevice state" +#~ msgstr "Fehler beim Abrufen des Softdevice-Status" + #~ msgid "Failed to notify or indicate attribute value, err %0x04x" #~ msgstr "Kann den Attributwert nicht mitteilen. Status: 0x%04x" +#~ msgid "Failed to pair" +#~ msgstr "Koppeln fehlgeschlagen" + +#, c-format +#~ msgid "Failed to read CCCD value, err 0x%04x" +#~ msgstr "Kann CCCD value nicht lesen. Status: 0x%04x" + #~ msgid "Failed to read attribute value, err %0x04x" #~ msgstr "Kann den Attributwert nicht lesen. Status: 0x%04x" +#, c-format +#~ msgid "Failed to read attribute value, err 0x%04x" +#~ msgstr "Kann Attributwert nicht lesen, Status: 0x%04x" + +#, c-format +#~ msgid "Failed to read gatts value, err 0x%04x" +#~ msgstr "gatts value konnte nicht gelesen werden. Status: 0x%04x" + +#, c-format +#~ msgid "Failed to register Vendor-Specific UUID, err 0x%04x" +#~ msgstr "Kann keine herstellerspezifische UUID hinzufügen. Status: 0x%04x" + #~ msgid "Failed to release mutex" #~ msgstr "Loslassen des Mutex gescheitert" @@ -2860,18 +2810,38 @@ msgstr "" #~ msgid "Failed to start advertising, err 0x%04x" #~ msgstr "Kann advertisement nicht starten. Status: 0x%04x" +#, c-format +#~ msgid "Failed to start connecting, error 0x%04x" +#~ msgstr "Verbindung konnte nicht hergestellt werden. Status: 0x%04x" + #~ msgid "Failed to start pairing, error 0x%04x" #~ msgstr "Starten des Koppelns fehlgeschlagen, Status: 0x%04x" #~ msgid "Failed to start scanning" #~ msgstr "Der Scanvorgang kann nicht gestartet werden" +#, c-format +#~ msgid "Failed to start scanning, err 0x%04x" +#~ msgstr "Der Scanvorgang kann nicht gestartet werden. Status: 0x%04x" + #~ msgid "Failed to stop advertising" #~ msgstr "Kann advertisement nicht stoppen" #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Kann advertisement nicht stoppen. Status: 0x%04x" +#, c-format +#~ msgid "Failed to write CCCD, err 0x%04x" +#~ msgstr "Konnte CCCD nicht schreiben, Status: 0x%04x" + +#, c-format +#~ msgid "Failed to write attribute value, err 0x%04x" +#~ msgstr "Kann den Attributwert nicht schreiben. Status: 0x%04x" + +#, c-format +#~ msgid "Failed to write gatts value, err 0x%04x" +#~ msgstr "gatts value konnte nicht geschrieben werden. Status: 0x%04x" + #~ msgid "Function requires lock." #~ msgstr "" #~ "Die Funktion erwartet, dass der 'lock'-Befehl zuvor ausgeführt wurde" diff --git a/locale/en_US.po b/locale/en_US.po index 9408102d61..3fa5ffe96d 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:54-0600\n" +"POT-Creation-Date: 2019-11-20 14:01-0800\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -478,11 +478,6 @@ msgstr "" msgid "Corrupt raw code" msgstr "" -#: ports/nrf/common-hal/_bleio/UUID.c -#, c-format -msgid "Could not decode ble_uuid, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -576,11 +571,6 @@ msgstr "" msgid "Expected tuple of length %d, got %d" msgstr "" -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed initiate attribute read, err 0x%04x" -msgstr "" - #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -590,15 +580,6 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to add characteristic, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to add descriptor, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "" @@ -609,10 +590,6 @@ msgstr "" msgid "Failed to allocate RX buffer of %d bytes" msgstr "" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to change softdevice state, NRF_ERROR_%q" -msgstr "" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "" @@ -621,93 +598,11 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to create service, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to discover services" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to get local address" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to get softdevice state" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to notify or indicate attribute value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to pair" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to read CCCD value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to read attribute value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to read gatts value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/UUID.c -#, c-format -msgid "Failed to register Vendor-Specific UUID, err 0x%04x" -msgstr "" - #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to release mutex, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to start advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, c-format -msgid "Failed to start connecting, error 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to start pairing, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, c-format -msgid "Failed to start scanning, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to stop advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to write CCCD, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to write attribute value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to write gatts value, err 0x%04x" -msgstr "" - #: py/moduerrno.c msgid "File exists" msgstr "" @@ -770,6 +665,10 @@ msgstr "" msgid "Input/output error" msgstr "" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient authentication" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1301,6 +1200,21 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "" +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown gatt error: 0x%04x" +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)." diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index 6bf2d84a44..df0b132af0 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:54-0600\n" +"POT-Creation-Date: 2019-11-20 14:01-0800\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -482,11 +482,6 @@ msgstr "" msgid "Corrupt raw code" msgstr "" -#: ports/nrf/common-hal/_bleio/UUID.c -#, c-format -msgid "Could not decode ble_uuid, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -580,11 +575,6 @@ msgstr "" msgid "Expected tuple of length %d, got %d" msgstr "" -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed initiate attribute read, err 0x%04x" -msgstr "" - #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -594,15 +584,6 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to add characteristic, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to add descriptor, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "" @@ -613,10 +594,6 @@ msgstr "" msgid "Failed to allocate RX buffer of %d bytes" msgstr "" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to change softdevice state, NRF_ERROR_%q" -msgstr "" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "" @@ -625,93 +602,11 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to create service, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to discover services" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to get local address" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to get softdevice state" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to notify or indicate attribute value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to pair" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to read CCCD value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to read attribute value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to read gatts value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/UUID.c -#, c-format -msgid "Failed to register Vendor-Specific UUID, err 0x%04x" -msgstr "" - #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to release mutex, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to start advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, c-format -msgid "Failed to start connecting, error 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to start pairing, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, c-format -msgid "Failed to start scanning, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to stop advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to write CCCD, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to write attribute value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to write gatts value, err 0x%04x" -msgstr "" - #: py/moduerrno.c msgid "File exists" msgstr "" @@ -774,6 +669,10 @@ msgstr "" msgid "Input/output error" msgstr "" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient authentication" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1305,6 +1204,21 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "" +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown gatt error: 0x%04x" +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)." diff --git a/locale/es.po b/locale/es.po index 449e88a800..083702e320 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:54-0600\n" +"POT-Creation-Date: 2019-11-20 14:01-0800\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -486,11 +486,6 @@ msgstr "" msgid "Corrupt raw code" msgstr "" -#: ports/nrf/common-hal/_bleio/UUID.c -#, c-format -msgid "Could not decode ble_uuid, err 0x%04x" -msgstr "No se puede descodificar ble_uuid, err 0x%04x" - #: ports/atmel-samd/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "No se puede inicializar la UART" @@ -584,11 +579,6 @@ msgstr "" msgid "Expected tuple of length %d, got %d" msgstr "Se esperaba un tuple de %d, se obtuvo %d" -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed initiate attribute read, err 0x%04x" -msgstr "" - #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "Fallo enviando comando" @@ -598,15 +588,6 @@ msgstr "Fallo enviando comando" msgid "Failed to acquire mutex, err 0x%04x" msgstr "No se puede adquirir el mutex, status: 0x%08lX" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to add characteristic, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to add descriptor, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "Ha fallado la asignación del buffer RX" @@ -617,10 +598,6 @@ msgstr "Ha fallado la asignación del buffer RX" msgid "Failed to allocate RX buffer of %d bytes" msgstr "Falló la asignación del buffer RX de %d bytes" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to change softdevice state, NRF_ERROR_%q" -msgstr "" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "" @@ -629,94 +606,11 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to create service, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -#, fuzzy -msgid "Failed to discover services" -msgstr "No se puede descubrir servicios" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to get local address" -msgstr "No se puede obtener la dirección local" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to get softdevice state" -msgstr "No se puede obtener el estado del softdevice" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to notify or indicate attribute value, err 0x%04x" -msgstr "Error al notificar o indicar el valor del atributo, err 0x%04x" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to pair" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to read CCCD value, err 0x%04x" -msgstr "No se puede leer el valor del atributo. err 0x%02x" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, fuzzy, c-format -msgid "Failed to read attribute value, err 0x%04x" -msgstr "Error al leer valor del atributo, err 0x%04" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to read gatts value, err 0x%04x" -msgstr "No se puede escribir el valor del atributo. status: 0x%02x" - -#: ports/nrf/common-hal/_bleio/UUID.c -#, c-format -msgid "Failed to register Vendor-Specific UUID, err 0x%04x" -msgstr "Fallo al registrar el Vendor-Specific UUID, err 0x%04x" - #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to release mutex, err 0x%04x" msgstr "No se puede liberar el mutex, err 0x%04x" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to start advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, c-format -msgid "Failed to start connecting, error 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to start pairing, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, c-format -msgid "Failed to start scanning, err 0x%04x" -msgstr "No se puede iniciar el escaneo. err 0x%04x" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to stop advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to write CCCD, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to write attribute value, err 0x%04x" -msgstr "No se puede escribir el valor del atributo. err: 0x%04x" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to write gatts value, err 0x%04x" -msgstr "No se puede escribir el valor del atributo. err: 0x%04x" - #: py/moduerrno.c msgid "File exists" msgstr "El archivo ya existe" @@ -781,6 +675,10 @@ msgstr "Tamaño incorrecto del buffer" msgid "Input/output error" msgstr "error Input/output" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient authentication" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1339,6 +1237,21 @@ msgstr "Imposible escribir en nvm" msgid "Unexpected nrfx uuid type" msgstr "Tipo de uuid nrfx inesperado" +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown gatt error: 0x%04x" +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)." @@ -2795,6 +2708,10 @@ msgstr "paso cero" #~ msgid "Characteristic already in use by another Service." #~ msgstr "Características ya esta en uso por otro Serivice" +#, c-format +#~ msgid "Could not decode ble_uuid, err 0x%04x" +#~ msgstr "No se puede descodificar ble_uuid, err 0x%04x" + #, fuzzy #~ msgid "Data too large for the advertisement packet" #~ msgstr "Los datos no caben en el paquete de anuncio." @@ -2844,14 +2761,44 @@ msgstr "paso cero" #~ msgid "Failed to create mutex" #~ msgstr "No se puede leer el valor del atributo. status 0x%02x" +#, fuzzy +#~ msgid "Failed to discover services" +#~ msgstr "No se puede descubrir servicios" + +#~ msgid "Failed to get local address" +#~ msgstr "No se puede obtener la dirección local" + +#~ msgid "Failed to get softdevice state" +#~ msgstr "No se puede obtener el estado del softdevice" + #, fuzzy #~ msgid "Failed to notify or indicate attribute value, err %0x04x" #~ msgstr "No se puede notificar el valor del anuncio. status: 0x%02x" +#, c-format +#~ msgid "Failed to notify or indicate attribute value, err 0x%04x" +#~ msgstr "Error al notificar o indicar el valor del atributo, err 0x%04x" + +#, c-format +#~ msgid "Failed to read CCCD value, err 0x%04x" +#~ msgstr "No se puede leer el valor del atributo. err 0x%02x" + #, fuzzy #~ msgid "Failed to read attribute value, err %0x04x" #~ msgstr "No se puede leer el valor del atributo. status 0x%02x" +#, fuzzy, c-format +#~ msgid "Failed to read attribute value, err 0x%04x" +#~ msgstr "Error al leer valor del atributo, err 0x%04" + +#, c-format +#~ msgid "Failed to read gatts value, err 0x%04x" +#~ msgstr "No se puede escribir el valor del atributo. status: 0x%02x" + +#, c-format +#~ msgid "Failed to register Vendor-Specific UUID, err 0x%04x" +#~ msgstr "Fallo al registrar el Vendor-Specific UUID, err 0x%04x" + #, fuzzy #~ msgid "Failed to release mutex" #~ msgstr "No se puede liberar el mutex, status: 0x%08lX" @@ -2867,6 +2814,10 @@ msgstr "paso cero" #~ msgid "Failed to start scanning" #~ msgstr "No se puede iniciar el escaneo. status: 0x%02x" +#, c-format +#~ msgid "Failed to start scanning, err 0x%04x" +#~ msgstr "No se puede iniciar el escaneo. err 0x%04x" + #, fuzzy #~ msgid "Failed to stop advertising" #~ msgstr "No se puede detener el anuncio. status: 0x%02x" @@ -2874,6 +2825,14 @@ msgstr "paso cero" #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "No se puede detener el anuncio. err: 0x%04x" +#, c-format +#~ msgid "Failed to write attribute value, err 0x%04x" +#~ msgstr "No se puede escribir el valor del atributo. err: 0x%04x" + +#, c-format +#~ msgid "Failed to write gatts value, err 0x%04x" +#~ msgstr "No se puede escribir el valor del atributo. err: 0x%04x" + #~ msgid "Function requires lock." #~ msgstr "La función requiere lock" diff --git a/locale/fil.po b/locale/fil.po index 57b633890c..57ea1c8be6 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:54-0600\n" +"POT-Creation-Date: 2019-11-20 14:01-0800\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -487,11 +487,6 @@ msgstr "" msgid "Corrupt raw code" msgstr "" -#: ports/nrf/common-hal/_bleio/UUID.c -#, c-format -msgid "Could not decode ble_uuid, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Hindi ma-initialize ang UART" @@ -590,11 +585,6 @@ msgstr "" msgid "Expected tuple of length %d, got %d" msgstr "" -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed initiate attribute read, err 0x%04x" -msgstr "" - #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -604,15 +594,6 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "Nabigo sa pag kuha ng mutex, status: 0x%08lX" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to add characteristic, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to add descriptor, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "Nabigong ilaan ang RX buffer" @@ -623,10 +604,6 @@ msgstr "Nabigong ilaan ang RX buffer" msgid "Failed to allocate RX buffer of %d bytes" msgstr "Nabigong ilaan ang RX buffer ng %d bytes" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to change softdevice state, NRF_ERROR_%q" -msgstr "" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "" @@ -635,96 +612,11 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to create service, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -#, fuzzy -msgid "Failed to discover services" -msgstr "Nabigo sa pagdiscover ng services, status: 0x%08lX" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, fuzzy -msgid "Failed to get local address" -msgstr "Nabigo sa pagkuha ng local na address, , error: 0x%08lX" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, fuzzy -msgid "Failed to get softdevice state" -msgstr "Nabigo sa pagkuha ng softdevice state, error: 0x%08lX" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to notify or indicate attribute value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to pair" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, fuzzy, c-format -msgid "Failed to read CCCD value, err 0x%04x" -msgstr "Hindi mabasa ang value ng attribute, status: 0x%08lX" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to read attribute value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, fuzzy, c-format -msgid "Failed to read gatts value, err 0x%04x" -msgstr "Hindi maisulat ang gatts value, status: 0x%08lX" - -#: ports/nrf/common-hal/_bleio/UUID.c -#, fuzzy, c-format -msgid "Failed to register Vendor-Specific UUID, err 0x%04x" -msgstr "Hindi matagumpay ang paglagay ng Vender Specific UUID, status: 0x%08lX" - #: ports/nrf/sd_mutex.c #, fuzzy, c-format msgid "Failed to release mutex, err 0x%04x" msgstr "Nabigo sa pagrelease ng mutex, status: 0x%08lX" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to start advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, c-format -msgid "Failed to start connecting, error 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to start pairing, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, fuzzy, c-format -msgid "Failed to start scanning, err 0x%04x" -msgstr "Hindi masimulaan mag i-scan, status: 0x%0xlX" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to stop advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to write CCCD, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, fuzzy, c-format -msgid "Failed to write attribute value, err 0x%04x" -msgstr "Hindi maisulat ang attribute value, status: 0x%08lX" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, fuzzy, c-format -msgid "Failed to write gatts value, err 0x%04x" -msgstr "Hindi maisulat ang gatts value, status: 0x%08lX" - #: py/moduerrno.c msgid "File exists" msgstr "Mayroong file" @@ -789,6 +681,10 @@ msgstr "" msgid "Input/output error" msgstr "May mali sa Input/Output" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient authentication" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1344,6 +1240,21 @@ msgstr "Hindi ma i-sulat sa NVM." msgid "Unexpected nrfx uuid type" msgstr "hindi inaasahang indent" +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown gatt error: 0x%04x" +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)." @@ -2852,14 +2763,39 @@ msgstr "zero step" #~ msgid "Failed to create mutex" #~ msgstr "Hindi matagumpay ang pagbuo ng mutex, status: 0x%0xlX" +#, fuzzy +#~ msgid "Failed to discover services" +#~ msgstr "Nabigo sa pagdiscover ng services, status: 0x%08lX" + +#, fuzzy +#~ msgid "Failed to get local address" +#~ msgstr "Nabigo sa pagkuha ng local na address, , error: 0x%08lX" + +#, fuzzy +#~ msgid "Failed to get softdevice state" +#~ msgstr "Nabigo sa pagkuha ng softdevice state, error: 0x%08lX" + #, fuzzy #~ msgid "Failed to notify or indicate attribute value, err %0x04x" #~ msgstr "Hindi mabalitaan ang attribute value, status: 0x%08lX" +#, fuzzy, c-format +#~ msgid "Failed to read CCCD value, err 0x%04x" +#~ msgstr "Hindi mabasa ang value ng attribute, status: 0x%08lX" + #, fuzzy #~ msgid "Failed to read attribute value, err %0x04x" #~ msgstr "Hindi mabasa ang value ng attribute, status: 0x%08lX" +#, fuzzy, c-format +#~ msgid "Failed to read gatts value, err 0x%04x" +#~ msgstr "Hindi maisulat ang gatts value, status: 0x%08lX" + +#, fuzzy, c-format +#~ msgid "Failed to register Vendor-Specific UUID, err 0x%04x" +#~ msgstr "" +#~ "Hindi matagumpay ang paglagay ng Vender Specific UUID, status: 0x%08lX" + #, fuzzy #~ msgid "Failed to release mutex" #~ msgstr "Nabigo sa pagrelease ng mutex, status: 0x%08lX" @@ -2876,6 +2812,10 @@ msgstr "zero step" #~ msgid "Failed to start scanning" #~ msgstr "Hindi masimulaan mag i-scan, status: 0x%0xlX" +#, fuzzy, c-format +#~ msgid "Failed to start scanning, err 0x%04x" +#~ msgstr "Hindi masimulaan mag i-scan, status: 0x%0xlX" + #, fuzzy #~ msgid "Failed to stop advertising" #~ msgstr "Hindi mahinto ang advertisement, status: 0x%08lX" @@ -2884,6 +2824,14 @@ msgstr "zero step" #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Hindi mahinto ang advertisement, status: 0x%08lX" +#, fuzzy, c-format +#~ msgid "Failed to write attribute value, err 0x%04x" +#~ msgstr "Hindi maisulat ang attribute value, status: 0x%08lX" + +#, fuzzy, c-format +#~ msgid "Failed to write gatts value, err 0x%04x" +#~ msgstr "Hindi maisulat ang gatts value, status: 0x%08lX" + #~ msgid "Function requires lock." #~ msgstr "Kailangan ng lock ang function." diff --git a/locale/fr.po b/locale/fr.po index bad559397f..95027be722 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:54-0600\n" +"POT-Creation-Date: 2019-11-20 14:01-0800\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -493,11 +493,6 @@ msgstr "" msgid "Corrupt raw code" msgstr "" -#: ports/nrf/common-hal/_bleio/UUID.c -#, c-format -msgid "Could not decode ble_uuid, err 0x%04x" -msgstr "Impossible de décoder le 'ble_uuid', err 0x%04x" - #: ports/atmel-samd/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "L'UART n'a pu être initialisé" @@ -594,11 +589,6 @@ msgstr "" msgid "Expected tuple of length %d, got %d" msgstr "Tuple de longueur %d attendu, obtenu %d" -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed initiate attribute read, err 0x%04x" -msgstr "" - #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -608,15 +598,6 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "Echec de l'obtention de mutex, err 0x%04x" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to add characteristic, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to add descriptor, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "Echec de l'allocation du tampon RX" @@ -627,10 +608,6 @@ msgstr "Echec de l'allocation du tampon RX" msgid "Failed to allocate RX buffer of %d bytes" msgstr "Echec de l'allocation de %d octets du tampon RX" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to change softdevice state, NRF_ERROR_%q" -msgstr "" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "" @@ -639,97 +616,11 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to create service, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -#, fuzzy -msgid "Failed to discover services" -msgstr "Echec de la découverte de services" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, fuzzy -msgid "Failed to get local address" -msgstr "Echec de l'obtention de l'adresse locale" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, fuzzy -msgid "Failed to get softdevice state" -msgstr "Echec de l'obtention de l'état du périphérique" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to notify or indicate attribute value, err 0x%04x" -msgstr "" -"Impossible de notifier ou d'indiquer la valeur de l'attribut, err 0x%04x" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to pair" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, fuzzy, c-format -msgid "Failed to read CCCD value, err 0x%04x" -msgstr "Impossible de lire la valeur 'CCCD', err 0x%04x" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to read attribute value, err 0x%04x" -msgstr "Impossible de lire la valeur de l'attribut, err 0x%04x" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, fuzzy, c-format -msgid "Failed to read gatts value, err 0x%04x" -msgstr "Impossible de lire la valeur de 'gatts', err 0x%04x" - -#: ports/nrf/common-hal/_bleio/UUID.c -#, fuzzy, c-format -msgid "Failed to register Vendor-Specific UUID, err 0x%04x" -msgstr "Echec de l'ajout de l'UUID du fournisseur, err 0x%04x" - #: ports/nrf/sd_mutex.c #, fuzzy, c-format msgid "Failed to release mutex, err 0x%04x" msgstr "Impossible de libérer mutex, err 0x%04x" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to start advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, c-format -msgid "Failed to start connecting, error 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to start pairing, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, fuzzy, c-format -msgid "Failed to start scanning, err 0x%04x" -msgstr "Impossible de commencer à scanner, err 0x%04x" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to stop advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to write CCCD, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, fuzzy, c-format -msgid "Failed to write attribute value, err 0x%04x" -msgstr "Impossible d'écrire la valeur de l'attribut, err 0x%04x" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, fuzzy, c-format -msgid "Failed to write gatts value, err 0x%04x" -msgstr "Impossible d'écrire la valeur de 'gatts', err 0x%04x" - #: py/moduerrno.c msgid "File exists" msgstr "Le fichier existe" @@ -794,6 +685,10 @@ msgstr "Taille de tampon incorrecte" msgid "Input/output error" msgstr "Erreur d'entrée/sortie" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient authentication" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1367,6 +1262,21 @@ msgstr "Impossible d'écrire sur la mémoire non-volatile." msgid "Unexpected nrfx uuid type" msgstr "Type inattendu pour l'uuid nrfx" +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown gatt error: 0x%04x" +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)." @@ -2849,6 +2759,10 @@ msgstr "'step' nul" #~ msgid "Characteristic already in use by another Service." #~ msgstr "'Characteristic' déjà en utilisation par un autre service" +#, c-format +#~ msgid "Could not decode ble_uuid, err 0x%04x" +#~ msgstr "Impossible de décoder le 'ble_uuid', err 0x%04x" + #~ msgid "Data too large for the advertisement packet" #~ msgstr "Données trop volumineuses pour le paquet de diffusion" @@ -2900,14 +2814,47 @@ msgstr "'step' nul" #~ msgid "Failed to create mutex" #~ msgstr "Echec de la création de mutex" +#, fuzzy +#~ msgid "Failed to discover services" +#~ msgstr "Echec de la découverte de services" + +#, fuzzy +#~ msgid "Failed to get local address" +#~ msgstr "Echec de l'obtention de l'adresse locale" + +#, fuzzy +#~ msgid "Failed to get softdevice state" +#~ msgstr "Echec de l'obtention de l'état du périphérique" + #, fuzzy #~ msgid "Failed to notify or indicate attribute value, err %0x04x" #~ msgstr "Impossible de notifier la valeur de l'attribut. status: 0x%08lX" +#, c-format +#~ msgid "Failed to notify or indicate attribute value, err 0x%04x" +#~ msgstr "" +#~ "Impossible de notifier ou d'indiquer la valeur de l'attribut, err 0x%04x" + +#, fuzzy, c-format +#~ msgid "Failed to read CCCD value, err 0x%04x" +#~ msgstr "Impossible de lire la valeur 'CCCD', err 0x%04x" + #, fuzzy #~ msgid "Failed to read attribute value, err %0x04x" #~ msgstr "Impossible de lire la valeur de l'attribut. status: 0x%08lX" +#, c-format +#~ msgid "Failed to read attribute value, err 0x%04x" +#~ msgstr "Impossible de lire la valeur de l'attribut, err 0x%04x" + +#, fuzzy, c-format +#~ msgid "Failed to read gatts value, err 0x%04x" +#~ msgstr "Impossible de lire la valeur de 'gatts', err 0x%04x" + +#, fuzzy, c-format +#~ msgid "Failed to register Vendor-Specific UUID, err 0x%04x" +#~ msgstr "Echec de l'ajout de l'UUID du fournisseur, err 0x%04x" + #, fuzzy #~ msgid "Failed to release mutex" #~ msgstr "Impossible de libérer mutex" @@ -2924,6 +2871,10 @@ msgstr "'step' nul" #~ msgid "Failed to start scanning" #~ msgstr "Impossible de commencer à scanner" +#, fuzzy, c-format +#~ msgid "Failed to start scanning, err 0x%04x" +#~ msgstr "Impossible de commencer à scanner, err 0x%04x" + #, fuzzy #~ msgid "Failed to stop advertising" #~ msgstr "Echec de l'arrêt de diffusion" @@ -2932,6 +2883,14 @@ msgstr "'step' nul" #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Echec de l'arrêt de diffusion, err 0x%04x" +#, fuzzy, c-format +#~ msgid "Failed to write attribute value, err 0x%04x" +#~ msgstr "Impossible d'écrire la valeur de l'attribut, err 0x%04x" + +#, fuzzy, c-format +#~ msgid "Failed to write gatts value, err 0x%04x" +#~ msgstr "Impossible d'écrire la valeur de 'gatts', err 0x%04x" + #~ msgid "Function requires lock." #~ msgstr "La fonction nécessite un verrou." diff --git a/locale/it_IT.po b/locale/it_IT.po index c280b0e87a..e0519378dc 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:54-0600\n" +"POT-Creation-Date: 2019-11-20 14:01-0800\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -488,11 +488,6 @@ msgstr "" msgid "Corrupt raw code" msgstr "" -#: ports/nrf/common-hal/_bleio/UUID.c -#, c-format -msgid "Could not decode ble_uuid, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Impossibile inizializzare l'UART" @@ -590,11 +585,6 @@ msgstr "" msgid "Expected tuple of length %d, got %d" msgstr "" -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed initiate attribute read, err 0x%04x" -msgstr "" - #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -604,15 +594,6 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "Impossibile leggere valore dell'attributo. status: 0x%02x" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to add characteristic, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to add descriptor, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "Impossibile allocare buffer RX" @@ -623,10 +604,6 @@ msgstr "Impossibile allocare buffer RX" msgid "Failed to allocate RX buffer of %d bytes" msgstr "Fallita allocazione del buffer RX di %d byte" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to change softdevice state, NRF_ERROR_%q" -msgstr "" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "" @@ -635,95 +612,11 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to create service, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -#, fuzzy -msgid "Failed to discover services" -msgstr "Impossibile fermare advertisement. status: 0x%02x" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to get local address" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, fuzzy -msgid "Failed to get softdevice state" -msgstr "Impossibile fermare advertisement. status: 0x%02x" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to notify or indicate attribute value, err 0x%04x" -msgstr "Notificamento o indicazione di attribute value fallito, err 0x%04x" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to pair" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, fuzzy, c-format -msgid "Failed to read CCCD value, err 0x%04x" -msgstr "Impossibile leggere valore dell'attributo. status: 0x%02x" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to read attribute value, err 0x%04x" -msgstr "Tentative leggere attribute value fallito, err 0x%04x" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, fuzzy, c-format -msgid "Failed to read gatts value, err 0x%04x" -msgstr "Impossibile scrivere valore dell'attributo. status: 0x%02x" - -#: ports/nrf/common-hal/_bleio/UUID.c -#, fuzzy, c-format -msgid "Failed to register Vendor-Specific UUID, err 0x%04x" -msgstr "Non è possibile aggiungere l'UUID del vendor specifico da 128-bit" - #: ports/nrf/sd_mutex.c #, fuzzy, c-format msgid "Failed to release mutex, err 0x%04x" msgstr "Impossibile leggere valore dell'attributo. status: 0x%02x" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to start advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, c-format -msgid "Failed to start connecting, error 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to start pairing, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, fuzzy, c-format -msgid "Failed to start scanning, err 0x%04x" -msgstr "Impossible iniziare la scansione. status: 0x%02x" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to stop advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to write CCCD, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, fuzzy, c-format -msgid "Failed to write attribute value, err 0x%04x" -msgstr "Impossibile scrivere valore dell'attributo. status: 0x%02x" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, fuzzy, c-format -msgid "Failed to write gatts value, err 0x%04x" -msgstr "Impossibile scrivere valore dell'attributo. status: 0x%02x" - #: py/moduerrno.c msgid "File exists" msgstr "File esistente" @@ -788,6 +681,10 @@ msgstr "" msgid "Input/output error" msgstr "Errore input/output" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient authentication" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1343,6 +1240,21 @@ msgstr "Imposibile scrivere su nvm." msgid "Unexpected nrfx uuid type" msgstr "indentazione inaspettata" +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown gatt error: 0x%04x" +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)." @@ -2856,14 +2768,42 @@ msgstr "zero step" #~ msgid "Failed to create mutex" #~ msgstr "Impossibile leggere valore dell'attributo. status: 0x%02x" +#, fuzzy +#~ msgid "Failed to discover services" +#~ msgstr "Impossibile fermare advertisement. status: 0x%02x" + +#, fuzzy +#~ msgid "Failed to get softdevice state" +#~ msgstr "Impossibile fermare advertisement. status: 0x%02x" + #, fuzzy #~ msgid "Failed to notify or indicate attribute value, err %0x04x" #~ msgstr "Impossibile notificare valore dell'attributo. status: 0x%02x" +#, c-format +#~ msgid "Failed to notify or indicate attribute value, err 0x%04x" +#~ msgstr "Notificamento o indicazione di attribute value fallito, err 0x%04x" + +#, fuzzy, c-format +#~ msgid "Failed to read CCCD value, err 0x%04x" +#~ msgstr "Impossibile leggere valore dell'attributo. status: 0x%02x" + #, fuzzy #~ msgid "Failed to read attribute value, err %0x04x" #~ msgstr "Impossibile leggere valore dell'attributo. status: 0x%02x" +#, c-format +#~ msgid "Failed to read attribute value, err 0x%04x" +#~ msgstr "Tentative leggere attribute value fallito, err 0x%04x" + +#, fuzzy, c-format +#~ msgid "Failed to read gatts value, err 0x%04x" +#~ msgstr "Impossibile scrivere valore dell'attributo. status: 0x%02x" + +#, fuzzy, c-format +#~ msgid "Failed to register Vendor-Specific UUID, err 0x%04x" +#~ msgstr "Non è possibile aggiungere l'UUID del vendor specifico da 128-bit" + #, fuzzy #~ msgid "Failed to release mutex" #~ msgstr "Impossibile leggere valore dell'attributo. status: 0x%02x" @@ -2880,6 +2820,10 @@ msgstr "zero step" #~ msgid "Failed to start scanning" #~ msgstr "Impossible iniziare la scansione. status: 0x%02x" +#, fuzzy, c-format +#~ msgid "Failed to start scanning, err 0x%04x" +#~ msgstr "Impossible iniziare la scansione. status: 0x%02x" + #, fuzzy #~ msgid "Failed to stop advertising" #~ msgstr "Impossibile fermare advertisement. status: 0x%02x" @@ -2888,6 +2832,14 @@ msgstr "zero step" #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Impossibile fermare advertisement. status: 0x%02x" +#, fuzzy, c-format +#~ msgid "Failed to write attribute value, err 0x%04x" +#~ msgstr "Impossibile scrivere valore dell'attributo. status: 0x%02x" + +#, fuzzy, c-format +#~ msgid "Failed to write gatts value, err 0x%04x" +#~ msgstr "Impossibile scrivere valore dell'attributo. status: 0x%02x" + #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 non supporta pull-up" diff --git a/locale/ko.po b/locale/ko.po index fa67fda828..d6e8701fdb 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:54-0600\n" +"POT-Creation-Date: 2019-11-20 14:01-0800\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -482,11 +482,6 @@ msgstr "" msgid "Corrupt raw code" msgstr "" -#: ports/nrf/common-hal/_bleio/UUID.c -#, c-format -msgid "Could not decode ble_uuid, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -580,11 +575,6 @@ msgstr "" msgid "Expected tuple of length %d, got %d" msgstr "" -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed initiate attribute read, err 0x%04x" -msgstr "" - #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -594,15 +584,6 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to add characteristic, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to add descriptor, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "" @@ -613,10 +594,6 @@ msgstr "" msgid "Failed to allocate RX buffer of %d bytes" msgstr "" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to change softdevice state, NRF_ERROR_%q" -msgstr "" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "" @@ -625,93 +602,11 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to create service, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to discover services" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to get local address" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to get softdevice state" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to notify or indicate attribute value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to pair" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to read CCCD value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to read attribute value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to read gatts value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/UUID.c -#, c-format -msgid "Failed to register Vendor-Specific UUID, err 0x%04x" -msgstr "" - #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to release mutex, err 0x%04x" msgstr "" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to start advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, c-format -msgid "Failed to start connecting, error 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to start pairing, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, c-format -msgid "Failed to start scanning, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to stop advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to write CCCD, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to write attribute value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to write gatts value, err 0x%04x" -msgstr "" - #: py/moduerrno.c msgid "File exists" msgstr "" @@ -774,6 +669,10 @@ msgstr "" msgid "Input/output error" msgstr "" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient authentication" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1306,6 +1205,21 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "" +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown gatt error: 0x%04x" +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)." diff --git a/locale/pl.po b/locale/pl.po index 34381c08dd..08c35cd8e1 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:54-0600\n" +"POT-Creation-Date: 2019-11-20 14:01-0800\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -481,11 +481,6 @@ msgstr "" msgid "Corrupt raw code" msgstr "" -#: ports/nrf/common-hal/_bleio/UUID.c -#, c-format -msgid "Could not decode ble_uuid, err 0x%04x" -msgstr "Nie można zdekodować ble_uuid, błąd 0x%04x" - #: ports/atmel-samd/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Ustawienie UART nie powiodło się" @@ -579,11 +574,6 @@ msgstr "" msgid "Expected tuple of length %d, got %d" msgstr "Oczekiwano krotkę długości %d, otrzymano %d" -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed initiate attribute read, err 0x%04x" -msgstr "" - #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "" @@ -593,15 +583,6 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "Nie udało się uzyskać blokady, błąd 0x$04x" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to add characteristic, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to add descriptor, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "Nie udała się alokacja bufora RX" @@ -612,10 +593,6 @@ msgstr "Nie udała się alokacja bufora RX" msgid "Failed to allocate RX buffer of %d bytes" msgstr "Nie udała się alokacja %d bajtów na bufor RX" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to change softdevice state, NRF_ERROR_%q" -msgstr "" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "" @@ -624,93 +601,11 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to create service, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to discover services" -msgstr "Nie udało się odkryć serwisów" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to get local address" -msgstr "Nie udało się uzyskać lokalnego adresu" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to get softdevice state" -msgstr "Nie udało się odczytać stanu softdevice" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to notify or indicate attribute value, err 0x%04x" -msgstr "Nie udało się powiadomić o wartości atrybutu, błąd 0x%04x" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to pair" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to read CCCD value, err 0x%04x" -msgstr "Nie udało się odczytać CCCD, błąd 0x%04x" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to read attribute value, err 0x%04x" -msgstr "Nie udało się odczytać wartości atrybutu, błąd 0x%04x" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to read gatts value, err 0x%04x" -msgstr "Nie udało się odczytać gatts, błąd 0x%04x" - -#: ports/nrf/common-hal/_bleio/UUID.c -#, c-format -msgid "Failed to register Vendor-Specific UUID, err 0x%04x" -msgstr "Nie udało się zarejestrować UUID dostawcy, błąd 0x%04x" - #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to release mutex, err 0x%04x" msgstr "Nie udało się zwolnić blokady, błąd 0x%04x" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to start advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, c-format -msgid "Failed to start connecting, error 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to start pairing, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, c-format -msgid "Failed to start scanning, err 0x%04x" -msgstr "Nie udało się rozpocząć skanowania, błąd 0x%04x" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to stop advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to write CCCD, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to write attribute value, err 0x%04x" -msgstr "Nie udało się zapisać atrybutu, błąd 0x%04x" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to write gatts value, err 0x%04x" -msgstr "Nie udało się zapisać gatts, błąd 0x%04x" - #: py/moduerrno.c msgid "File exists" msgstr "Plik istnieje" @@ -775,6 +670,10 @@ msgstr "Niewłaściwa wielkość bufora" msgid "Input/output error" msgstr "Błąd I/O" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient authentication" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1321,6 +1220,21 @@ msgstr "Błąd zapisu do NVM." msgid "Unexpected nrfx uuid type" msgstr "Nieoczekiwany typ nrfx uuid." +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown gatt error: 0x%04x" +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)." @@ -2740,6 +2654,10 @@ msgstr "zerowy krok" #~ msgid "Characteristic already in use by another Service." #~ msgstr "Charakterystyka w użyciu w innym serwisie" +#, c-format +#~ msgid "Could not decode ble_uuid, err 0x%04x" +#~ msgstr "Nie można zdekodować ble_uuid, błąd 0x%04x" + #~ msgid "Data too large for the advertisement packet" #~ msgstr "Zbyt dużo danych pakietu rozgłoszeniowego" @@ -2771,6 +2689,35 @@ msgstr "zerowy krok" #~ msgid "Failed to create mutex" #~ msgstr "Nie udało się stworzyć blokady" +#~ msgid "Failed to discover services" +#~ msgstr "Nie udało się odkryć serwisów" + +#~ msgid "Failed to get local address" +#~ msgstr "Nie udało się uzyskać lokalnego adresu" + +#~ msgid "Failed to get softdevice state" +#~ msgstr "Nie udało się odczytać stanu softdevice" + +#, c-format +#~ msgid "Failed to notify or indicate attribute value, err 0x%04x" +#~ msgstr "Nie udało się powiadomić o wartości atrybutu, błąd 0x%04x" + +#, c-format +#~ msgid "Failed to read CCCD value, err 0x%04x" +#~ msgstr "Nie udało się odczytać CCCD, błąd 0x%04x" + +#, c-format +#~ msgid "Failed to read attribute value, err 0x%04x" +#~ msgstr "Nie udało się odczytać wartości atrybutu, błąd 0x%04x" + +#, c-format +#~ msgid "Failed to read gatts value, err 0x%04x" +#~ msgstr "Nie udało się odczytać gatts, błąd 0x%04x" + +#, c-format +#~ msgid "Failed to register Vendor-Specific UUID, err 0x%04x" +#~ msgstr "Nie udało się zarejestrować UUID dostawcy, błąd 0x%04x" + #~ msgid "Failed to release mutex" #~ msgstr "Nie udało się zwolnić blokady" @@ -2783,12 +2730,24 @@ msgstr "zerowy krok" #~ msgid "Failed to start scanning" #~ msgstr "Nie udało się rozpocząć skanowania" +#, c-format +#~ msgid "Failed to start scanning, err 0x%04x" +#~ msgstr "Nie udało się rozpocząć skanowania, błąd 0x%04x" + #~ msgid "Failed to stop advertising" #~ msgstr "Nie udało się zatrzymać rozgłaszania" #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Nie udało się zatrzymać rozgłaszania, błąd 0x%04x" +#, c-format +#~ msgid "Failed to write attribute value, err 0x%04x" +#~ msgstr "Nie udało się zapisać atrybutu, błąd 0x%04x" + +#, c-format +#~ msgid "Failed to write gatts value, err 0x%04x" +#~ msgstr "Nie udało się zapisać gatts, błąd 0x%04x" + #~ msgid "Invalid bit clock pin" #~ msgstr "Zła nóżka zegara" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 01a9f04702..dad3060cef 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:54-0600\n" +"POT-Creation-Date: 2019-11-20 14:01-0800\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -484,11 +484,6 @@ msgstr "" msgid "Corrupt raw code" msgstr "" -#: ports/nrf/common-hal/_bleio/UUID.c -#, c-format -msgid "Could not decode ble_uuid, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Não foi possível inicializar o UART" @@ -585,11 +580,6 @@ msgstr "" msgid "Expected tuple of length %d, got %d" msgstr "" -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed initiate attribute read, err 0x%04x" -msgstr "" - #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "Falha ao enviar comando." @@ -599,15 +589,6 @@ msgstr "Falha ao enviar comando." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Não é possível ler o valor do atributo. status: 0x%02x" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to add characteristic, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to add descriptor, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "Falha ao alocar buffer RX" @@ -618,10 +599,6 @@ msgstr "Falha ao alocar buffer RX" msgid "Failed to allocate RX buffer of %d bytes" msgstr "Falha ao alocar buffer RX de %d bytes" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to change softdevice state, NRF_ERROR_%q" -msgstr "" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "" @@ -630,95 +607,11 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to create service, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -#, fuzzy -msgid "Failed to discover services" -msgstr "Não pode parar propaganda. status: 0x%02x" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to get local address" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, fuzzy -msgid "Failed to get softdevice state" -msgstr "Não pode parar propaganda. status: 0x%02x" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to notify or indicate attribute value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to pair" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, fuzzy, c-format -msgid "Failed to read CCCD value, err 0x%04x" -msgstr "Não é possível ler o valor do atributo. status: 0x%02x" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to read attribute value, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, fuzzy, c-format -msgid "Failed to read gatts value, err 0x%04x" -msgstr "Não é possível gravar o valor do atributo. status: 0x%02x" - -#: ports/nrf/common-hal/_bleio/UUID.c -#, fuzzy, c-format -msgid "Failed to register Vendor-Specific UUID, err 0x%04x" -msgstr "Não é possível adicionar o UUID de 128 bits específico do fornecedor." - #: ports/nrf/sd_mutex.c #, fuzzy, c-format msgid "Failed to release mutex, err 0x%04x" msgstr "Não é possível ler o valor do atributo. status: 0x%02x" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to start advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, c-format -msgid "Failed to start connecting, error 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to start pairing, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, fuzzy, c-format -msgid "Failed to start scanning, err 0x%04x" -msgstr "Não é possível iniciar o anúncio. status: 0x%02x" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to stop advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to write CCCD, err 0x%04x" -msgstr "" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, fuzzy, c-format -msgid "Failed to write attribute value, err 0x%04x" -msgstr "Não é possível gravar o valor do atributo. status: 0x%02x" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, fuzzy, c-format -msgid "Failed to write gatts value, err 0x%04x" -msgstr "Não é possível gravar o valor do atributo. status: 0x%02x" - #: py/moduerrno.c msgid "File exists" msgstr "Arquivo já existe" @@ -781,6 +674,10 @@ msgstr "" msgid "Input/output error" msgstr "" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient authentication" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1320,6 +1217,21 @@ msgstr "Não é possível gravar no nvm." msgid "Unexpected nrfx uuid type" msgstr "" +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown gatt error: 0x%04x" +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)." @@ -2778,14 +2690,35 @@ msgstr "passo zero" #~ msgid "Failed to create mutex" #~ msgstr "Não é possível ler o valor do atributo. status: 0x%02x" +#, fuzzy +#~ msgid "Failed to discover services" +#~ msgstr "Não pode parar propaganda. status: 0x%02x" + +#, fuzzy +#~ msgid "Failed to get softdevice state" +#~ msgstr "Não pode parar propaganda. status: 0x%02x" + #, fuzzy #~ msgid "Failed to notify or indicate attribute value, err %0x04x" #~ msgstr "Não é possível gravar o valor do atributo. status: 0x%02x" +#, fuzzy, c-format +#~ msgid "Failed to read CCCD value, err 0x%04x" +#~ msgstr "Não é possível ler o valor do atributo. status: 0x%02x" + #, fuzzy #~ msgid "Failed to read attribute value, err %0x04x" #~ msgstr "Não é possível ler o valor do atributo. status: 0x%02x" +#, fuzzy, c-format +#~ msgid "Failed to read gatts value, err 0x%04x" +#~ msgstr "Não é possível gravar o valor do atributo. status: 0x%02x" + +#, fuzzy, c-format +#~ msgid "Failed to register Vendor-Specific UUID, err 0x%04x" +#~ msgstr "" +#~ "Não é possível adicionar o UUID de 128 bits específico do fornecedor." + #, fuzzy #~ msgid "Failed to release mutex" #~ msgstr "Não é possível ler o valor do atributo. status: 0x%02x" @@ -2802,6 +2735,10 @@ msgstr "passo zero" #~ msgid "Failed to start scanning" #~ msgstr "Não é possível iniciar o anúncio. status: 0x%02x" +#, fuzzy, c-format +#~ msgid "Failed to start scanning, err 0x%04x" +#~ msgstr "Não é possível iniciar o anúncio. status: 0x%02x" + #, fuzzy #~ msgid "Failed to stop advertising" #~ msgstr "Não pode parar propaganda. status: 0x%02x" @@ -2810,6 +2747,14 @@ msgstr "passo zero" #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Não pode parar propaganda. status: 0x%02x" +#, fuzzy, c-format +#~ msgid "Failed to write attribute value, err 0x%04x" +#~ msgstr "Não é possível gravar o valor do atributo. status: 0x%02x" + +#, fuzzy, c-format +#~ msgid "Failed to write gatts value, err 0x%04x" +#~ msgstr "Não é possível gravar o valor do atributo. status: 0x%02x" + #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 não suporta pull up." diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 750cdd9d88..d7a4039bb1 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-17 20:54-0600\n" +"POT-Creation-Date: 2019-11-20 14:01-0800\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -482,11 +482,6 @@ msgstr "Fǔbài de .mpy wénjiàn" msgid "Corrupt raw code" msgstr "Sǔnhuài de yuánshǐ dàimǎ" -#: ports/nrf/common-hal/_bleio/UUID.c -#, c-format -msgid "Could not decode ble_uuid, err 0x%04x" -msgstr "Wúfǎ jiěmǎ kě dú_uuid, err 0x%04x" - #: ports/atmel-samd/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Wúfǎ chūshǐhuà UART" @@ -580,11 +575,6 @@ msgstr "Qídài yīgè dìzhǐ" msgid "Expected tuple of length %d, got %d" msgstr "Qīwàng de chángdù wèi %d de yuán zǔ, dédào %d" -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed initiate attribute read, err 0x%04x" -msgstr "" - #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." msgstr "Fāsòng mìnglìng shībài." @@ -594,15 +584,6 @@ msgstr "Fāsòng mìnglìng shībài." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Wúfǎ huòdé mutex, err 0x%04x" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to add characteristic, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to add descriptor, err 0x%04x" -msgstr "Wúfǎ tiānjiā miáoshù fú, err 0x%04x" - #: ports/atmel-samd/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c msgid "Failed to allocate RX buffer" msgstr "Fēnpèi RX huǎnchōng shībài" @@ -613,10 +594,6 @@ msgstr "Fēnpèi RX huǎnchōng shībài" msgid "Failed to allocate RX buffer of %d bytes" msgstr "Fēnpèi RX huǎnchōng qū%d zì jié shībài" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to change softdevice state, NRF_ERROR_%q" -msgstr "" - #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" msgstr "" @@ -625,93 +602,11 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "Liánjiē shībài: Chāoshí" -#: ports/nrf/common-hal/_bleio/Service.c -msgid "Failed to create service, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to discover services" -msgstr "Fāxiàn fúwù shībài" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to get local address" -msgstr "Huòqǔ běndì dìzhǐ shībài" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to get softdevice state" -msgstr "Wúfǎ huòdé ruǎnjiàn shèbèi zhuàngtài" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to notify or indicate attribute value, err 0x%04x" -msgstr "Wúfǎ tōngzhī huò xiǎnshì shǔxìng zhí, err 0x%04x" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to pair" -msgstr "Pèiduì shībài" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to read CCCD value, err 0x%04x" -msgstr "Dòu qǔ CCCD zhí, err 0x%04x shībài" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to read attribute value, err 0x%04x" -msgstr "Dòu qǔ shǔxìng zhí shībài, err 0x%04x" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to read gatts value, err 0x%04x" -msgstr "Wúfǎ dòu qǔ gatts zhí, err 0x%04x" - -#: ports/nrf/common-hal/_bleio/UUID.c -#, c-format -msgid "Failed to register Vendor-Specific UUID, err 0x%04x" -msgstr "Wúfǎ zhùcè màizhǔ tèdìng de UUID, err 0x%04x" - #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to release mutex, err 0x%04x" msgstr "Wúfǎ shìfàng mutex, err 0x%04x" -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to start advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, c-format -msgid "Failed to start connecting, error 0x%04x" -msgstr "Wúfǎ kāishǐ liánjiē, cuòwù 0x%04x" - -#: ports/nrf/common-hal/_bleio/Connection.c -msgid "Failed to start pairing, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Adapter.c -#, c-format -msgid "Failed to start scanning, err 0x%04x" -msgstr "Qǐdòng sǎomiáo shībài, err 0x%04x" - -#: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Failed to stop advertising, NRF_ERROR_%q" -msgstr "" - -#: ports/nrf/common-hal/_bleio/Characteristic.c -#, c-format -msgid "Failed to write CCCD, err 0x%04x" -msgstr "Wúfǎ xiě rù CCCD, cuòwù 0x%04x" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to write attribute value, err 0x%04x" -msgstr "Xiě rù shǔxìng zhí shībài, err 0x%04x" - -#: ports/nrf/common-hal/_bleio/__init__.c -#, c-format -msgid "Failed to write gatts value, err 0x%04x" -msgstr "Xiě rù gatts zhí,err 0x%04x shībài" - #: py/moduerrno.c msgid "File exists" msgstr "Wénjiàn cúnzài" @@ -776,6 +671,10 @@ msgstr "Huǎnchōng qū dàxiǎo bù zhèngquè" msgid "Input/output error" msgstr "Shūrù/shūchū cuòwù" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient authentication" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1327,6 +1226,21 @@ msgstr "Wúfǎ xiě rù nvm." msgid "Unexpected nrfx uuid type" msgstr "Yìwài de nrfx uuid lèixíng" +#: ports/nrf/common-hal/_bleio/__init__.c +#, c-format +msgid "Unknown gatt error: 0x%04x" +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)." @@ -2756,6 +2670,10 @@ msgstr "líng bù" #~ msgid "Characteristic already in use by another Service." #~ msgstr "Qítā fúwù bùmén yǐ shǐyòng de gōngnéng." +#, c-format +#~ msgid "Could not decode ble_uuid, err 0x%04x" +#~ msgstr "Wúfǎ jiěmǎ kě dú_uuid, err 0x%04x" + #~ msgid "Data too large for the advertisement packet" #~ msgstr "Guǎnggào bāo de shùjù tài dà" @@ -2768,6 +2686,10 @@ msgstr "líng bù" #~ msgid "Failed to add characteristic, err 0x%04x" #~ msgstr "Tiānjiā tèxìng shībài, err 0x%04x" +#, c-format +#~ msgid "Failed to add descriptor, err 0x%04x" +#~ msgstr "Wúfǎ tiānjiā miáoshù fú, err 0x%04x" + #~ msgid "Failed to add service" #~ msgstr "Tiānjiā fúwù shībài" @@ -2792,6 +2714,38 @@ msgstr "líng bù" #~ msgid "Failed to create mutex" #~ msgstr "Wúfǎ chuàngjiàn hù chì suǒ" +#~ msgid "Failed to discover services" +#~ msgstr "Fāxiàn fúwù shībài" + +#~ msgid "Failed to get local address" +#~ msgstr "Huòqǔ běndì dìzhǐ shībài" + +#~ msgid "Failed to get softdevice state" +#~ msgstr "Wúfǎ huòdé ruǎnjiàn shèbèi zhuàngtài" + +#, c-format +#~ msgid "Failed to notify or indicate attribute value, err 0x%04x" +#~ msgstr "Wúfǎ tōngzhī huò xiǎnshì shǔxìng zhí, err 0x%04x" + +#~ msgid "Failed to pair" +#~ msgstr "Pèiduì shībài" + +#, c-format +#~ msgid "Failed to read CCCD value, err 0x%04x" +#~ msgstr "Dòu qǔ CCCD zhí, err 0x%04x shībài" + +#, c-format +#~ msgid "Failed to read attribute value, err 0x%04x" +#~ msgstr "Dòu qǔ shǔxìng zhí shībài, err 0x%04x" + +#, c-format +#~ msgid "Failed to read gatts value, err 0x%04x" +#~ msgstr "Wúfǎ dòu qǔ gatts zhí, err 0x%04x" + +#, c-format +#~ msgid "Failed to register Vendor-Specific UUID, err 0x%04x" +#~ msgstr "Wúfǎ zhùcè màizhǔ tèdìng de UUID, err 0x%04x" + #~ msgid "Failed to release mutex" #~ msgstr "Wúfǎ shìfàng mutex" @@ -2804,18 +2758,38 @@ msgstr "líng bù" #~ msgid "Failed to start advertising, err 0x%04x" #~ msgstr "Qǐdòng guǎnggào shībài, err 0x%04x" +#, c-format +#~ msgid "Failed to start connecting, error 0x%04x" +#~ msgstr "Wúfǎ kāishǐ liánjiē, cuòwù 0x%04x" + #~ msgid "Failed to start pairing, error 0x%04x" #~ msgstr "Wúfǎ kāishǐ pèiduì, cuòwù 0x%04x" #~ msgid "Failed to start scanning" #~ msgstr "Qǐdòng sǎomiáo shībài" +#, c-format +#~ msgid "Failed to start scanning, err 0x%04x" +#~ msgstr "Qǐdòng sǎomiáo shībài, err 0x%04x" + #~ msgid "Failed to stop advertising" #~ msgstr "Wúfǎ tíngzhǐ guǎnggào" #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Wúfǎ tíngzhǐ guǎnggào, err 0x%04x" +#, c-format +#~ msgid "Failed to write CCCD, err 0x%04x" +#~ msgstr "Wúfǎ xiě rù CCCD, cuòwù 0x%04x" + +#, c-format +#~ msgid "Failed to write attribute value, err 0x%04x" +#~ msgstr "Xiě rù shǔxìng zhí shībài, err 0x%04x" + +#, c-format +#~ msgid "Failed to write gatts value, err 0x%04x" +#~ msgstr "Xiě rù gatts zhí,err 0x%04x shībài" + #~ msgid "Invalid bit clock pin" #~ msgstr "Wúxiào de wèi shízhōng yǐn jiǎo" diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index 295a42d63b..7d87b3579f 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -172,7 +172,7 @@ STATIC bool adapter_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { break; } } - + // Central has connected. ble_gap_evt_connected_t* connected = &ble_evt->evt.gap_evt.params.connected; @@ -209,7 +209,7 @@ STATIC bool adapter_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { obj->disconnect_reason = ble_evt->evt.gap_evt.params.disconnected.reason; } self->connection_objs = NULL; - + break; } @@ -227,13 +227,7 @@ STATIC bool adapter_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { } STATIC void get_address(bleio_adapter_obj_t *self, ble_gap_addr_t *address) { - uint32_t err_code; - - err_code = sd_ble_gap_addr_get(address); - - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg(translate("Failed to get local address")); - } + check_nrf_error(sd_ble_gap_addr_get(address)); } char default_ble_name[] = { 'C', 'I', 'R', 'C', 'U', 'I', 'T', 'P', 'Y', 0, 0, 0, 0 , 0}; @@ -274,9 +268,7 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable // Re-init USB hardware init_usb_hardware(); - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg_varg(translate("Failed to change softdevice state, NRF_ERROR_%q"), MP_OBJ_QSTR_VALUE(base_error_messages[err_code - NRF_ERROR_BASE_NUM])); - } + check_nrf_error(err_code); // Add a handler for incoming peripheral connections. if (enabled) { @@ -298,10 +290,7 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable bool common_hal_bleio_adapter_get_enabled(bleio_adapter_obj_t *self) { uint8_t is_enabled; - const uint32_t err_code = sd_softdevice_is_enabled(&is_enabled); - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg(translate("Failed to get softdevice state")); - } + check_nrf_error(sd_softdevice_is_enabled(&is_enabled)); return is_enabled; } @@ -373,7 +362,7 @@ STATIC bool scan_on_ble_evt(ble_evt_t *ble_evt, void *scan_results_in) { mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t* prefixes, size_t prefix_length, bool extended, mp_int_t buffer_size, mp_float_t timeout, mp_float_t interval, mp_float_t window, mp_int_t minimum_rssi, bool active) { if (self->scan_results != NULL) { if (!shared_module_bleio_scanresults_get_done(self->scan_results)) { - mp_raise_RuntimeError(translate("Scan already in progess. Stop with stop_scan.")); + mp_raise_bleio_BluetoothError(translate("Scan already in progess. Stop with stop_scan.")); } self->scan_results = NULL; } @@ -384,7 +373,7 @@ mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t* self->scan_results->common_hal_data = sd_data; sd_data->len = max_packet_size; sd_data->p_data = raw_data + sizeof(ble_data_t); - + ble_drv_add_event_handler(scan_on_ble_evt, self->scan_results); uint32_t nrf_timeout = SEC_TO_UNITS(timeout, UNIT_10_MS); @@ -406,7 +395,7 @@ mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t* if (err_code != NRF_SUCCESS) { self->scan_results = NULL; ble_drv_remove_event_handler(scan_on_ble_evt, self->scan_results); - mp_raise_OSError_msg_varg(translate("Failed to start scanning, err 0x%04x"), err_code); + check_nrf_error(err_code); } return MP_OBJ_FROM_PTR(self->scan_results); @@ -431,7 +420,7 @@ STATIC bool connect_on_ble_evt(ble_evt_t *ble_evt, void *info_in) { case BLE_GAP_EVT_CONNECTED: info->conn_handle = ble_evt->evt.gap_evt.conn_handle; info->done = true; - + break; case BLE_GAP_EVT_TIMEOUT: @@ -479,7 +468,7 @@ mp_obj_t common_hal_bleio_adapter_connect(bleio_adapter_obj_t *self, bleio_addre if (err_code != NRF_SUCCESS) { ble_drv_remove_event_handler(connect_on_ble_evt, &event_info); - mp_raise_OSError_msg_varg(translate("Failed to start connecting, error 0x%04x"), err_code); + check_nrf_error(err_code); } while (!event_info.done) { @@ -489,7 +478,7 @@ mp_obj_t common_hal_bleio_adapter_connect(bleio_adapter_obj_t *self, bleio_addre ble_drv_remove_event_handler(connect_on_ble_evt, &event_info); if (event_info.conn_handle == BLE_CONN_HANDLE_INVALID) { - mp_raise_OSError_msg(translate("Failed to connect: timeout")); + mp_raise_bleio_BluetoothError(translate("Failed to connect: timeout")); } // Make the connection object and return it. @@ -500,7 +489,7 @@ mp_obj_t common_hal_bleio_adapter_connect(bleio_adapter_obj_t *self, bleio_addre } } - mp_raise_OSError_msg(translate("Failed to connect: internal error")); + mp_raise_bleio_BluetoothError(translate("Failed to connect: internal error")); return mp_const_none; } @@ -558,12 +547,10 @@ uint32_t _common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool connectable, mp_float_t interval, mp_buffer_info_t *advertising_data_bufinfo, mp_buffer_info_t *scan_response_data_bufinfo) { if (self->current_advertising_data != NULL && self->current_advertising_data == self->advertising_data) { - mp_raise_OSError_msg(translate("Already advertising.")); + mp_raise_bleio_BluetoothError(translate("Already advertising.")); } // interval value has already been validated. - uint32_t err_code; - check_data_fit(advertising_data_bufinfo->len); check_data_fit(scan_response_data_bufinfo->len); // The advertising data buffers must not move, because the SoftDevice depends on them. @@ -574,15 +561,15 @@ void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool if (self->scan_response_data == NULL) { self->scan_response_data = (uint8_t *) gc_alloc(BLE_GAP_ADV_SET_DATA_SIZE_MAX * sizeof(uint8_t), false, true); } - + memcpy(self->advertising_data, advertising_data_bufinfo->buf, advertising_data_bufinfo->len); memcpy(self->scan_response_data, scan_response_data_bufinfo->buf, scan_response_data_bufinfo->len); - err_code = _common_hal_bleio_adapter_start_advertising(self, connectable, interval, self->advertising_data, advertising_data_bufinfo->len, self->scan_response_data, scan_response_data_bufinfo->len); - - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg_varg(translate("Failed to start advertising, NRF_ERROR_%q"), MP_OBJ_QSTR_VALUE(base_error_messages[err_code - NRF_ERROR_BASE_NUM])); - } + check_nrf_error(_common_hal_bleio_adapter_start_advertising(self, connectable, interval, + self->advertising_data, + advertising_data_bufinfo->len, + self->scan_response_data, + scan_response_data_bufinfo->len)); } void common_hal_bleio_adapter_stop_advertising(bleio_adapter_obj_t *self) { @@ -594,7 +581,7 @@ void common_hal_bleio_adapter_stop_advertising(bleio_adapter_obj_t *self) { self->current_advertising_data = NULL; if ((err_code != NRF_SUCCESS) && (err_code != NRF_ERROR_INVALID_STATE)) { - mp_raise_OSError_msg_varg(translate("Failed to stop advertising, NRF_ERROR_%q"), MP_OBJ_QSTR_VALUE(base_error_messages[err_code - NRF_ERROR_BASE_NUM])); + check_nrf_error(err_code); } } diff --git a/ports/nrf/common-hal/_bleio/Characteristic.c b/ports/nrf/common-hal/_bleio/Characteristic.c index ab765d1ed3..9f1255e32f 100644 --- a/ports/nrf/common-hal/_bleio/Characteristic.c +++ b/ports/nrf/common-hal/_bleio/Characteristic.c @@ -46,8 +46,8 @@ STATIC uint16_t characteristic_get_cccd(uint16_t cccd_handle, uint16_t conn_hand if (err_code == BLE_ERROR_GATTS_SYS_ATTR_MISSING) { // CCCD is not set, so say that neither Notify nor Indicate is enabled. cccd = 0; - } else if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg_varg(translate("Failed to read CCCD value, err 0x%04x"), err_code); + } else { + check_nrf_error(err_code); } return cccd; @@ -78,7 +78,7 @@ STATIC void characteristic_gatts_notify_indicate(uint16_t handle, uint16_t conn_ } // Some real error has occurred. - mp_raise_OSError_msg_varg(translate("Failed to notify or indicate attribute value, err 0x%04x"), err_code); + check_nrf_error(err_code); } } @@ -213,11 +213,7 @@ void common_hal_bleio_characteristic_add_descriptor(bleio_characteristic_obj_t * .max_len = descriptor->max_length, }; - uint32_t err_code = sd_ble_gatts_descriptor_add(self->handle, &desc_attr, &descriptor->handle); - - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg_varg(translate("Failed to add descriptor, err 0x%04x"), err_code); - } + check_nrf_error(sd_ble_gatts_descriptor_add(self->handle, &desc_attr, &descriptor->handle)); descriptor->next = self->descriptor_list; self->descriptor_list = descriptor; @@ -225,11 +221,11 @@ void common_hal_bleio_characteristic_add_descriptor(bleio_characteristic_obj_t * void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self, bool notify, bool indicate) { if (self->cccd_handle == BLE_GATT_HANDLE_INVALID) { - mp_raise_ValueError(translate("No CCCD for this Characteristic")); + mp_raise_bleio_BluetoothError(translate("No CCCD for this Characteristic")); } if (!common_hal_bleio_service_get_is_remote(self->service)) { - mp_raise_ValueError(translate("Can't set CCCD on local Characteristic")); + mp_raise_bleio_RoleError(translate("Can't set CCCD on local Characteristic")); } const uint16_t conn_handle = bleio_connection_get_conn_handle(self->service->connection); @@ -261,7 +257,7 @@ void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self, } // Some real error occurred. - mp_raise_OSError_msg_varg(translate("Failed to write CCCD, err 0x%04x"), err_code); + check_nrf_error(err_code); } } diff --git a/ports/nrf/common-hal/_bleio/Connection.c b/ports/nrf/common-hal/_bleio/Connection.c index 5d3e3ace11..65fadfecce 100644 --- a/ports/nrf/common-hal/_bleio/Connection.c +++ b/ports/nrf/common-hal/_bleio/Connection.c @@ -162,7 +162,8 @@ bool connection_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { case BLE_GAP_EVT_AUTH_STATUS: { // 0x19 // Pairing process completed ble_gap_evt_auth_status_t* status = &ble_evt->evt.gap_evt.params.auth_status; - if (BLE_GAP_SEC_STATUS_SUCCESS == status->auth_status) { + self->sec_status = status->auth_status; + if (status->auth_status == BLE_GAP_SEC_STATUS_SUCCESS) { // TODO _ediv = bonding_keys->own_enc.master_id.ediv; self->pair_status = PAIR_PAIRED; } else { @@ -242,19 +243,13 @@ void common_hal_bleio_connection_disconnect(bleio_connection_internal_t *self) { void common_hal_bleio_connection_pair(bleio_connection_internal_t *self) { self->pair_status = PAIR_WAITING; - uint32_t err_code = sd_ble_gap_authenticate(self->conn_handle, &pairing_sec_params); - - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg_varg(translate("Failed to start pairing, NRF_ERROR_%q"), MP_OBJ_QSTR_VALUE(base_error_messages[err_code - NRF_ERROR_BASE_NUM])); - } + check_nrf_error(sd_ble_gap_authenticate(self->conn_handle, &pairing_sec_params)); while (self->pair_status == PAIR_WAITING) { RUN_BACKGROUND_TASKS; } - if (self->pair_status == PAIR_NOT_PAIRED) { - mp_raise_OSError_msg(translate("Failed to pair")); - } + check_sec_status(self->sec_status); } @@ -263,11 +258,8 @@ STATIC bool discover_next_services(bleio_connection_internal_t* connection, uint m_discovery_successful = false; m_discovery_in_process = true; - uint32_t err_code = sd_ble_gattc_primary_services_discover(connection->conn_handle, start_handle, service_uuid); - - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg(translate("Failed to discover services")); - } + check_nrf_error(sd_ble_gattc_primary_services_discover(connection->conn_handle, + start_handle, service_uuid)); // Wait for a discovery event. while (m_discovery_in_process) { @@ -516,7 +508,7 @@ STATIC void discover_remote_services(bleio_connection_internal_t *self, mp_obj_t mp_obj_t uuid_obj; while ((uuid_obj = mp_iternext(iterable)) != MP_OBJ_STOP_ITERATION) { if (!MP_OBJ_IS_TYPE(uuid_obj, &bleio_uuid_type)) { - mp_raise_ValueError(translate("non-UUID found in service_uuids_whitelist")); + mp_raise_TypeError(translate("non-UUID found in service_uuids_whitelist")); } bleio_uuid_obj_t *uuid = MP_OBJ_TO_PTR(uuid_obj); diff --git a/ports/nrf/common-hal/_bleio/Connection.h b/ports/nrf/common-hal/_bleio/Connection.h index 2d4aad0c8d..d5548de453 100644 --- a/ports/nrf/common-hal/_bleio/Connection.h +++ b/ports/nrf/common-hal/_bleio/Connection.h @@ -60,6 +60,7 @@ typedef struct { bonding_keys_t bonding_keys; uint16_t ediv; pair_status_t pair_status; + uint8_t sec_status; // Internal security status. mp_obj_t connection_obj; ble_drv_evt_handler_entry_t handler_entry; } bleio_connection_internal_t; diff --git a/ports/nrf/common-hal/_bleio/Service.c b/ports/nrf/common-hal/_bleio/Service.c index 3362ed1373..5918327c14 100644 --- a/ports/nrf/common-hal/_bleio/Service.c +++ b/ports/nrf/common-hal/_bleio/Service.c @@ -56,10 +56,8 @@ uint32_t _common_hal_bleio_service_construct(bleio_service_obj_t *self, bleio_uu } void common_hal_bleio_service_construct(bleio_service_obj_t *self, bleio_uuid_obj_t *uuid, bool is_secondary) { - const uint32_t err_code = _common_hal_bleio_service_construct(self, uuid, is_secondary, mp_obj_new_list(0, NULL)); - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg_varg(translate("Failed to create service, NRF_ERROR_%q"), MP_OBJ_QSTR_VALUE(base_error_messages[err_code - NRF_ERROR_BASE_NUM])); - } + check_nrf_error(_common_hal_bleio_service_construct(self, uuid, is_secondary, + mp_obj_new_list(0, NULL))); } void bleio_service_from_connection(bleio_service_obj_t *self, mp_obj_t connection) { @@ -133,11 +131,7 @@ void common_hal_bleio_service_add_characteristic(bleio_service_obj_t *self, ble_gatts_char_handles_t char_handles; - uint32_t err_code; - err_code = sd_ble_gatts_characteristic_add(self->handle, &char_md, &char_attr, &char_handles); - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg_varg(translate("Failed to add characteristic, NRF_ERROR_%q"), MP_OBJ_QSTR_VALUE(base_error_messages[err_code - NRF_ERROR_BASE_NUM])); - } + check_nrf_error(sd_ble_gatts_characteristic_add(self->handle, &char_md, &char_attr, &char_handles)); characteristic->user_desc_handle = char_handles.user_desc_handle; characteristic->cccd_handle = char_handles.cccd_handle; diff --git a/ports/nrf/common-hal/_bleio/UUID.c b/ports/nrf/common-hal/_bleio/UUID.c index 5bf35e6a54..6a3d643050 100644 --- a/ports/nrf/common-hal/_bleio/UUID.c +++ b/ports/nrf/common-hal/_bleio/UUID.c @@ -49,10 +49,7 @@ void common_hal_bleio_uuid_construct(bleio_uuid_obj_t *self, uint32_t uuid16, co memcpy(vs_uuid.uuid128, uuid128, sizeof(vs_uuid.uuid128)); // Register this vendor-specific UUID. Bytes 12 and 13 will be zero. - const uint32_t err_code = sd_ble_uuid_vs_add(&vs_uuid, &self->nrf_ble_uuid.type); - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg_varg(translate("Failed to register Vendor-Specific UUID, err 0x%04x"), err_code); - } + check_nrf_error(sd_ble_uuid_vs_add(&vs_uuid, &self->nrf_ble_uuid.type)); vm_used_ble = true; } } @@ -67,11 +64,7 @@ uint32_t common_hal_bleio_uuid_get_uuid16(bleio_uuid_obj_t *self) { void common_hal_bleio_uuid_get_uuid128(bleio_uuid_obj_t *self, uint8_t uuid128[16]) { uint8_t length; - const uint32_t err_code = sd_ble_uuid_encode(&self->nrf_ble_uuid, &length, uuid128); - - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg_varg(translate("Could not decode ble_uuid, err 0x%04x"), err_code); - } + check_nrf_error(sd_ble_uuid_encode(&self->nrf_ble_uuid, &length, uuid128)); } void common_hal_bleio_uuid_pack_into(bleio_uuid_obj_t *self, uint8_t* buf) { @@ -85,7 +78,7 @@ void common_hal_bleio_uuid_pack_into(bleio_uuid_obj_t *self, uint8_t* buf) { void bleio_uuid_construct_from_nrf_ble_uuid(bleio_uuid_obj_t *self, ble_uuid_t *nrf_ble_uuid) { if (nrf_ble_uuid->type == BLE_UUID_TYPE_UNKNOWN) { - mp_raise_RuntimeError(translate("Unexpected nrfx uuid type")); + mp_raise_bleio_BluetoothError(translate("Unexpected nrfx uuid type")); } self->nrf_ble_uuid.uuid = nrf_ble_uuid->uuid; self->nrf_ble_uuid.type = nrf_ble_uuid->type; diff --git a/ports/nrf/common-hal/_bleio/__init__.c b/ports/nrf/common-hal/_bleio/__init__.c index 1e07ea969c..429de2de6d 100644 --- a/ports/nrf/common-hal/_bleio/__init__.c +++ b/ports/nrf/common-hal/_bleio/__init__.c @@ -40,28 +40,39 @@ #include "common-hal/_bleio/__init__.h" -const mp_obj_t base_error_messages[20] = { - MP_ROM_QSTR(MP_QSTR_SUCCESS), - MP_ROM_QSTR(MP_QSTR_SVC_HANDLER_MISSING), - MP_ROM_QSTR(MP_QSTR_SOFTDEVICE_NOT_ENABLED), - MP_ROM_QSTR(MP_QSTR_INTERNAL), - MP_ROM_QSTR(MP_QSTR_NO_MEM), - MP_ROM_QSTR(MP_QSTR_NOT_FOUND), - MP_ROM_QSTR(MP_QSTR_NOT_SUPPORTED), - MP_ROM_QSTR(MP_QSTR_INVALID_PARAM), - MP_ROM_QSTR(MP_QSTR_INVALID_STATE), - MP_ROM_QSTR(MP_QSTR_INVALID_LENGTH), - MP_ROM_QSTR(MP_QSTR_INVALID_FLAGS), - MP_ROM_QSTR(MP_QSTR_INVALID_DATA), - MP_ROM_QSTR(MP_QSTR_DATA_SIZE), - MP_ROM_QSTR(MP_QSTR_TIMEOUT), - MP_ROM_QSTR(MP_QSTR_NULL), - MP_ROM_QSTR(MP_QSTR_FORBIDDEN), - MP_ROM_QSTR(MP_QSTR_INVALID_ADDR), - MP_ROM_QSTR(MP_QSTR_BUSY), - MP_ROM_QSTR(MP_QSTR_CONN_COUNT), - MP_ROM_QSTR(MP_QSTR_RESOURCES), -}; +void check_nrf_error(uint32_t err_code) { + if (err_code == NRF_SUCCESS) { + return; + } + switch (err_code) { + case NRF_ERROR_TIMEOUT: + mp_raise_msg(&mp_type_TimeoutError, NULL); + return; + default: + mp_raise_bleio_BluetoothError(translate("Unknown soft device error: %04x"), err_code); + break; + } +} + +void check_gatt_status(uint16_t gatt_status) { + if (gatt_status == BLE_GATT_STATUS_SUCCESS) { + return; + } + switch (gatt_status) { + case BLE_GATT_STATUS_ATTERR_INSUF_AUTHENTICATION: + mp_raise_bleio_SecurityError(translate("Insufficient authentication")); + return; + default: + mp_raise_bleio_BluetoothError(translate("Unknown gatt error: 0x%04x"), gatt_status); + } +} + +void check_sec_status(uint8_t sec_status) { + if (sec_status == BLE_GAP_SEC_STATUS_SUCCESS) { + return; + } + mp_raise_bleio_SecurityError(translate("Unknown security error: 0x%04x"), sec_status); +} // Turn off BLE on a reset or reload. void bleio_reset() { @@ -85,7 +96,7 @@ bleio_adapter_obj_t common_hal_bleio_adapter_obj = { void common_hal_bleio_check_connected(uint16_t conn_handle) { if (conn_handle == BLE_CONN_HANDLE_INVALID) { - mp_raise_OSError_msg(translate("Not connected")); + mp_raise_bleio_ConnectionError(translate("Not connected")); } } @@ -99,10 +110,7 @@ size_t common_hal_bleio_gatts_read(uint16_t handle, uint16_t conn_handle, uint8_ .len = len, }; - uint32_t err_code = sd_ble_gatts_value_get(conn_handle, handle, &gatts_value); - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg_varg(translate("Failed to read gatts value, err 0x%04x"), err_code); - } + check_nrf_error(sd_ble_gatts_value_get(conn_handle, handle, &gatts_value)); return gatts_value.len; } @@ -116,10 +124,7 @@ void common_hal_bleio_gatts_write(uint16_t handle, uint16_t conn_handle, mp_buff .len = bufinfo->len, }; - const uint32_t err_code = sd_ble_gatts_value_set(conn_handle, handle, &gatts_value); - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg_varg(translate("Failed to write gatts value, err 0x%04x"), err_code); - } + check_nrf_error(sd_ble_gatts_value_set(conn_handle, handle, &gatts_value)); } typedef struct { @@ -172,17 +177,12 @@ size_t common_hal_bleio_gattc_read(uint16_t handle, uint16_t conn_handle, uint8_ read_info.done = false; ble_drv_add_event_handler(_on_gattc_read_rsp_evt, &read_info); - const uint32_t err_code = sd_ble_gattc_read(conn_handle, handle, 0); - if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg_varg(translate("Failed initiate attribute read, err 0x%04x"), err_code); - } + check_nrf_error(sd_ble_gattc_read(conn_handle, handle, 0)); while (!read_info.done) { RUN_BACKGROUND_TASKS; } - if (read_info.status != BLE_GATT_STATUS_SUCCESS) { - mp_raise_OSError_msg_varg(translate("Failed to read attribute value, err 0x%04x"), read_info.status); - } + check_gatt_status(read_info.status); ble_drv_remove_event_handler(_on_gattc_read_rsp_evt, &read_info); return read_info.final_len; @@ -213,7 +213,7 @@ void common_hal_bleio_gattc_write(uint16_t handle, uint16_t conn_handle, mp_buff } // Some real error occurred. - mp_raise_OSError_msg_varg(translate("Failed to write attribute value, err 0x%04x"), err_code); + check_nrf_error(err_code); } } diff --git a/ports/nrf/common-hal/_bleio/__init__.h b/ports/nrf/common-hal/_bleio/__init__.h index 5fd2769f26..ecacf7c85d 100644 --- a/ports/nrf/common-hal/_bleio/__init__.h +++ b/ports/nrf/common-hal/_bleio/__init__.h @@ -39,7 +39,10 @@ typedef struct { // 20 bytes max (23 - 3). #define GATT_MAX_DATA_LENGTH (BLE_GATT_ATT_MTU_DEFAULT - 3) -const mp_obj_t base_error_messages[20]; +// These helpers raise the appropriate exceptions if the code doesn't equal success. +void check_nrf_error(uint32_t err_code); +void check_gatt_status(uint16_t gatt_status); +void check_sec_status(uint8_t sec_status); // Track if the user code modified the BLE state to know if we need to undo it on reload. bool vm_used_ble; diff --git a/py/runtime.c b/py/runtime.c index 9968f26e06..a786619bf0 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -31,8 +31,6 @@ #include "extmod/vfs.h" -// #include "py/mpstate.h" -// #include "py/nlr.h" #include "py/parsenum.h" #include "py/compile.h" #include "py/objstr.h" diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 24a70f4084..dfd20cb5c4 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -342,7 +342,7 @@ STATIC mp_obj_t bleio_adapter_connect(mp_uint_t n_args, const mp_obj_t *pos_args mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); if (!MP_OBJ_IS_TYPE(args[ARG_address].u_obj, &bleio_address_type)) { - mp_raise_ValueError(translate("Expected an Address")); + mp_raise_TypeError(translate("Expected an Address")); } bleio_address_obj_t *address = MP_OBJ_TO_PTR(args[ARG_address].u_obj); diff --git a/shared-bindings/_bleio/Characteristic.c b/shared-bindings/_bleio/Characteristic.c index d89da2a2fa..f8a7a1b4af 100644 --- a/shared-bindings/_bleio/Characteristic.c +++ b/shared-bindings/_bleio/Characteristic.c @@ -94,12 +94,12 @@ STATIC mp_obj_t bleio_characteristic_add_to_service(size_t n_args, const mp_obj_ const mp_obj_t service_obj = args[ARG_service].u_obj; if (!MP_OBJ_IS_TYPE(service_obj, &bleio_service_type)) { - mp_raise_ValueError(translate("Expected a Service")); + mp_raise_TypeError(translate("Expected a Service")); } const mp_obj_t uuid_obj = args[ARG_uuid].u_obj; if (!MP_OBJ_IS_TYPE(uuid_obj, &bleio_uuid_type)) { - mp_raise_ValueError(translate("Expected a UUID")); + mp_raise_TypeError(translate("Expected a UUID")); } const bleio_characteristic_properties_t properties = args[ARG_properties].u_int; diff --git a/shared-bindings/_bleio/CharacteristicBuffer.c b/shared-bindings/_bleio/CharacteristicBuffer.c index 9cc708eb78..e7524da2d5 100644 --- a/shared-bindings/_bleio/CharacteristicBuffer.c +++ b/shared-bindings/_bleio/CharacteristicBuffer.c @@ -30,13 +30,14 @@ #include "py/runtime.h" #include "py/stream.h" +#include "shared-bindings/_bleio/__init__.h" #include "shared-bindings/_bleio/CharacteristicBuffer.h" #include "shared-bindings/_bleio/UUID.h" #include "shared-bindings/util.h" STATIC void raise_error_if_not_connected(bleio_characteristic_buffer_obj_t *self) { if (!common_hal_bleio_characteristic_buffer_connected(self)) { - mp_raise_ValueError(translate("Not connected")); + mp_raise_bleio_ConnectionError(translate("Not connected")); } } @@ -83,7 +84,7 @@ STATIC mp_obj_t bleio_characteristic_buffer_make_new(const mp_obj_type_t *type, } if (!MP_OBJ_IS_TYPE(characteristic, &bleio_characteristic_type)) { - mp_raise_ValueError(translate("Expected a Characteristic")); + mp_raise_TypeError(translate("Expected a Characteristic")); } bleio_characteristic_buffer_obj_t *self = m_new_obj(bleio_characteristic_buffer_obj_t); @@ -151,9 +152,6 @@ STATIC mp_uint_t bleio_characteristic_buffer_ioctl(mp_obj_t self_in, mp_uint_t r bleio_characteristic_buffer_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); raise_error_if_not_connected(self); - if (!common_hal_bleio_characteristic_buffer_connected(self)) { - mp_raise_ValueError(translate("Not connected")); - } mp_uint_t ret; if (request == MP_IOCTL_POLL) { mp_uint_t flags = arg; diff --git a/shared-bindings/_bleio/Connection.c b/shared-bindings/_bleio/Connection.c index 1c6931b29d..9935658bb5 100644 --- a/shared-bindings/_bleio/Connection.c +++ b/shared-bindings/_bleio/Connection.c @@ -36,6 +36,7 @@ #include "py/objproperty.h" #include "py/objstr.h" #include "py/runtime.h" +#include "shared-bindings/_bleio/__init__.h" #include "shared-bindings/_bleio/Adapter.h" #include "shared-bindings/_bleio/Address.h" #include "shared-bindings/_bleio/Characteristic.h" @@ -67,7 +68,7 @@ STATIC void ensure_connected(bleio_connection_obj_t *self) { if (!common_hal_bleio_connection_get_connected(self)) { - mp_raise_ValueError(translate("Connection has been disconnected and can no longer be used. Create a new connection.")); + mp_raise_bleio_ConnectionError(translate("Connection has been disconnected and can no longer be used. Create a new connection.")); } } diff --git a/shared-bindings/_bleio/Descriptor.c b/shared-bindings/_bleio/Descriptor.c index 45a95903e1..f7b6b5bbf1 100644 --- a/shared-bindings/_bleio/Descriptor.c +++ b/shared-bindings/_bleio/Descriptor.c @@ -89,12 +89,12 @@ STATIC mp_obj_t bleio_descriptor_add_to_characteristic(size_t n_args, const mp_o const mp_obj_t characteristic_obj = args[ARG_characteristic].u_obj; if (!MP_OBJ_IS_TYPE(characteristic_obj, &bleio_characteristic_type)) { - mp_raise_ValueError(translate("Expected a Characteristic")); + mp_raise_TypeError(translate("Expected a Characteristic")); } const mp_obj_t uuid_obj = args[ARG_uuid].u_obj; if (!MP_OBJ_IS_TYPE(uuid_obj, &bleio_uuid_type)) { - mp_raise_ValueError(translate("Expected a UUID")); + mp_raise_TypeError(translate("Expected a UUID")); } const bleio_attribute_security_mode_t read_perm = args[ARG_read_perm].u_int; diff --git a/shared-bindings/_bleio/Service.c b/shared-bindings/_bleio/Service.c index 3e1ad70883..43679393a2 100644 --- a/shared-bindings/_bleio/Service.c +++ b/shared-bindings/_bleio/Service.c @@ -64,7 +64,7 @@ STATIC mp_obj_t bleio_service_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t uuid_obj = args[ARG_uuid].u_obj; if (!MP_OBJ_IS_TYPE(uuid_obj, &bleio_uuid_type)) { - mp_raise_ValueError(translate("Expected a UUID")); + mp_raise_TypeError(translate("Expected a UUID")); } const bool is_secondary = args[ARG_secondary].u_bool; diff --git a/shared-bindings/_bleio/__init__.c b/shared-bindings/_bleio/__init__.c index 0c6ebb973b..8204673223 100644 --- a/shared-bindings/_bleio/__init__.c +++ b/shared-bindings/_bleio/__init__.c @@ -26,6 +26,8 @@ * THE SOFTWARE. */ +#include "py/objexcept.h" +#include "py/runtime.h" #include "shared-bindings/_bleio/__init__.h" #include "shared-bindings/_bleio/Address.h" #include "shared-bindings/_bleio/Attribute.h" @@ -78,6 +80,56 @@ //| This object is the sole instance of `_bleio.Adapter`. //| +//| .. class:: BluetoothError(Exception) +//| +//| Catch all exception for Bluetooth related errors. +//| +MP_DEFINE_EXCEPTION(BluetoothError, Exception) + +NORETURN void mp_raise_bleio_BluetoothError(const compressed_string_t* fmt, ...) { + va_list argptr; + va_start(argptr,fmt); + mp_obj_t exception = mp_obj_new_exception_msg_vlist(&mp_type_BluetoothError, fmt, argptr); + va_end(argptr); + nlr_raise(exception); +} + +//| .. class:: ConnectionError(BluetoothError) +//| +//| Raised when a connection is unavailable. +//| +MP_DEFINE_EXCEPTION(ConnectionError, BluetoothError) +NORETURN void mp_raise_bleio_ConnectionError(const compressed_string_t* fmt, ...) { + va_list argptr; + va_start(argptr,fmt); + mp_obj_t exception = mp_obj_new_exception_msg_vlist(&mp_type_ConnectionError, fmt, argptr); + va_end(argptr); + nlr_raise(exception); +} + +//| .. class:: RoleError(BluetoothError) +//| +//| Raised when a resource is used as the mismatched role. For example, if a local CCCD is +//| attempted to be set but they can only be set when remote. +//| +MP_DEFINE_EXCEPTION(RoleError, BluetoothError) +NORETURN void mp_raise_bleio_RoleError(const compressed_string_t* msg) { + mp_raise_msg(&mp_type_RoleError, msg); +} + +//| .. class:: SecurityError(BluetoothError) +//| +//| Raised when a security related error occurs. +//| +MP_DEFINE_EXCEPTION(SecurityError, BluetoothError) +NORETURN void mp_raise_bleio_SecurityError(const compressed_string_t* fmt, ...) { + va_list argptr; + va_start(argptr,fmt); + mp_obj_t exception = mp_obj_new_exception_msg_vlist(&mp_type_SecurityError, fmt, argptr); + va_end(argptr); + nlr_raise(exception); +} + STATIC const mp_rom_map_elem_t bleio_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__bleio) }, { MP_ROM_QSTR(MP_QSTR_Adapter), MP_ROM_PTR(&bleio_adapter_type) }, @@ -94,6 +146,12 @@ STATIC const mp_rom_map_elem_t bleio_module_globals_table[] = { // Properties { MP_ROM_QSTR(MP_QSTR_adapter), MP_ROM_PTR(&common_hal_bleio_adapter_obj) }, + + // Errors + { MP_ROM_QSTR(MP_QSTR_BluetoothError), MP_ROM_PTR(&mp_type_BluetoothError) }, + { MP_ROM_QSTR(MP_QSTR_ConnectionError), MP_ROM_PTR(&mp_type_ConnectionError) }, + { MP_ROM_QSTR(MP_QSTR_RoleError), MP_ROM_PTR(&mp_type_RoleError) }, + { MP_ROM_QSTR(MP_QSTR_SecurityError), MP_ROM_PTR(&mp_type_SecurityError) }, }; STATIC MP_DEFINE_CONST_DICT(bleio_module_globals, bleio_module_globals_table); diff --git a/shared-bindings/_bleio/__init__.h b/shared-bindings/_bleio/__init__.h index 92c695fa66..962d151c1b 100644 --- a/shared-bindings/_bleio/__init__.h +++ b/shared-bindings/_bleio/__init__.h @@ -38,6 +38,16 @@ extern bleio_adapter_obj_t common_hal_bleio_adapter_obj; +extern const mp_obj_type_t mp_type_BluetoothError; +extern const mp_obj_type_t mp_type_ConnectionError; +extern const mp_obj_type_t mp_type_RoleError; +extern const mp_obj_type_t mp_type_SecurityError; + +NORETURN void mp_raise_bleio_BluetoothError(const compressed_string_t* msg, ...); +NORETURN void mp_raise_bleio_ConnectionError(const compressed_string_t* msg, ...); +NORETURN void mp_raise_bleio_RoleError(const compressed_string_t* msg); +NORETURN void mp_raise_bleio_SecurityError(const compressed_string_t* msg, ...); + void common_hal_bleio_check_connected(uint16_t conn_handle); uint16_t common_hal_bleio_device_get_conn_handle(mp_obj_t device); From 521c7531bcdc2e8b7bb72c571eaa5e48468b0599 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 21 Nov 2019 11:04:17 -0800 Subject: [PATCH 073/189] Improve printing to include _bleio. prefix for type. --- shared-bindings/_bleio/__init__.c | 35 ++++++++++++++++++++----------- shared-bindings/_bleio/__init__.h | 20 ++++++++++++++---- 2 files changed, 39 insertions(+), 16 deletions(-) diff --git a/shared-bindings/_bleio/__init__.c b/shared-bindings/_bleio/__init__.c index 8204673223..be7ef1179b 100644 --- a/shared-bindings/_bleio/__init__.c +++ b/shared-bindings/_bleio/__init__.c @@ -84,12 +84,12 @@ //| //| Catch all exception for Bluetooth related errors. //| -MP_DEFINE_EXCEPTION(BluetoothError, Exception) +MP_DEFINE_BLEIO_EXCEPTION(BluetoothError, Exception) NORETURN void mp_raise_bleio_BluetoothError(const compressed_string_t* fmt, ...) { va_list argptr; va_start(argptr,fmt); - mp_obj_t exception = mp_obj_new_exception_msg_vlist(&mp_type_BluetoothError, fmt, argptr); + mp_obj_t exception = mp_obj_new_exception_msg_vlist(&mp_type_bleio_BluetoothError, fmt, argptr); va_end(argptr); nlr_raise(exception); } @@ -98,11 +98,11 @@ NORETURN void mp_raise_bleio_BluetoothError(const compressed_string_t* fmt, ...) //| //| Raised when a connection is unavailable. //| -MP_DEFINE_EXCEPTION(ConnectionError, BluetoothError) +MP_DEFINE_BLEIO_EXCEPTION(ConnectionError, bleio_BluetoothError) NORETURN void mp_raise_bleio_ConnectionError(const compressed_string_t* fmt, ...) { va_list argptr; va_start(argptr,fmt); - mp_obj_t exception = mp_obj_new_exception_msg_vlist(&mp_type_ConnectionError, fmt, argptr); + mp_obj_t exception = mp_obj_new_exception_msg_vlist(&mp_type_bleio_ConnectionError, fmt, argptr); va_end(argptr); nlr_raise(exception); } @@ -112,25 +112,26 @@ NORETURN void mp_raise_bleio_ConnectionError(const compressed_string_t* fmt, ... //| Raised when a resource is used as the mismatched role. For example, if a local CCCD is //| attempted to be set but they can only be set when remote. //| -MP_DEFINE_EXCEPTION(RoleError, BluetoothError) +MP_DEFINE_BLEIO_EXCEPTION(RoleError, bleio_BluetoothError) NORETURN void mp_raise_bleio_RoleError(const compressed_string_t* msg) { - mp_raise_msg(&mp_type_RoleError, msg); + mp_raise_msg(&mp_type_bleio_RoleError, msg); } //| .. class:: SecurityError(BluetoothError) //| //| Raised when a security related error occurs. //| -MP_DEFINE_EXCEPTION(SecurityError, BluetoothError) +MP_DEFINE_BLEIO_EXCEPTION(SecurityError, bleio_BluetoothError) NORETURN void mp_raise_bleio_SecurityError(const compressed_string_t* fmt, ...) { va_list argptr; va_start(argptr,fmt); - mp_obj_t exception = mp_obj_new_exception_msg_vlist(&mp_type_SecurityError, fmt, argptr); + mp_obj_t exception = mp_obj_new_exception_msg_vlist(&mp_type_bleio_SecurityError, fmt, argptr); va_end(argptr); nlr_raise(exception); } STATIC const mp_rom_map_elem_t bleio_module_globals_table[] = { + // Name must be the first entry so that the exception printing below is correct. { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__bleio) }, { MP_ROM_QSTR(MP_QSTR_Adapter), MP_ROM_PTR(&bleio_adapter_type) }, { MP_ROM_QSTR(MP_QSTR_Address), MP_ROM_PTR(&bleio_address_type) }, @@ -148,14 +149,24 @@ STATIC const mp_rom_map_elem_t bleio_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_adapter), MP_ROM_PTR(&common_hal_bleio_adapter_obj) }, // Errors - { MP_ROM_QSTR(MP_QSTR_BluetoothError), MP_ROM_PTR(&mp_type_BluetoothError) }, - { MP_ROM_QSTR(MP_QSTR_ConnectionError), MP_ROM_PTR(&mp_type_ConnectionError) }, - { MP_ROM_QSTR(MP_QSTR_RoleError), MP_ROM_PTR(&mp_type_RoleError) }, - { MP_ROM_QSTR(MP_QSTR_SecurityError), MP_ROM_PTR(&mp_type_SecurityError) }, + { MP_ROM_QSTR(MP_QSTR_BluetoothError), MP_ROM_PTR(&mp_type_bleio_BluetoothError) }, + { MP_ROM_QSTR(MP_QSTR_ConnectionError), MP_ROM_PTR(&mp_type_bleio_ConnectionError) }, + { MP_ROM_QSTR(MP_QSTR_RoleError), MP_ROM_PTR(&mp_type_bleio_RoleError) }, + { MP_ROM_QSTR(MP_QSTR_SecurityError), MP_ROM_PTR(&mp_type_bleio_SecurityError) }, }; STATIC MP_DEFINE_CONST_DICT(bleio_module_globals, bleio_module_globals_table); +void bleio_exception_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) { + mp_print_kind_t k = kind & ~PRINT_EXC_SUBCLASS; + bool is_subclass = kind & PRINT_EXC_SUBCLASS; + if (!is_subclass && (k == PRINT_REPR || k == PRINT_EXC)) { + mp_print_str(print, qstr_str(MP_OBJ_QSTR_VALUE(bleio_module_globals_table[0].value))); + mp_print_str(print, "."); + } + mp_obj_exception_print(print, o_in, kind); +} + const mp_obj_module_t bleio_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t*)&bleio_module_globals, diff --git a/shared-bindings/_bleio/__init__.h b/shared-bindings/_bleio/__init__.h index 962d151c1b..5256bdaa0e 100644 --- a/shared-bindings/_bleio/__init__.h +++ b/shared-bindings/_bleio/__init__.h @@ -38,10 +38,22 @@ extern bleio_adapter_obj_t common_hal_bleio_adapter_obj; -extern const mp_obj_type_t mp_type_BluetoothError; -extern const mp_obj_type_t mp_type_ConnectionError; -extern const mp_obj_type_t mp_type_RoleError; -extern const mp_obj_type_t mp_type_SecurityError; +void bleio_exception_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind); + +#define MP_DEFINE_BLEIO_EXCEPTION(exc_name, base_name) \ +const mp_obj_type_t mp_type_bleio_ ## exc_name = { \ + { &mp_type_type }, \ + .name = MP_QSTR_ ## exc_name, \ + .print = bleio_exception_print, \ + .make_new = mp_obj_exception_make_new, \ + .attr = mp_obj_exception_attr, \ + .parent = &mp_type_ ## base_name, \ +}; + +extern const mp_obj_type_t mp_type_bleio_BluetoothError; +extern const mp_obj_type_t mp_type_bleio_ConnectionError; +extern const mp_obj_type_t mp_type_bleio_RoleError; +extern const mp_obj_type_t mp_type_bleio_SecurityError; NORETURN void mp_raise_bleio_BluetoothError(const compressed_string_t* msg, ...); NORETURN void mp_raise_bleio_ConnectionError(const compressed_string_t* msg, ...); From 13d786b2ef4803cd4bc061042aac7b8ec6f0d1d1 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Thu, 21 Nov 2019 14:27:59 -0500 Subject: [PATCH 074/189] added pin defs --- .../boards/pyb_nano_v2/mpconfigboard.h | 2 +- ports/stm32f4/boards/pyb_nano_v2/pins.c | 40 +++++++++++++------ 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.h b/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.h index 67ddc885ae..f9548737f3 100644 --- a/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.h +++ b/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.h @@ -26,7 +26,7 @@ //Micropython setup -#define MICROPY_HW_BOARD_NAME "Feather STM32F405 Express" +#define MICROPY_HW_BOARD_NAME "PYB LR Nano V2" #define MICROPY_HW_MCU_NAME "STM32F405RG" #define FLASH_SIZE (0x100000) diff --git a/ports/stm32f4/boards/pyb_nano_v2/pins.c b/ports/stm32f4/boards/pyb_nano_v2/pins.c index 4aa1f362ad..566ae0f1a4 100644 --- a/ports/stm32f4/boards/pyb_nano_v2/pins.c +++ b/ports/stm32f4/boards/pyb_nano_v2/pins.c @@ -1,20 +1,34 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PC04) }, - { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PC05) }, + { MP_ROM_QSTR(MP_QSTR_Y10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_Y9), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_Y8), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_Y7), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_Y6), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_Y5), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_Y4), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_Y3), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_Y2), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_Y1), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_Y0), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PC07) }, - { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PC06) }, - { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PC03) }, - { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PC02) }, - { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PC01) }, + { MP_ROM_QSTR(MP_QSTR_X15), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_X14), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_X13), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_X12), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_X11), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_X10), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_X9), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_X8), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_X7), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_X6), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_X5), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_X4), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_X3), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_X2), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_X1), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_X0), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) }, From a96317d5662476023a4d297f5304edca1832c269 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Thu, 21 Nov 2019 14:30:07 -0500 Subject: [PATCH 075/189] requested style changes --- ports/stm32f4/common-hal/busio/SPI.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ports/stm32f4/common-hal/busio/SPI.c b/ports/stm32f4/common-hal/busio/SPI.c index f98d29054d..b5517f470f 100644 --- a/ports/stm32f4/common-hal/busio/SPI.c +++ b/ports/stm32f4/common-hal/busio/SPI.c @@ -38,6 +38,8 @@ #define MAX_SPI 6 //TODO; replace this as part of periph cleanup #define ALL_CLOCKS 0xFF + +//arrays use 0 based numbering: SPI1 is stored at index 0 STATIC bool reserved_spi[MAX_SPI]; STATIC bool never_reset_spi[MAX_SPI]; @@ -360,4 +362,4 @@ STATIC void spi_clock_disable(uint8_t mask) { #ifdef SPI6 if (mask & 1<<5) __HAL_RCC_SPI6_CLK_DISABLE(); #endif -} \ No newline at end of file +} From 98e55eb57790b16fb45d802925195b3bf5250ecb Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 21 Nov 2019 12:26:25 -0800 Subject: [PATCH 076/189] Only add module when printing exception. --- shared-bindings/_bleio/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/_bleio/__init__.c b/shared-bindings/_bleio/__init__.c index be7ef1179b..ba2454da45 100644 --- a/shared-bindings/_bleio/__init__.c +++ b/shared-bindings/_bleio/__init__.c @@ -160,7 +160,7 @@ STATIC MP_DEFINE_CONST_DICT(bleio_module_globals, bleio_module_globals_table); void bleio_exception_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) { mp_print_kind_t k = kind & ~PRINT_EXC_SUBCLASS; bool is_subclass = kind & PRINT_EXC_SUBCLASS; - if (!is_subclass && (k == PRINT_REPR || k == PRINT_EXC)) { + if (!is_subclass && (k == PRINT_EXC)) { mp_print_str(print, qstr_str(MP_OBJ_QSTR_VALUE(bleio_module_globals_table[0].value))); mp_print_str(print, "."); } From 4e4ecafd97c6d2adbf27fb65f51ec3c201eab224 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Thu, 21 Nov 2019 16:53:06 -0500 Subject: [PATCH 077/189] Add definitions for PYB Nano and blackpill --- .../boards/pyb_nano_v2/mpconfigboard.h | 25 ++++---- .../boards/pyb_nano_v2/mpconfigboard.mk | 16 ++--- ports/stm32f4/boards/pyb_nano_v2/pins.c | 32 ++++++---- .../boards/pyb_nano_v2/stm32f4xx_hal_conf.h | 2 +- .../stm32f411ce_blackpill/mpconfigboard.h | 29 +++------ .../stm32f411ce_blackpill/mpconfigboard.mk | 20 +++---- .../boards/stm32f411ce_blackpill/pins.c | 59 ++++++++++--------- .../stm32f4xx_hal_conf.h | 4 +- .../stm32f411ve_discovery/mpconfigboard.h | 2 + .../stm32f4/common-hal/microcontroller/Pin.c | 4 ++ .../common-hal/microcontroller/__init__.c | 2 +- .../peripherals/stm32f4/stm32f411xe/clocks.c | 3 +- 12 files changed, 102 insertions(+), 96 deletions(-) diff --git a/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.h b/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.h index f9548737f3..7980ca93d6 100644 --- a/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.h +++ b/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.h @@ -27,26 +27,21 @@ //Micropython setup #define MICROPY_HW_BOARD_NAME "PYB LR Nano V2" -#define MICROPY_HW_MCU_NAME "STM32F405RG" +#define MICROPY_HW_MCU_NAME "STM32F411CE" -#define FLASH_SIZE (0x100000) +#define FLASH_SIZE (0x80000) #define FLASH_PAGE_SIZE (0x4000) -#define AUTORESET_DELAY_MS 500 -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) +#define BOARD_OSC_DIV 8 // On-board flash -#define SPI_FLASH_MOSI_PIN &pin_PB05 -#define SPI_FLASH_MISO_PIN &pin_PB04 -#define SPI_FLASH_SCK_PIN &pin_PB03 -#define SPI_FLASH_CS_PIN &pin_PA15 +#define SPI_FLASH_MOSI_PIN (&pin_PB15) +#define SPI_FLASH_MISO_PIN (&pin_PB14) +#define SPI_FLASH_SCK_PIN (&pin_PB13) +#define SPI_FLASH_CS_PIN (&pin_PB12) -#define DEFAULT_I2C_BUS_SCL (&pin_PB06) -#define DEFAULT_I2C_BUS_SDA (&pin_PB07) +#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 -#define DEFAULT_SPI_BUS_SCK (&pin_PB13) -#define DEFAULT_SPI_BUS_MOSI (&pin_PB15) -#define DEFAULT_SPI_BUS_MISO (&pin_PB14) +#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x2000 - 0xC000) -#define DEFAULT_UART_BUS_RX (&pin_PB11) -#define DEFAULT_UART_BUS_TX (&pin_PB10) +#define AUTORESET_DELAY_MS 500 diff --git a/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.mk b/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.mk index 5bad4e81f3..918f79f96e 100644 --- a/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.mk +++ b/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.mk @@ -1,19 +1,19 @@ USB_VID = 0x239A USB_PID = 0x805A -USB_PRODUCT = "Feather STM32F405 Express" -USB_MANUFACTURER = "Adafruit Industries LLC" +USB_PRODUCT = "PYB LR Nano V2" +USB_MANUFACTURER = "MicroPython Chinese Community" USB_DEVICES = "CDC,MSC" SPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 -EXTERNAL_FLASH_DEVICES = GD25Q16C +EXTERNAL_FLASH_DEVICES = W25Q64JV_IQ LONGINT_IMPL = MPZ MCU_SERIES = m4 MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f405xx -MCU_PACKAGE = 64 -CMSIS_MCU = STM32F405xx -LD_FILE = boards/STM32F405.ld +MCU_SUB_VARIANT = stm32f411xe +MCU_PACKAGE = 48 +CMSIS_MCU = STM32F411xE +LD_FILE = boards/STM32F411VETx_FLASH.ld TEXT0_ADDR = 0x08000000 -TEXT1_ADDR = 0x08010000 \ No newline at end of file +TEXT1_ADDR = 0x08020000 \ No newline at end of file diff --git a/ports/stm32f4/boards/pyb_nano_v2/pins.c b/ports/stm32f4/boards/pyb_nano_v2/pins.c index 566ae0f1a4..e10124f6af 100644 --- a/ports/stm32f4/boards/pyb_nano_v2/pins.c +++ b/ports/stm32f4/boards/pyb_nano_v2/pins.c @@ -30,18 +30,30 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_X1), MP_ROM_PTR(&pin_PA01) }, { MP_ROM_QSTR(MP_QSTR_X0), MP_ROM_PTR(&pin_PA00) }, - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_SDA1), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_SCL1), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_SDA2), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_SCL2), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_SDA3), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_SCL3), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB13) }, - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB14) }, - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_SCK1), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_MISO1), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_MOSI1), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_SCK2), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_MISO2), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_MOSI2), MP_ROM_PTR(&pin_PB15) }, - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB10) }, - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_PA03) }, - { 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_ROM_QSTR(MP_QSTR_LED_RED), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_LED_GREEN), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_LED_YELLOW), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_LED_BLUE), MP_ROM_PTR(&pin_PA03) }, + + { MP_ROM_QSTR(MP_QSTR_SW), MP_ROM_PTR(&pin_PC13) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm32f4/boards/pyb_nano_v2/stm32f4xx_hal_conf.h b/ports/stm32f4/boards/pyb_nano_v2/stm32f4xx_hal_conf.h index 68a49b4ba8..ab04df3182 100644 --- a/ports/stm32f4/boards/pyb_nano_v2/stm32f4xx_hal_conf.h +++ b/ports/stm32f4/boards/pyb_nano_v2/stm32f4xx_hal_conf.h @@ -93,7 +93,7 @@ * (when HSE is used as system clock source, directly or through the PLL). */ #if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)12000000) /*!< Value of the External oscillator in Hz */ + #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ #if !defined (HSE_STARTUP_TIMEOUT) diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h index 67ddc885ae..8a482ce7dc 100644 --- a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h +++ b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h @@ -26,27 +26,16 @@ //Micropython setup -#define MICROPY_HW_BOARD_NAME "Feather STM32F405 Express" -#define MICROPY_HW_MCU_NAME "STM32F405RG" +#define MICROPY_HW_BOARD_NAME "stm32f411ce-blackpill" +#define MICROPY_HW_MCU_NAME "STM32F411CE" -#define FLASH_SIZE (0x100000) +#define FLASH_SIZE (0x80000) #define FLASH_PAGE_SIZE (0x4000) +#define BOARD_OSC_DIV 25 + +#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 + +#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x2000 - 0xC000) + #define AUTORESET_DELAY_MS 500 -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) - -// On-board flash -#define SPI_FLASH_MOSI_PIN &pin_PB05 -#define SPI_FLASH_MISO_PIN &pin_PB04 -#define SPI_FLASH_SCK_PIN &pin_PB03 -#define SPI_FLASH_CS_PIN &pin_PA15 - -#define DEFAULT_I2C_BUS_SCL (&pin_PB06) -#define DEFAULT_I2C_BUS_SDA (&pin_PB07) - -#define DEFAULT_SPI_BUS_SCK (&pin_PB13) -#define DEFAULT_SPI_BUS_MOSI (&pin_PB15) -#define DEFAULT_SPI_BUS_MISO (&pin_PB14) - -#define DEFAULT_UART_BUS_RX (&pin_PB11) -#define DEFAULT_UART_BUS_TX (&pin_PB10) diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk index 5bad4e81f3..4d3644d4f6 100644 --- a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk +++ b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk @@ -1,19 +1,17 @@ USB_VID = 0x239A USB_PID = 0x805A -USB_PRODUCT = "Feather STM32F405 Express" -USB_MANUFACTURER = "Adafruit Industries LLC" +USB_PRODUCT = "stm32f411ce-blackpill" +USB_MANUFACTURER = "Unknown" USB_DEVICES = "CDC,MSC" -SPI_FLASH_FILESYSTEM = 1 -EXTERNAL_FLASH_DEVICE_COUNT = 1 -EXTERNAL_FLASH_DEVICES = GD25Q16C -LONGINT_IMPL = MPZ +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE MCU_SERIES = m4 MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f405xx -MCU_PACKAGE = 64 -CMSIS_MCU = STM32F405xx -LD_FILE = boards/STM32F405.ld +MCU_SUB_VARIANT = stm32f411xe +MCU_PACKAGE = 48 +CMSIS_MCU = STM32F411xE +LD_FILE = boards/STM32F411VETx_FLASH.ld TEXT0_ADDR = 0x08000000 -TEXT1_ADDR = 0x08010000 \ No newline at end of file +TEXT1_ADDR = 0x08020000 \ No newline at end of file diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/pins.c b/ports/stm32f4/boards/stm32f411ce_blackpill/pins.c index 4aa1f362ad..0846cee673 100644 --- a/ports/stm32f4/boards/stm32f411ce_blackpill/pins.c +++ b/ports/stm32f4/boards/stm32f411ce_blackpill/pins.c @@ -1,33 +1,38 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PC04) }, - { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PC05) }, + { MP_ROM_QSTR(MP_QSTR_B12), MP_ROM_PTR(&pin_PB12) }, + { MP_ROM_QSTR(MP_QSTR_B13), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_B14), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_B15), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_A15), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_B3), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_B4), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_B5), MP_ROM_PTR(&pin_PB05) }, + { MP_ROM_QSTR(MP_QSTR_B6), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_B7), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_B8), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_B9), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PC07) }, - { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PC06) }, - { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PC03) }, - { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PC02) }, - { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PC01) }, - - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) }, - - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB13) }, - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB14) }, - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB15) }, - - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB10) }, - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB11) }, - - { 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_ROM_QSTR(MP_QSTR_B10), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_B2), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_B1), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_B0), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA00) }, + { MP_ROM_QSTR(MP_QSTR_C15), MP_ROM_PTR(&pin_PC15) }, + { MP_ROM_QSTR(MP_QSTR_C14), MP_ROM_PTR(&pin_PC14) }, + { MP_ROM_QSTR(MP_QSTR_C13), MP_ROM_PTR(&pin_PC13) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h b/ports/stm32f4/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h index 68a49b4ba8..81d29f2420 100644 --- a/ports/stm32f4/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h +++ b/ports/stm32f4/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h @@ -67,7 +67,7 @@ /* #define HAL_IRDA_MODULE_ENABLED */ /* #define HAL_SMARTCARD_MODULE_ENABLED */ /* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED +/* #define HAL_PCD_MODULE_ENABLED */ /* #define HAL_HCD_MODULE_ENABLED */ /* #define HAL_DSI_MODULE_ENABLED */ /* #define HAL_QSPI_MODULE_ENABLED */ @@ -93,7 +93,7 @@ * (when HSE is used as system clock source, directly or through the PLL). */ #if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)12000000) /*!< Value of the External oscillator in Hz */ + #define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */ #endif /* HSE_VALUE */ #if !defined (HSE_STARTUP_TIMEOUT) diff --git a/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h b/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h index d7898ba0b8..0c6f537f87 100644 --- a/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h +++ b/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h @@ -32,6 +32,8 @@ #define FLASH_SIZE (0x80000) //512K #define FLASH_PAGE_SIZE (0x4000) //16K +#define BOARD_OSC_DIV 8 + #define CIRCUITPY_AUTORELOAD_DELAY_MS 500 #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x2000 - 0xC000) diff --git a/ports/stm32f4/common-hal/microcontroller/Pin.c b/ports/stm32f4/common-hal/microcontroller/Pin.c index 21290e03c9..615e483585 100644 --- a/ports/stm32f4/common-hal/microcontroller/Pin.c +++ b/ports/stm32f4/common-hal/microcontroller/Pin.c @@ -46,8 +46,12 @@ bool neopixel_in_use; #elif MCU_PACKAGE == 64 #define GPIO_PORT_COUNT 3 GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC}; +#elif MCU_PACKAGE == 48 + #define GPIO_PORT_COUNT 3 + GPIO_TypeDef * ports[GPIO_PORT_COUNT] = {GPIOA, GPIOB, GPIOC}; #endif + STATIC uint16_t claimed_pins[GPIO_PORT_COUNT]; STATIC uint16_t never_reset_pins[GPIO_PORT_COUNT]; diff --git a/ports/stm32f4/common-hal/microcontroller/__init__.c b/ports/stm32f4/common-hal/microcontroller/__init__.c index c7493a4d60..7e45e8ed8b 100644 --- a/ports/stm32f4/common-hal/microcontroller/__init__.c +++ b/ports/stm32f4/common-hal/microcontroller/__init__.c @@ -169,7 +169,7 @@ STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_PE15), MP_ROM_PTR(&pin_PE15) }, #endif { MP_ROM_QSTR(MP_QSTR_PB10), MP_ROM_PTR(&pin_PB10) }, -#if MCU_PACKAGE != 100 +#if MCU_PACKAGE == 144 { MP_ROM_QSTR(MP_QSTR_PB11), MP_ROM_PTR(&pin_PB11) }, #endif { MP_ROM_QSTR(MP_QSTR_PB12), MP_ROM_PTR(&pin_PB12) }, diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/clocks.c b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/clocks.c index 883c252d51..53810af263 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/clocks.c +++ b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/clocks.c @@ -25,6 +25,7 @@ * THE SOFTWARE. */ #include "stm32f4xx_hal.h" +#include "py/mpconfig.h" void stm32f4_peripherals_clocks_init(void) { //System clock init @@ -44,7 +45,7 @@ void stm32f4_peripherals_clocks_init(void) { RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = 8; + RCC_OscInitStruct.PLL.PLLM = BOARD_OSC_DIV; RCC_OscInitStruct.PLL.PLLN = 336; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4; RCC_OscInitStruct.PLL.PLLQ = 7; From b5ff9684bb3eda2b8a080d809e288dcd1ee644d7 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Thu, 21 Nov 2019 17:09:28 -0500 Subject: [PATCH 078/189] remove misplaced status LED definitions --- .../peripherals/stm32f4/stm32f411xe/gpio.c | 111 ------------------ 1 file changed, 111 deletions(-) diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/gpio.c b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/gpio.c index 2b80647c0e..ed1c33b642 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/gpio.c +++ b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/gpio.c @@ -24,86 +24,6 @@ * THE SOFTWARE. */ -/* GPIO PIN REFERENCE -#define DATA_Ready_Pin GPIO_PIN_2 -#define DATA_Ready_GPIO_Port GPIOE -#define CS_I2C_SPI_Pin GPIO_PIN_3 -#define CS_I2C_SPI_GPIO_Port GPIOE -#define INT1_Pin GPIO_PIN_4 -#define INT1_GPIO_Port GPIOE -#define INT2_Pin GPIO_PIN_5 -#define INT2_GPIO_Port GPIOE -#define PC14_OSC32_IN_Pin GPIO_PIN_14 -#define PC14_OSC32_IN_GPIO_Port GPIOC -#define PC15_OSC32_OUT_Pin GPIO_PIN_15 -#define PC15_OSC32_OUT_GPIO_Port GPIOC -#define PH0_OSC_IN_Pin GPIO_PIN_0 -#define PH0_OSC_IN_GPIO_Port GPIOH -#define PH1_OSC_OUT_Pin GPIO_PIN_1 -#define PH1_OSC_OUT_GPIO_Port GPIOH -#define OTG_FS_PowerSwitchOn_Pin GPIO_PIN_0 -#define OTG_FS_PowerSwitchOn_GPIO_Port GPIOC -#define PDM_OUT_Pin GPIO_PIN_3 -#define PDM_OUT_GPIO_Port GPIOC -#define I2S3_WS_Pin GPIO_PIN_4 -#define I2S3_WS_GPIO_Port GPIOA -#define SPI1_SCK_Pin GPIO_PIN_5 -#define SPI1_SCK_GPIO_Port GPIOA -#define SPI1_MISO_Pin GPIO_PIN_6 -#define SPI1_MISO_GPIO_Port GPIOA -#define SPI1_MOSI_Pin GPIO_PIN_7 -#define SPI1_MOSI_GPIO_Port GPIOA -#define CLK_IN_Pin GPIO_PIN_10 -#define CLK_IN_GPIO_Port GPIOB -#define LD4_Pin GPIO_PIN_12 -#define LD4_GPIO_Port GPIOD -#define LD3_Pin GPIO_PIN_13 -#define LD3_GPIO_Port GPIOD -#define LD5_Pin GPIO_PIN_14 -#define LD5_GPIO_Port GPIOD -#define LD6_Pin GPIO_PIN_15 -#define LD6_GPIO_Port GPIOD -#define I2S3_MCK_Pin GPIO_PIN_7 -#define I2S3_MCK_GPIO_Port GPIOC -#define VBUS_FS_Pin GPIO_PIN_9 -#define VBUS_FS_GPIO_Port GPIOA -#define OTG_FS_ID_Pin GPIO_PIN_10 -#define OTG_FS_ID_GPIO_Port GPIOA -#define OTG_FS_DM_Pin GPIO_PIN_11 -#define OTG_FS_DM_GPIO_Port GPIOA -#define OTG_FS_DP_Pin GPIO_PIN_12 -#define OTG_FS_DP_GPIO_Port GPIOA -#define SWDIO_Pin GPIO_PIN_13 -#define SWDIO_GPIO_Port GPIOA -#define SWCLK_Pin GPIO_PIN_14 -#define SWCLK_GPIO_Port GPIOA -#define I2S3_SCK_Pin GPIO_PIN_10 -#define I2S3_SCK_GPIO_Port GPIOC -#define I2S3_SD_Pin GPIO_PIN_12 -#define I2S3_SD_GPIO_Port GPIOC -#define Audio_RST_Pin GPIO_PIN_4 -#define Audio_RST_GPIO_Port GPIOD -#define OTG_FS_OverCurrent_Pin GPIO_PIN_5 -#define OTG_FS_OverCurrent_GPIO_Port GPIOD -#define SWO_Pin GPIO_PIN_3 -#define SWO_GPIO_Port GPIOB -#define Audio_SCL_Pin GPIO_PIN_6 -#define Audio_SCL_GPIO_Port GPIOB -#define Audio_SDA_Pin GPIO_PIN_9 -#define Audio_SDA_GPIO_Port GPIOB -#define MEMS_INT2_Pin GPIO_PIN_1 -#define MEMS_INT2_GPIO_Port GPIOE -*/ - -#define LD4_Pin GPIO_PIN_12 -#define LD4_GPIO_Port GPIOD -#define LD3_Pin GPIO_PIN_13 -#define LD3_GPIO_Port GPIOD -#define LD5_Pin GPIO_PIN_14 -#define LD5_GPIO_Port GPIOD -#define LD6_Pin GPIO_PIN_15 -#define LD6_GPIO_Port GPIOD - #include "stm32f4xx_hal.h" #include "stm32f4/gpio.h" #include "common-hal/microcontroller/Pin.h" @@ -119,31 +39,12 @@ void stm32f4_peripherals_gpio_init(void) { __HAL_RCC_GPIOB_CLK_ENABLE(); __HAL_RCC_GPIOD_CLK_ENABLE(); - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(GPIOD, LD4_Pin|LD3_Pin|LD5_Pin|LD6_Pin, GPIO_PIN_RESET); - - /*Configure GPIO pins : LD4_Pin LD3_Pin LD5_Pin LD6_Pin */ - GPIO_InitStruct.Pin = LD4_Pin|LD3_Pin|LD5_Pin|LD6_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); - - //Status LED chain - stm32f4_peripherals_status_led(0,1); - stm32f4_peripherals_status_led(1,0); - stm32f4_peripherals_status_led(2,0); - stm32f4_peripherals_status_led(3,0); - //Never reset pins never_reset_pin_number(2,13); //PC13 anti tamp never_reset_pin_number(2,14); //PC14 OSC32_IN never_reset_pin_number(2,15); //PC15 OSC32_OUT never_reset_pin_number(0,13); //PA13 SWDIO never_reset_pin_number(0,14); //PA14 SWCLK - never_reset_pin_number(0,15); //PA15 JTDI - never_reset_pin_number(1,3); //PB3 JTDO - never_reset_pin_number(1,4); //PB4 JTRST // Port H is not included in GPIO port array // never_reset_pin_number(5,0); //PH0 JTDO @@ -152,18 +53,6 @@ void stm32f4_peripherals_gpio_init(void) { //LEDs are inverted on F411 DISCO void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { - switch(led) - { - case 0: HAL_GPIO_WritePin(GPIOD, LD4_Pin, (state ^ 1)); - break; - case 1: HAL_GPIO_WritePin(GPIOD, LD3_Pin, (state ^ 1)); - break; - case 2: HAL_GPIO_WritePin(GPIOD, LD5_Pin, (state ^ 1)); - break; - case 3: HAL_GPIO_WritePin(GPIOD, LD6_Pin, (state ^ 1)); - break; - default: break; - } } From b3ad823b4cb741e3c7120d0768f5cff2757b6361 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Thu, 21 Nov 2019 17:39:14 -0500 Subject: [PATCH 079/189] yaml additions --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1d5793573f..0f37e1b957 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -132,6 +132,7 @@ jobs: - "pybadge" - "pybadge_airlift" - "pyboard_v11" + - "pyb_nano_v2" - "pygamer" - "pygamer_advance" - "pyportal" @@ -149,6 +150,7 @@ jobs: - "sparkfun_samd21_dev" - "sparkfun_samd21_mini" - "spresense" + - "stm32f411ce_blackpill" - "stm32f411ve_discovery" - "stm32f412zg_discovery" - "stringcar_m0_express" From 5b907aa076f39b24565ea2802be078fb0acc7887 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Thu, 21 Nov 2019 18:24:10 -0500 Subject: [PATCH 080/189] change order --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0f37e1b957..c0ab6f68b4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -129,10 +129,10 @@ jobs: - "pewpew10" - "pewpew_m4" - "pirkey_m0" + - "pyb_nano_v2" - "pybadge" - "pybadge_airlift" - "pyboard_v11" - - "pyb_nano_v2" - "pygamer" - "pygamer_advance" - "pyportal" From 39f4046f701388d20ddad1429616dfb729063c1e Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 21 Nov 2019 10:35:15 -0800 Subject: [PATCH 081/189] Fix pairing when peripheral. Central untested. --- ports/nrf/common-hal/_bleio/Adapter.c | 3 +- ports/nrf/common-hal/_bleio/Connection.c | 26 ++++++++---- ports/nrf/common-hal/_bleio/__init__.c | 3 ++ shared-bindings/_bleio/Adapter.c | 7 ++-- shared-bindings/_bleio/Adapter.h | 2 +- shared-bindings/_bleio/Characteristic.c | 4 +- shared-bindings/_bleio/Connection.c | 52 ++++++++++++++++++++++-- shared-bindings/_bleio/Connection.h | 2 + 8 files changed, 79 insertions(+), 20 deletions(-) diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index 7d87b3579f..ec8d361115 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -178,6 +178,7 @@ STATIC bool adapter_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { connection->conn_handle = ble_evt->evt.gap_evt.conn_handle; connection->connection_obj = mp_const_none; + connection->pair_status = PAIR_NOT_PAIRED; ble_drv_add_event_handler_entry(&connection->handler_entry, connection_on_ble_evt, connection); self->connection_objs = NULL; @@ -436,7 +437,7 @@ STATIC bool connect_on_ble_evt(ble_evt_t *ble_evt, void *info_in) { return true; } -mp_obj_t common_hal_bleio_adapter_connect(bleio_adapter_obj_t *self, bleio_address_obj_t *address, mp_float_t timeout, bool pair) { +mp_obj_t common_hal_bleio_adapter_connect(bleio_adapter_obj_t *self, bleio_address_obj_t *address, mp_float_t timeout) { ble_gap_addr_t addr; diff --git a/ports/nrf/common-hal/_bleio/Connection.c b/ports/nrf/common-hal/_bleio/Connection.c index 65fadfecce..4e1c22cdf7 100644 --- a/ports/nrf/common-hal/_bleio/Connection.c +++ b/ports/nrf/common-hal/_bleio/Connection.c @@ -34,6 +34,7 @@ #include "ble_drv.h" #include "ble_hci.h" #include "nrf_soc.h" +#include "lib/utils/interrupt_char.h" #include "py/gc.h" #include "py/objlist.h" #include "py/objstr.h" @@ -51,7 +52,7 @@ #define BLE_AD_TYPE_FLAGS_DATA_SIZE 1 static const ble_gap_sec_params_t pairing_sec_params = { - .bond = 1, + .bond = 0, .mitm = 0, .lesc = 0, .keypress = 0, @@ -109,7 +110,7 @@ bool connection_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { // SoftDevice will respond to a length update request. sd_ble_gap_data_length_update(self->conn_handle, NULL, NULL); break; - + case BLE_GAP_EVT_DATA_LENGTH_UPDATE: // 0x24 break; @@ -214,7 +215,7 @@ bool connection_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { if (dump_events) { mp_printf(&mp_plat_print, "Unhandled connection event: 0x%04x\n", ble_evt->header.evt_id); } - + return false; } return true; @@ -229,6 +230,13 @@ void bleio_connection_clear(bleio_connection_internal_t *self) { memset(&self->bonding_keys, 0, sizeof(self->bonding_keys)); } +bool common_hal_bleio_connection_get_paired(bleio_connection_obj_t *self) { + if (self->connection == NULL) { + return false; + } + return self->connection->pair_status == PAIR_PAIRED; +} + bool common_hal_bleio_connection_get_connected(bleio_connection_obj_t *self) { if (self->connection == NULL) { return false; @@ -240,15 +248,17 @@ void common_hal_bleio_connection_disconnect(bleio_connection_internal_t *self) { sd_ble_gap_disconnect(self->conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION); } -void common_hal_bleio_connection_pair(bleio_connection_internal_t *self) { +void common_hal_bleio_connection_pair(bleio_connection_internal_t *self, bool bond) { self->pair_status = PAIR_WAITING; check_nrf_error(sd_ble_gap_authenticate(self->conn_handle, &pairing_sec_params)); - while (self->pair_status == PAIR_WAITING) { + while (self->pair_status == PAIR_WAITING && !mp_hal_is_interrupted()) { RUN_BACKGROUND_TASKS; } - + if (mp_hal_is_interrupted()) { + return; + } check_sec_status(self->sec_status); } @@ -280,6 +290,7 @@ STATIC bool discover_next_characteristics(bleio_connection_internal_t* connectio uint32_t err_code = sd_ble_gattc_characteristics_discover(connection->conn_handle, &handle_range); if (err_code != NRF_SUCCESS) { + asm("bkpt"); return false; } @@ -574,10 +585,9 @@ STATIC void discover_remote_services(bleio_connection_internal_t *self, mp_obj_t // discovery call returns nothing. // discover_next_descriptors() appends to the descriptor_list. while (next_desc_start_handle <= service->end_handle && - next_desc_start_handle < next_desc_end_handle && + next_desc_start_handle <= next_desc_end_handle && discover_next_descriptors(self, characteristic, next_desc_start_handle, next_desc_end_handle)) { - // Get the most recently discovered descriptor, and then ask for descriptors // whose handles start after that descriptor's handle. const bleio_descriptor_obj_t *descriptor = characteristic->descriptor_list; diff --git a/ports/nrf/common-hal/_bleio/__init__.c b/ports/nrf/common-hal/_bleio/__init__.c index 429de2de6d..bc2500f681 100644 --- a/ports/nrf/common-hal/_bleio/__init__.c +++ b/ports/nrf/common-hal/_bleio/__init__.c @@ -62,6 +62,9 @@ void check_gatt_status(uint16_t gatt_status) { case BLE_GATT_STATUS_ATTERR_INSUF_AUTHENTICATION: mp_raise_bleio_SecurityError(translate("Insufficient authentication")); return; + case BLE_GATT_STATUS_ATTERR_INSUF_ENCRYPTION: + mp_raise_bleio_SecurityError(translate("Insufficient encryption")); + return; default: mp_raise_bleio_BluetoothError(translate("Unknown gatt error: 0x%04x"), gatt_status); } diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index dfd20cb5c4..7e2a5f05b2 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -321,7 +321,7 @@ const mp_obj_property_t bleio_adapter_connections_obj = { (mp_obj_t)&mp_const_none_obj }, }; -//| .. method:: connect(address, *, timeout, pair=False) +//| .. method:: connect(address, *, timeout) //| //| Attempts a connection to the device with the given address. //| @@ -331,11 +331,10 @@ const mp_obj_property_t bleio_adapter_connections_obj = { STATIC mp_obj_t bleio_adapter_connect(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { bleio_adapter_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); - enum { ARG_address, ARG_timeout, ARG_pair }; + enum { ARG_address, ARG_timeout }; static const mp_arg_t allowed_args[] = { { MP_QSTR_address, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_timeout, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_pair, MP_ARG_KW_ONLY | MP_ARG_BOOL, { .u_bool = false } }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; @@ -348,7 +347,7 @@ STATIC mp_obj_t bleio_adapter_connect(mp_uint_t n_args, const mp_obj_t *pos_args bleio_address_obj_t *address = MP_OBJ_TO_PTR(args[ARG_address].u_obj); mp_float_t timeout = mp_obj_get_float(args[ARG_timeout].u_obj); - return common_hal_bleio_adapter_connect(self, address, timeout, args[ARG_pair].u_bool); + return common_hal_bleio_adapter_connect(self, address, timeout); } STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_adapter_connect_obj, 2, bleio_adapter_connect); diff --git a/shared-bindings/_bleio/Adapter.h b/shared-bindings/_bleio/Adapter.h index 2ff77f755b..4340d82c10 100644 --- a/shared-bindings/_bleio/Adapter.h +++ b/shared-bindings/_bleio/Adapter.h @@ -55,6 +55,6 @@ void common_hal_bleio_adapter_stop_scan(bleio_adapter_obj_t *self); bool common_hal_bleio_adapter_get_connected(bleio_adapter_obj_t *self); mp_obj_t common_hal_bleio_adapter_get_connections(bleio_adapter_obj_t *self); -mp_obj_t common_hal_bleio_adapter_connect(bleio_adapter_obj_t *self, bleio_address_obj_t *address, mp_float_t timeout, bool pair); +mp_obj_t common_hal_bleio_adapter_connect(bleio_adapter_obj_t *self, bleio_address_obj_t *address, mp_float_t timeout); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_ADAPTER_H diff --git a/shared-bindings/_bleio/Characteristic.c b/shared-bindings/_bleio/Characteristic.c index f8a7a1b4af..aa09f3f001 100644 --- a/shared-bindings/_bleio/Characteristic.c +++ b/shared-bindings/_bleio/Characteristic.c @@ -168,7 +168,7 @@ const mp_obj_property_t bleio_characteristic_properties_obj = { //| .. attribute:: uuid //| //| The UUID of this characteristic. (read-only) -//| +//| //| Will be ``None`` if the 128-bit UUID for this characteristic is not known. //| STATIC mp_obj_t bleio_characteristic_get_uuid(mp_obj_t self_in) { @@ -338,7 +338,7 @@ STATIC MP_DEFINE_CONST_DICT(bleio_characteristic_locals_dict, bleio_characterist STATIC void bleio_characteristic_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { bleio_characteristic_obj_t *self = MP_OBJ_TO_PTR(self_in); if (self->uuid) { - mp_printf(print, "Characteristic("); + mp_printf(print, "0x%08x Characteristic(", (uint32_t) self_in); bleio_uuid_print(print, MP_OBJ_FROM_PTR(self->uuid), kind); mp_printf(print, ")"); } else { diff --git a/shared-bindings/_bleio/Connection.c b/shared-bindings/_bleio/Connection.c index 9935658bb5..da2fbff287 100644 --- a/shared-bindings/_bleio/Connection.c +++ b/shared-bindings/_bleio/Connection.c @@ -92,6 +92,29 @@ STATIC mp_obj_t bleio_connection_disconnect(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_connection_disconnect_obj, bleio_connection_disconnect); + +//| .. method:: pair(*, bond=True) +//| +//| Pair to the peer to improve security. +//| +STATIC mp_obj_t bleio_connection_pair(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + bleio_connection_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + + enum { ARG_bond }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_bond, MP_ARG_BOOL, {.u_bool = true} }, + }; + + 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); + + ensure_connected(self); + + common_hal_bleio_connection_pair(self->connection, args[ARG_bond].u_bool); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_connection_pair_obj, 1, bleio_connection_pair); + //| .. method:: discover_remote_services(service_uuids_whitelist=None) //| //| Do BLE discovery for all services or for the given service UUIDS, @@ -99,19 +122,19 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_connection_disconnect_obj, bleio_connecti //| `Connection.connected` must be True. //| //| :param iterable service_uuids_whitelist: -//| +//| //| an iterable of :py:class:~`UUID` objects for the services provided by the peripheral //| that you want to use. //| //| The peripheral may provide more services, but services not listed are ignored //| and will not be returned. //| -//| If service_uuids_whitelist is None, then all services will undergo discovery, which can be +//| If service_uuids_whitelist is None, then all services will undergo discovery, which can be //| slow. //| //| If the service UUID is 128-bit, or its characteristic UUID's are 128-bit, you //| you must have already created a :py:class:~`UUID` object for that UUID in order for the -//| service or characteristic to be discovered. Creating the UUID causes the UUID to be +//| service or characteristic to be discovered. Creating the UUID causes the UUID to be //| registered for use. (This restriction may be lifted in the future.) //| //| :return: A tuple of `_bleio.Service` objects provided by the remote peripheral. @@ -137,7 +160,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_connection_discover_remote_services_obj, //| .. attribute:: connected //| -//| True if connected to a remote peer. +//| True if connected to the remote peer. //| STATIC mp_obj_t bleio_connection_get_connected(mp_obj_t self_in) { bleio_connection_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -153,13 +176,34 @@ const mp_obj_property_t bleio_connection_connected_obj = { (mp_obj_t)&mp_const_none_obj }, }; + +//| .. attribute:: paired +//| +//| True if paired to the remote peer. +//| +STATIC mp_obj_t bleio_connection_get_paired(mp_obj_t self_in) { + bleio_connection_obj_t *self = MP_OBJ_TO_PTR(self_in); + + return mp_obj_new_bool(common_hal_bleio_connection_get_paired(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_connection_get_paired_obj, bleio_connection_get_paired); + +const mp_obj_property_t bleio_connection_paired_obj = { + .base.type = &mp_type_property, + .proxy = { (mp_obj_t)&bleio_connection_get_paired_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj }, +}; + STATIC const mp_rom_map_elem_t bleio_connection_locals_dict_table[] = { // Methods + { MP_ROM_QSTR(MP_QSTR_pair), MP_ROM_PTR(&bleio_connection_pair_obj) }, { MP_ROM_QSTR(MP_QSTR_disconnect), MP_ROM_PTR(&bleio_connection_disconnect_obj) }, { MP_ROM_QSTR(MP_QSTR_discover_remote_services), MP_ROM_PTR(&bleio_connection_discover_remote_services_obj) }, // Properties { MP_ROM_QSTR(MP_QSTR_connected), MP_ROM_PTR(&bleio_connection_connected_obj) }, + { MP_ROM_QSTR(MP_QSTR_paired), MP_ROM_PTR(&bleio_connection_paired_obj) }, }; STATIC MP_DEFINE_CONST_DICT(bleio_connection_locals_dict, bleio_connection_locals_dict_table); diff --git a/shared-bindings/_bleio/Connection.h b/shared-bindings/_bleio/Connection.h index 5de6730c99..f7eee180f7 100644 --- a/shared-bindings/_bleio/Connection.h +++ b/shared-bindings/_bleio/Connection.h @@ -34,8 +34,10 @@ extern const mp_obj_type_t bleio_connection_type; +extern void common_hal_bleio_connection_pair(bleio_connection_internal_t *self, bool bond); extern void common_hal_bleio_connection_disconnect(bleio_connection_internal_t *self); extern bool common_hal_bleio_connection_get_connected(bleio_connection_obj_t *self); +extern bool common_hal_bleio_connection_get_paired(bleio_connection_obj_t *self); extern mp_obj_tuple_t *common_hal_bleio_connection_discover_remote_services(bleio_connection_obj_t *self, mp_obj_t service_uuids_whitelist); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_CONNECTION_H From e63796c7bc28d8add63441f54ef4060a4ec11006 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 21 Nov 2019 16:32:28 -0800 Subject: [PATCH 082/189] Special exception message for when pairing prompt is ignored. --- ports/nrf/common-hal/_bleio/__init__.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ports/nrf/common-hal/_bleio/__init__.c b/ports/nrf/common-hal/_bleio/__init__.c index bc2500f681..7ba3dc8c1f 100644 --- a/ports/nrf/common-hal/_bleio/__init__.c +++ b/ports/nrf/common-hal/_bleio/__init__.c @@ -74,7 +74,14 @@ void check_sec_status(uint8_t sec_status) { if (sec_status == BLE_GAP_SEC_STATUS_SUCCESS) { return; } - mp_raise_bleio_SecurityError(translate("Unknown security error: 0x%04x"), sec_status); + + switch (sec_status) { + case BLE_GAP_SEC_STATUS_UNSPECIFIED: + mp_raise_bleio_SecurityError(translate("Unspecified issue. Can be that the pairing prompt on the other device was declined or ignored.")); + return; + default: + mp_raise_bleio_SecurityError(translate("Unknown security error: 0x%04x"), sec_status); + } } // Turn off BLE on a reset or reload. From 743bc829ab216288ad054cac547ab4e06d452922 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 21 Nov 2019 16:39:57 -0800 Subject: [PATCH 083/189] Clean up debug changes --- ports/nrf/common-hal/_bleio/Connection.c | 1 - shared-bindings/_bleio/Characteristic.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/nrf/common-hal/_bleio/Connection.c b/ports/nrf/common-hal/_bleio/Connection.c index 4e1c22cdf7..0e1e187c2d 100644 --- a/ports/nrf/common-hal/_bleio/Connection.c +++ b/ports/nrf/common-hal/_bleio/Connection.c @@ -290,7 +290,6 @@ STATIC bool discover_next_characteristics(bleio_connection_internal_t* connectio uint32_t err_code = sd_ble_gattc_characteristics_discover(connection->conn_handle, &handle_range); if (err_code != NRF_SUCCESS) { - asm("bkpt"); return false; } diff --git a/shared-bindings/_bleio/Characteristic.c b/shared-bindings/_bleio/Characteristic.c index aa09f3f001..7fcf274da0 100644 --- a/shared-bindings/_bleio/Characteristic.c +++ b/shared-bindings/_bleio/Characteristic.c @@ -338,7 +338,7 @@ STATIC MP_DEFINE_CONST_DICT(bleio_characteristic_locals_dict, bleio_characterist STATIC void bleio_characteristic_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) { bleio_characteristic_obj_t *self = MP_OBJ_TO_PTR(self_in); if (self->uuid) { - mp_printf(print, "0x%08x Characteristic(", (uint32_t) self_in); + mp_printf(print, "Characteristic("); bleio_uuid_print(print, MP_OBJ_FROM_PTR(self->uuid), kind); mp_printf(print, ")"); } else { From 46cc9b934b9104a97196b0c53addea943e61e6b0 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 21 Nov 2019 16:50:34 -0800 Subject: [PATCH 084/189] Update translations --- locale/ID.po | 12 +++++++++++- locale/circuitpython.pot | 12 +++++++++++- locale/de_DE.po | 12 +++++++++++- locale/en_US.po | 12 +++++++++++- locale/en_x_pirate.po | 12 +++++++++++- locale/es.po | 12 +++++++++++- locale/fil.po | 12 +++++++++++- locale/fr.po | 12 +++++++++++- locale/it_IT.po | 12 +++++++++++- locale/ko.po | 12 +++++++++++- locale/pl.po | 12 +++++++++++- locale/pt_BR.po | 12 +++++++++++- locale/zh_Latn_pinyin.po | 12 +++++++++++- 13 files changed, 143 insertions(+), 13 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 6b93b231b8..fdbf3863bb 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-20 14:01-0800\n" +"POT-Creation-Date: 2019-11-21 16:50-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -680,6 +680,10 @@ msgstr "" msgid "Insufficient authentication" msgstr "" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient encryption" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1239,6 +1243,12 @@ msgstr "" 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 msgid "Unsupported baudrate" msgstr "Baudrate tidak didukung" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 74c5c22f67..24278f33c1 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-20 14:01-0800\n" +"POT-Creation-Date: 2019-11-21 16:50-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -669,6 +669,10 @@ msgstr "" msgid "Insufficient authentication" msgstr "" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient encryption" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1220,6 +1224,12 @@ msgstr "" 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 msgid "Unsupported baudrate" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 628fafce29..ff4edd3705 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-20 14:01-0800\n" +"POT-Creation-Date: 2019-11-21 16:50-0800\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -677,6 +677,10 @@ msgstr "Eingabe-/Ausgabefehler" msgid "Insufficient authentication" msgstr "" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient encryption" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1259,6 +1263,12 @@ msgstr "" "Nicht übereinstimmende Anzahl von Elementen auf der rechten Seite (erwartet " "%d, %d erhalten)." +#: 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 msgid "Unsupported baudrate" msgstr "Baudrate wird nicht unterstützt" diff --git a/locale/en_US.po b/locale/en_US.po index 3fa5ffe96d..b8025aa98e 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-20 14:01-0800\n" +"POT-Creation-Date: 2019-11-21 16:50-0800\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -669,6 +669,10 @@ msgstr "" msgid "Insufficient authentication" msgstr "" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient encryption" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1220,6 +1224,12 @@ msgstr "" 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 msgid "Unsupported baudrate" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index df0b132af0..a307167aad 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-20 14:01-0800\n" +"POT-Creation-Date: 2019-11-21 16:50-0800\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -673,6 +673,10 @@ msgstr "" msgid "Insufficient authentication" msgstr "" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient encryption" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1224,6 +1228,12 @@ msgstr "" 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 msgid "Unsupported baudrate" msgstr "" diff --git a/locale/es.po b/locale/es.po index 083702e320..07ad7fe1b3 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-20 14:01-0800\n" +"POT-Creation-Date: 2019-11-21 16:50-0800\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -679,6 +679,10 @@ msgstr "error Input/output" msgid "Insufficient authentication" msgstr "" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient encryption" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1257,6 +1261,12 @@ msgstr "" msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "Número incomparable de elementos en RHS (%d esperado,%d obtenido)" +#: 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 msgid "Unsupported baudrate" msgstr "Baudrate no soportado" diff --git a/locale/fil.po b/locale/fil.po index 57ea1c8be6..8cf49583ac 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-20 14:01-0800\n" +"POT-Creation-Date: 2019-11-21 16:50-0800\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -685,6 +685,10 @@ msgstr "May mali sa Input/Output" msgid "Insufficient authentication" msgstr "" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient encryption" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1260,6 +1264,12 @@ msgstr "" 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 msgid "Unsupported baudrate" msgstr "Hindi supportadong baudrate" diff --git a/locale/fr.po b/locale/fr.po index 95027be722..3a3f81653c 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-20 14:01-0800\n" +"POT-Creation-Date: 2019-11-21 16:50-0800\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -689,6 +689,10 @@ msgstr "Erreur d'entrée/sortie" msgid "Insufficient authentication" msgstr "" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient encryption" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1283,6 +1287,12 @@ msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "" "Pas de correspondance du nombres d'éléments à droite (attendu %d, obtenu %d)" +#: 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 msgid "Unsupported baudrate" msgstr "Débit non supporté" diff --git a/locale/it_IT.po b/locale/it_IT.po index e0519378dc..30d843142c 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-20 14:01-0800\n" +"POT-Creation-Date: 2019-11-21 16:50-0800\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -685,6 +685,10 @@ msgstr "Errore input/output" msgid "Insufficient authentication" msgstr "" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient encryption" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1260,6 +1264,12 @@ msgstr "" 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 msgid "Unsupported baudrate" msgstr "baudrate non supportato" diff --git a/locale/ko.po b/locale/ko.po index d6e8701fdb..1452bd7e70 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-20 14:01-0800\n" +"POT-Creation-Date: 2019-11-21 16:50-0800\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -673,6 +673,10 @@ msgstr "" msgid "Insufficient authentication" msgstr "" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient encryption" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1225,6 +1229,12 @@ msgstr "" 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 msgid "Unsupported baudrate" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 08c35cd8e1..ed57964325 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-20 14:01-0800\n" +"POT-Creation-Date: 2019-11-21 16:50-0800\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -674,6 +674,10 @@ msgstr "Błąd I/O" msgid "Insufficient authentication" msgstr "" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient encryption" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1240,6 +1244,12 @@ msgstr "" msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "Zła liczba obiektów po prawej stronie (oczekiwano %d, jest %d)." +#: 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 msgid "Unsupported baudrate" msgstr "Zła szybkość transmisji" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index dad3060cef..715a8345d6 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-20 14:01-0800\n" +"POT-Creation-Date: 2019-11-21 16:50-0800\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -678,6 +678,10 @@ msgstr "" msgid "Insufficient authentication" msgstr "" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient encryption" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1237,6 +1241,12 @@ msgstr "" 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 msgid "Unsupported baudrate" msgstr "Taxa de transmissão não suportada" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index d7a4039bb1..fae8b1b329 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-20 14:01-0800\n" +"POT-Creation-Date: 2019-11-21 16:50-0800\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -675,6 +675,10 @@ msgstr "Shūrù/shūchū cuòwù" msgid "Insufficient authentication" msgstr "" +#: ports/nrf/common-hal/_bleio/__init__.c +msgid "Insufficient encryption" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "Invalid %q pin" @@ -1246,6 +1250,12 @@ msgstr "" msgid "Unmatched number of items on RHS (expected %d, got %d)." msgstr "RHS (yùqí %d, huòdé %d) shàng wèi pǐpèi de xiàngmù." +#: 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 msgid "Unsupported baudrate" msgstr "Bù zhīchí de baudrate" From 6a7c8d634118f3e6214c64ea85029d3e84ead605 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Thu, 21 Nov 2019 20:56:05 -0500 Subject: [PATCH 085/189] minor fix --- ports/stm32f4/peripherals/stm32f4/stm32f411xe/gpio.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/gpio.c b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/gpio.c index ed1c33b642..2b0e2b2888 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/gpio.c +++ b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/gpio.c @@ -29,9 +29,7 @@ #include "common-hal/microcontroller/Pin.h" void stm32f4_peripherals_gpio_init(void) { - //Enable all GPIO for now - GPIO_InitTypeDef GPIO_InitStruct = {0}; - /* GPIO Ports Clock Enable */ + //* GPIO Ports Clock Enable */ __HAL_RCC_GPIOE_CLK_ENABLE(); __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOH_CLK_ENABLE(); From 0d8eb3cfb4ef0e2a01a657752603a4c259423e46 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Fri, 22 Nov 2019 10:54:35 -0500 Subject: [PATCH 086/189] add correct VID/PID pairs --- ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.mk | 2 +- ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.mk b/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.mk index 918f79f96e..d46ee0b08a 100644 --- a/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.mk +++ b/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x805A +USB_PID = 0x8068 USB_PRODUCT = "PYB LR Nano V2" USB_MANUFACTURER = "MicroPython Chinese Community" USB_DEVICES = "CDC,MSC" diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk index 4d3644d4f6..41c283a780 100644 --- a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk +++ b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk @@ -1,8 +1,8 @@ USB_VID = 0x239A -USB_PID = 0x805A +USB_PID = 0x806A USB_PRODUCT = "stm32f411ce-blackpill" USB_MANUFACTURER = "Unknown" -USB_DEVICES = "CDC,MSC" +USB_DEVICES = "CDC" INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE From 228a619af561246eed368926c0d0735c982c29e6 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 22 Nov 2019 10:59:27 -0500 Subject: [PATCH 087/189] enable network, wiznet5k, and ps2io by default on M4 --- ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk | 1 - ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk | 4 ---- ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk | 4 ---- .../boards/grandcentral_m4_express/mpconfigboard.mk | 2 -- ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk | 4 ---- ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk | 1 - ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk | 2 ++ .../atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk | 4 ---- ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk | 4 ---- ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk | 1 - ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk | 3 --- ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk | 2 ++ ports/atmel-samd/boards/pybadge/mpconfigboard.mk | 2 -- ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.mk | 2 -- ports/atmel-samd/boards/pygamer/mpconfigboard.mk | 2 -- ports/atmel-samd/boards/pygamer_advance/mpconfigboard.mk | 2 -- ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk | 1 - ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk | 1 - ports/atmel-samd/mpconfigport.mk | 3 +++ 19 files changed, 7 insertions(+), 38 deletions(-) diff --git a/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk b/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk index 86a7719b84..5cd3fe70ec 100644 --- a/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk @@ -11,6 +11,5 @@ QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = "W25Q128JV_PM" -CIRCUITPY_PS2IO = 1 # No I2S on SAMD51G. CIRCUITPY_AUDIOBUSIO = 0 diff --git a/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk b/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk index aa5f47d400..398c54a119 100644 --- a/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk @@ -11,7 +11,3 @@ QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 3 EXTERNAL_FLASH_DEVICES = "GD25Q16C, W25Q16JV_IQ, W25Q16JV_IM" LONGINT_IMPL = MPZ - -CIRCUITPY_NETWORK = 1 -MICROPY_PY_WIZNET5K = 5500 -CIRCUITPY_PS2IO = 1 diff --git a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk index 176ebac82c..4faa073876 100644 --- a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk @@ -11,7 +11,3 @@ QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = GD25Q16C LONGINT_IMPL = MPZ - -CIRCUITPY_NETWORK = 1 -MICROPY_PY_WIZNET5K = 5500 -CIRCUITPY_PS2IO = 1 diff --git a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk index 423761c3f7..33542183b6 100644 --- a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk @@ -11,5 +11,3 @@ QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "W25Q64JV_IQ, GD25Q64C" LONGINT_IMPL = MPZ - -CIRCUITPY_PS2IO = 1 diff --git a/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk index 0d891abc82..375be283a5 100644 --- a/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk @@ -11,7 +11,3 @@ QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = GD25Q64C LONGINT_IMPL = MPZ - -CIRCUITPY_NETWORK = 1 -MICROPY_PY_WIZNET5K = 5500 -CIRCUITPY_PS2IO = 1 diff --git a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk index 5cab5bf43a..dca4e3706f 100644 --- a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk @@ -12,7 +12,6 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = GD25Q16C LONGINT_IMPL = MPZ -CIRCUITPY_PS2IO = 1 # No I2S on SAMD51G CIRCUITPY_AUDIOBUSIO = 0 diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index 706e551c5d..163abfe1d3 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -12,5 +12,7 @@ INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ # Not needed. +CIRCUITPY_PS2IO = 0 +CIRCUITPY_NETWORK = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_DISPLAYIO = 0 diff --git a/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk index 98d85ba826..bd837ebd6e 100644 --- a/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk @@ -11,7 +11,3 @@ QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 3 EXTERNAL_FLASH_DEVICES = "S25FL116K, S25FL216K, GD25Q16C" LONGINT_IMPL = MPZ - -CIRCUITPY_NETWORK = 1 -MICROPY_PY_WIZNET5K = 5500 -CIRCUITPY_PS2IO = 1 diff --git a/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk index 68b6f64065..e4d8b9428e 100644 --- a/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk @@ -11,7 +11,3 @@ QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 3 EXTERNAL_FLASH_DEVICES = "S25FL116K, S25FL216K, GD25Q16C" LONGINT_IMPL = MPZ - -CIRCUITPY_NETWORK = 1 -MICROPY_PY_WIZNET5K = 5500 -CIRCUITPY_PS2IO = 1 diff --git a/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk b/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk index 4bd1d6e522..eff8bfe08a 100644 --- a/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk @@ -12,7 +12,6 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = "W25Q16JV_IM" LONGINT_IMPL = MPZ -CIRCUITPY_PS2IO = 1 # No I2S on SAMD51G CIRCUITPY_AUDIOBUSIO = 0 diff --git a/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk b/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk index a3db7dc890..84d1285c5b 100644 --- a/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk +++ b/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk @@ -11,6 +11,3 @@ QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = GD25Q64C LONGINT_IMPL = MPZ - -CIRCUITPY_AUDIOIO = 1 -CIRCUITPY_DISPLAYIO = 1 diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk index 54ec3d1d0e..bc2ae609ed 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk @@ -17,7 +17,9 @@ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 +CIRCUITPY_NETWORK = 0 CIRCUITPY_PIXELBUF = 0 +CIRCUITPY_PS2IO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_USB_HID = 0 diff --git a/ports/atmel-samd/boards/pybadge/mpconfigboard.mk b/ports/atmel-samd/boards/pybadge/mpconfigboard.mk index 7e2cb64398..b5a240c66b 100644 --- a/ports/atmel-samd/boards/pybadge/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pybadge/mpconfigboard.mk @@ -12,8 +12,6 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = GD25Q16C LONGINT_IMPL = MPZ -CIRCUITPY_AUDIOIO = 1 -CIRCUITPY_DISPLAYIO = 1 CIRCUITPY_GAMEPAD = 1 CIRCUITPY_GAMEPADSHIFT = 1 CIRCUITPY_STAGE = 1 diff --git a/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.mk b/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.mk index 7e77b0feaf..e78789d741 100644 --- a/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.mk @@ -12,8 +12,6 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = GD25Q16C LONGINT_IMPL = MPZ -CIRCUITPY_AUDIOIO = 1 -CIRCUITPY_DISPLAYIO = 1 CIRCUITPY_GAMEPAD = 1 CIRCUITPY_GAMEPADSHIFT = 1 CIRCUITPY_STAGE = 1 diff --git a/ports/atmel-samd/boards/pygamer/mpconfigboard.mk b/ports/atmel-samd/boards/pygamer/mpconfigboard.mk index 0fce468d9f..a455690e19 100644 --- a/ports/atmel-samd/boards/pygamer/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pygamer/mpconfigboard.mk @@ -12,8 +12,6 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = GD25Q64C LONGINT_IMPL = MPZ -CIRCUITPY_AUDIOIO = 1 -CIRCUITPY_DISPLAYIO = 1 CIRCUITPY_GAMEPAD = 1 CIRCUITPY_GAMEPADSHIFT = 1 CIRCUITPY_STAGE = 1 diff --git a/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.mk b/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.mk index 8711738d4f..b6bb266308 100644 --- a/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.mk @@ -12,8 +12,6 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = GD25Q64C LONGINT_IMPL = MPZ -CIRCUITPY_AUDIOIO = 1 -CIRCUITPY_DISPLAYIO = 1 CIRCUITPY_GAMEPAD = 1 CIRCUITPY_GAMEPADSHIFT = 1 CIRCUITPY_STAGE = 1 diff --git a/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk b/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk index 56f1617dbf..f18a3dbf46 100644 --- a/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk @@ -14,7 +14,6 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1 EXTERNAL_FLASH_DEVICES = "W25Q64JV_IQ" LONGINT_IMPL = MPZ -CIRCUITPY_PS2IO = 1 # No I2S on SAMD51G CIRCUITPY_AUDIOBUSIO = 0 # Make room for more stuff diff --git a/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk index ec37186c3a..bb0b7d1754 100644 --- a/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk @@ -12,7 +12,6 @@ EXTERNAL_FLASH_DEVICE_COUNT = 2 EXTERNAL_FLASH_DEVICES = "W25Q64JV_IQ, GD25Q64C" LONGINT_IMPL = MPZ -CIRCUITPY_PS2IO = 1 # No I2S on SAMD51G CIRCUITPY_AUDIOBUSIO = 0 diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 88ddb49e01..9e6693d55e 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -27,6 +27,9 @@ endif # Put samd51-only choices here. ifeq ($(CHIP_FAMILY),samd51) +CIRCUITPY_NETWORK = 1 +MICROPY_PY_WIZNET5K = 5500 +CIRCUITPY_PS2IO = 1 CIRCUITPY_SAMD = 1 CIRCUITPY_TOUCHIO_USE_NATIVE = 0 endif From 352bd95f5a337eb79dee602e4ee7a7d7754dca7c Mon Sep 17 00:00:00 2001 From: Hierophect Date: Fri, 22 Nov 2019 11:19:39 -0500 Subject: [PATCH 088/189] remove blackpill --- .github/workflows/build.yml | 1 - .../boards/stm32f411ce_blackpill/board.c | 39 -- .../stm32f411ce_blackpill/mpconfigboard.h | 41 -- .../stm32f411ce_blackpill/mpconfigboard.mk | 17 - .../boards/stm32f411ce_blackpill/pins.c | 38 -- .../stm32f4xx_hal_conf.h | 440 ------------------ 6 files changed, 576 deletions(-) delete mode 100644 ports/stm32f4/boards/stm32f411ce_blackpill/board.c delete mode 100644 ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h delete mode 100644 ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk delete mode 100644 ports/stm32f4/boards/stm32f411ce_blackpill/pins.c delete mode 100644 ports/stm32f4/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c0ab6f68b4..9e5a6654ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -150,7 +150,6 @@ jobs: - "sparkfun_samd21_dev" - "sparkfun_samd21_mini" - "spresense" - - "stm32f411ce_blackpill" - "stm32f411ve_discovery" - "stm32f412zg_discovery" - "stringcar_m0_express" diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/board.c b/ports/stm32f4/boards/stm32f411ce_blackpill/board.c deleted file mode 100644 index 82b0c506ed..0000000000 --- a/ports/stm32f4/boards/stm32f411ce_blackpill/board.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 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 "boards/board.h" -#include "mpconfigboard.h" - -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h deleted file mode 100644 index 8a482ce7dc..0000000000 --- a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland 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 "stm32f411ce-blackpill" -#define MICROPY_HW_MCU_NAME "STM32F411CE" - -#define FLASH_SIZE (0x80000) -#define FLASH_PAGE_SIZE (0x4000) - -#define BOARD_OSC_DIV 25 - -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x2000 - 0xC000) - -#define AUTORESET_DELAY_MS 500 diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk deleted file mode 100644 index 41c283a780..0000000000 --- a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk +++ /dev/null @@ -1,17 +0,0 @@ -USB_VID = 0x239A -USB_PID = 0x806A -USB_PRODUCT = "stm32f411ce-blackpill" -USB_MANUFACTURER = "Unknown" -USB_DEVICES = "CDC" - -INTERNAL_FLASH_FILESYSTEM = 1 -LONGINT_IMPL = NONE - -MCU_SERIES = m4 -MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f411xe -MCU_PACKAGE = 48 -CMSIS_MCU = STM32F411xE -LD_FILE = boards/STM32F411VETx_FLASH.ld -TEXT0_ADDR = 0x08000000 -TEXT1_ADDR = 0x08020000 \ No newline at end of file diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/pins.c b/ports/stm32f4/boards/stm32f411ce_blackpill/pins.c deleted file mode 100644 index 0846cee673..0000000000 --- a/ports/stm32f4/boards/stm32f411ce_blackpill/pins.c +++ /dev/null @@ -1,38 +0,0 @@ -#include "shared-bindings/board/__init__.h" - -STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR_B12), MP_ROM_PTR(&pin_PB12) }, - { MP_ROM_QSTR(MP_QSTR_B13), MP_ROM_PTR(&pin_PB13) }, - { MP_ROM_QSTR(MP_QSTR_B14), MP_ROM_PTR(&pin_PB14) }, - { MP_ROM_QSTR(MP_QSTR_B15), MP_ROM_PTR(&pin_PB15) }, - { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_PA11) }, - { MP_ROM_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_PA12) }, - { MP_ROM_QSTR(MP_QSTR_A15), MP_ROM_PTR(&pin_PA15) }, - { MP_ROM_QSTR(MP_QSTR_B3), MP_ROM_PTR(&pin_PB03) }, - { MP_ROM_QSTR(MP_QSTR_B4), MP_ROM_PTR(&pin_PB04) }, - { MP_ROM_QSTR(MP_QSTR_B5), MP_ROM_PTR(&pin_PB05) }, - { MP_ROM_QSTR(MP_QSTR_B6), MP_ROM_PTR(&pin_PB06) }, - { MP_ROM_QSTR(MP_QSTR_B7), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_B8), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_B9), MP_ROM_PTR(&pin_PB09) }, - - { MP_ROM_QSTR(MP_QSTR_B10), MP_ROM_PTR(&pin_PB10) }, - { MP_ROM_QSTR(MP_QSTR_B2), MP_ROM_PTR(&pin_PB02) }, - { MP_ROM_QSTR(MP_QSTR_B1), MP_ROM_PTR(&pin_PB01) }, - { MP_ROM_QSTR(MP_QSTR_B0), MP_ROM_PTR(&pin_PB00) }, - { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA01) }, - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA00) }, - { MP_ROM_QSTR(MP_QSTR_C15), MP_ROM_PTR(&pin_PC15) }, - { MP_ROM_QSTR(MP_QSTR_C14), MP_ROM_PTR(&pin_PC14) }, - { MP_ROM_QSTR(MP_QSTR_C13), MP_ROM_PTR(&pin_PC13) }, -}; -MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h b/ports/stm32f4/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h deleted file mode 100644 index 81d29f2420..0000000000 --- a/ports/stm32f4/boards/stm32f411ce_blackpill/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,440 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -/* #define HAL_PCD_MODULE_ENABLED */ -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ From f13ba7e8d9048802e960b45264f7d85cc16a1a4d Mon Sep 17 00:00:00 2001 From: David Grimes Date: Fri, 22 Nov 2019 13:47:13 -0500 Subject: [PATCH 089/189] * only make objects long lived if they are on the GC heap --- py/gc.c | 10 ---------- py/gc.h | 11 +++++++++++ py/gc_long_lived.c | 5 +++++ 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/py/gc.c b/py/gc.c index ac584d5d20..a8a5fde125 100755 --- a/py/gc.c +++ b/py/gc.c @@ -53,9 +53,6 @@ // detect untraced object still in use #define CLEAR_ON_SWEEP (0) -#define WORDS_PER_BLOCK ((MICROPY_BYTES_PER_GC_BLOCK) / BYTES_PER_WORD) -#define BYTES_PER_BLOCK (MICROPY_BYTES_PER_GC_BLOCK) - // ATB = allocation table byte // 0b00 = FREE -- free block // 0b01 = HEAD -- head of a chain of blocks @@ -209,13 +206,6 @@ bool gc_is_locked(void) { return MP_STATE_MEM(gc_lock_depth) != 0; } -// ptr should be of type void* -#define VERIFY_PTR(ptr) ( \ - ((uintptr_t)(ptr) & (BYTES_PER_BLOCK - 1)) == 0 /* must be aligned on a block */ \ - && ptr >= (void*)MP_STATE_MEM(gc_pool_start) /* must be above start of pool */ \ - && ptr < (void*)MP_STATE_MEM(gc_pool_end) /* must be below end of pool */ \ - ) - #ifndef TRACE_MARK #if DEBUG_PRINT #define TRACE_MARK(block, ptr) DEBUG_printf("gc_mark(%p)\n", ptr) diff --git a/py/gc.h b/py/gc.h index 02bf451587..cd63ba94cf 100644 --- a/py/gc.h +++ b/py/gc.h @@ -29,8 +29,19 @@ #include #include "py/mpconfig.h" +#include "py/mpstate.h" #include "py/misc.h" +#define WORDS_PER_BLOCK ((MICROPY_BYTES_PER_GC_BLOCK) / BYTES_PER_WORD) +#define BYTES_PER_BLOCK (MICROPY_BYTES_PER_GC_BLOCK) + +// ptr should be of type void* +#define VERIFY_PTR(ptr) ( \ + ((uintptr_t)(ptr) & (BYTES_PER_BLOCK - 1)) == 0 /* must be aligned on a block */ \ + && ptr >= (void*)MP_STATE_MEM(gc_pool_start) /* must be above start of pool */ \ + && ptr < (void*)MP_STATE_MEM(gc_pool_end) /* must be below end of pool */ \ + ) + void gc_init(void *start, void *end); void gc_deinit(void); diff --git a/py/gc_long_lived.c b/py/gc_long_lived.c index 49bf1fcd79..01c22a7af7 100755 --- a/py/gc_long_lived.c +++ b/py/gc_long_lived.c @@ -126,6 +126,11 @@ mp_obj_t make_obj_long_lived(mp_obj_t obj, uint8_t max_depth){ if (obj == NULL) { return obj; } + // If not in the GC pool, do nothing. This can happen (at least) when + // there are frozen mp_type_bytes objects in ROM. + if (!VERIFY_PTR((void *)obj)) { + return obj; + } if (MP_OBJ_IS_TYPE(obj, &mp_type_fun_bc)) { mp_obj_fun_bc_t *fun_bc = MP_OBJ_TO_PTR(obj); return MP_OBJ_FROM_PTR(make_fun_bc_long_lived(fun_bc, max_depth)); From 2e9aa387002468b2c35e60853aefd84cfa877897 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 22 Nov 2019 13:49:33 -0500 Subject: [PATCH 090/189] turn off network in pewpew_m4 --- ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk index 54ec3d1d0e..1861b8ec45 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk @@ -17,6 +17,7 @@ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 +CIRCUITPY_NETWORK = 0 CIRCUITPY_PIXELBUF = 0 CIRCUITPY_RTC = 0 CIRCUITPY_TOUCHIO = 0 From 1a62a9cb1757e8e583ed709c2a96427b35a74e2d Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 22 Nov 2019 14:02:44 -0500 Subject: [PATCH 091/189] remove network from kicksat_sprite --- ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index 706e551c5d..08af43ee93 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -14,3 +14,4 @@ LONGINT_IMPL = MPZ # Not needed. CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_DISPLAYIO = 0 +CIRCUITPY_NETWORK = 0 From aabb56c840456dfdd065c8ca2e11854f32c5a63c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 22 Nov 2019 13:54:37 -0600 Subject: [PATCH 092/189] nrf: i2sout: Only update hold_value when appropriate If we put no samples into the buffer, then there is no last sample to fill out hold_value with. (and, in fact, the expression such as *(uint32_t*)(buffer-4) is outside an allocated region) Detect this condition, and leave the prior value in place. This improves clicks heard when pausing and resuming a waveform. --- ports/nrf/common-hal/audiobusio/I2SOut.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/ports/nrf/common-hal/audiobusio/I2SOut.c b/ports/nrf/common-hal/audiobusio/I2SOut.c index ac369277f2..5a53f66d27 100644 --- a/ports/nrf/common-hal/audiobusio/I2SOut.c +++ b/ports/nrf/common-hal/audiobusio/I2SOut.c @@ -108,6 +108,7 @@ void choose_i2s_clocking(audiobusio_i2sout_obj_t *self, uint32_t sample_rate) { static void i2s_buffer_fill(audiobusio_i2sout_obj_t* self) { void *buffer = self->buffers[self->next_buffer]; + void *buffer_start = buffer; NRF_I2S->TXD.PTR = (uintptr_t)buffer; self->next_buffer = !self->next_buffer; size_t bytesleft = self->buffer_length; @@ -157,15 +158,17 @@ static void i2s_buffer_fill(audiobusio_i2sout_obj_t* self) { // Find the last frame of real audio data and replicate its samples until // you have 32 bits worth, which is the fundamental unit of nRF I2S DMA - if (self->bytes_per_sample == 1 && self->channel_count == 1) { - // For 8-bit mono, 4 copies of the final sample are required - self->hold_value = 0x01010101 * *(uint8_t*)(buffer-1); - } else if (self->bytes_per_sample == 2 && self->channel_count == 2) { - // For 16-bit stereo, 1 copy of the final sample is required - self->hold_value = *(uint32_t*)(buffer-4); - } else { - // For 8-bit stereo and 16-bit mono, 2 copies of the final sample are required - self->hold_value = 0x00010001 * *(uint16_t*)(buffer-2); + if(buffer != buffer_start) { + if (self->bytes_per_sample == 1 && self->channel_count == 1) { + // For 8-bit mono, 4 copies of the final sample are required + self->hold_value = 0x01010101 * *(uint8_t*)(buffer-1); + } else if (self->bytes_per_sample == 2 && self->channel_count == 2) { + // For 16-bit stereo, 1 copy of the final sample is required + self->hold_value = *(uint32_t*)(buffer-4); + } else { + // For 8-bit stereo and 16-bit mono, 2 copies of the final sample are required + self->hold_value = 0x00010001 * *(uint16_t*)(buffer-2); + } } // Emulate pausing and stopping by filling the DMA buffer with copies of From 1c6c9a3e1f041670c008e719be635f4205add6e9 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 22 Nov 2019 14:15:07 -0600 Subject: [PATCH 093/189] nrf: i2sout: Ensure hardware I2S is stopped at deinit .. otherwise, it may be possible under some scenario, for the background task to continue and overwrite unrelated memory. --- ports/nrf/common-hal/audiobusio/I2SOut.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/nrf/common-hal/audiobusio/I2SOut.c b/ports/nrf/common-hal/audiobusio/I2SOut.c index 5a53f66d27..93e6d485d2 100644 --- a/ports/nrf/common-hal/audiobusio/I2SOut.c +++ b/ports/nrf/common-hal/audiobusio/I2SOut.c @@ -221,6 +221,8 @@ void common_hal_audiobusio_i2sout_deinit(audiobusio_i2sout_obj_t* self) { if (common_hal_audiobusio_i2sout_deinited(self)) { return; } + NRF_I2S->TASKS_STOP = 1; + NRF_I2S->ENABLE = I2S_ENABLE_ENABLE_Disabled; reset_pin_number(self->bit_clock_pin_number); self->bit_clock_pin_number = 0xff; reset_pin_number(self->word_select_pin_number); From eb44b2bb26ba4578ca97e459c9baa69d549c40a5 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 20 Nov 2019 09:38:17 -0600 Subject: [PATCH 094/189] build.yml: Use a newer build toolchain .. the new version is not offered in .deb form, so the installation process also changes --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1d5793573f..e34a2e10c9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -168,7 +168,8 @@ jobs: run: | sudo apt-get install -y gettext pip install requests sh click setuptools awscli - wget https://s3.amazonaws.com/adafruit-circuit-python/gcc-arm-embedded_7-2018q2-1~xenial1_amd64.deb && sudo dpkg -i gcc-arm-embedded*_amd64.deb + wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 + sudo tar -C /usr --strip-components=1 -xaf gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 - name: Versions run: | gcc --version From bfdfe0e68191554b70103f249ae1fe08f7fc85f0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 22 Nov 2019 14:30:08 -0600 Subject: [PATCH 095/189] stm32: fix uses of ticks_ms global --- ports/stm32f4/common-hal/busio/UART.c | 4 ++-- ports/stm32f4/common-hal/microcontroller/__init__.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ports/stm32f4/common-hal/busio/UART.c b/ports/stm32f4/common-hal/busio/UART.c index c4ab237cd1..5ddfa6a4c7 100644 --- a/ports/stm32f4/common-hal/busio/UART.c +++ b/ports/stm32f4/common-hal/busio/UART.c @@ -250,10 +250,10 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t } size_t rx_bytes = 0; - uint64_t start_ticks = ticks_ms; + uint64_t start_ticks = supervisor_ticks_ms64(); // Wait for all bytes received or timeout, same as nrf - while ( (ringbuf_count(&self->rbuf) < len) && (ticks_ms - start_ticks < self->timeout_ms) ) { + while ( (ringbuf_count(&self->rbuf) < len) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) { RUN_BACKGROUND_TASKS; //restart if it failed in the callback if (errflag != HAL_OK) { diff --git a/ports/stm32f4/common-hal/microcontroller/__init__.c b/ports/stm32f4/common-hal/microcontroller/__init__.c index c7493a4d60..ffab5d1e50 100644 --- a/ports/stm32f4/common-hal/microcontroller/__init__.c +++ b/ports/stm32f4/common-hal/microcontroller/__init__.c @@ -48,9 +48,9 @@ STATIC uint32_t get_us(void) { uint32_t ticks_per_us = HAL_RCC_GetSysClockFreq()/1000000; uint32_t micros, sys_cycles; do { - micros = ticks_ms; + micros = supervisor_ticks_ms32(); sys_cycles = SysTick->VAL; //counts backwards - } while (micros != ticks_ms); //try again if ticks_ms rolled over + } while (micros != supervisor_ticks_ms32()); //try again if ticks_ms rolled over return (micros * 1000) + (ticks_per_us * 1000 - sys_cycles) / ticks_per_us; } From 13375d16f11d86f8c7c77e6be209d914d35b6372 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 22 Nov 2019 15:44:51 -0500 Subject: [PATCH 096/189] change mpconfigport.mk files so they can be overriden by mpconfigboard.mk --- .../boards/kicksat-sprite/mpconfigboard.mk | 3 +- ports/atmel-samd/mpconfigport.mk | 23 ++++++++++- ports/nrf/mpconfigport.mk | 17 +++++++-- ports/stm32f4/mpconfigport.mk | 38 +++++++++++++++++++ 4 files changed, 74 insertions(+), 7 deletions(-) diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index 93e483928b..453be3b5ee 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -12,8 +12,7 @@ INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ # Not needed. -CIRCUITPY_PS2IO = 0 -CIRCUITPY_NETWORK = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_NETWORK = 0 +CIRCUITPY_PS2IO = 0 diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 9e6693d55e..8958550060 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -16,10 +16,18 @@ endif # Put samd21-only choices here. ifeq ($(CHIP_FAMILY),samd21) -# frequencyio not yet verified as working on SAMD21. +# frequencyio not yet verified as working on SAMD21, though make it possible to override. +ifndef CIRCUITPY_AUDIOMIXER CIRCUITPY_AUDIOMIXER = 0 +endif + +ifndef CIRCUITPY_FREQUENCYIO CIRCUITPY_FREQUENCYIO = 0 +endif + +ifndef CIRCUITPY_TOUCHIO_USE_NATIVE CIRCUITPY_TOUCHIO_USE_NATIVE = 1 +endif # SAMD21 needs separate endpoint pairs for MSC BULK IN and BULK OUT, otherwise it's erratic. USB_MSC_EP_NUM_OUT = 1 @@ -27,11 +35,22 @@ endif # Put samd51-only choices here. ifeq ($(CHIP_FAMILY),samd51) +# No native touchio on SAMD51. +CIRCUITPY_TOUCHIO_USE_NATIVE = 0 + +ifndef CIRCUITPY_NETWORK CIRCUITPY_NETWORK = 1 MICROPY_PY_WIZNET5K = 5500 +endif + +ifndef CIRCUITPY_PS2IO CIRCUITPY_PS2IO = 1 +endif + +ifndef CIRCUITPY_SAMD CIRCUITPY_SAMD = 1 -CIRCUITPY_TOUCHIO_USE_NATIVE = 0 +endif + endif INTERNAL_LIBM = 1 diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index 02bde3effa..d070978b71 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -11,20 +11,31 @@ USB_SERIAL_NUMBER_LENGTH = 16 LONGINT_IMPL = MPZ # Audio via PWM +ifndef CIRCUITPY_AUDIOCORE CIRCUITPY_AUDIOCORE = 1 +endif + CIRCUITPY_AUDIOIO = 0 + +ifndef CIRCUITPY_AUDIOMIXER CIRCUITPY_AUDIOMIXER = 1 +endif + +ifndef CIRCUITPY_AUDIOPWMIO CIRCUITPY_AUDIOPWMIO = 1 +endif + +ifndef CIRCUITPY_AUDIOBUSIO CIRCUITPY_AUDIOBUSIO = 1 +endif # No I2CSlave implementation CIRCUITPY_I2CSLAVE = 0 -# enable NVM -CIRCUITPY_NVM = 1 - # enable RTC +ifndef CIRCUITPY_RTC CIRCUITPY_RTC = 1 +endif # frequencyio not yet implemented CIRCUITPY_FREQUENCYIO = 0 diff --git a/ports/stm32f4/mpconfigport.mk b/ports/stm32f4/mpconfigport.mk index 928d53e67c..3ae0daaa08 100644 --- a/ports/stm32f4/mpconfigport.mk +++ b/ports/stm32f4/mpconfigport.mk @@ -15,18 +15,56 @@ LONGINT_IMPL = MPZ #Reduced feature set for early port CIRCUITPY_MINIMAL_BUILD = 1 +# The ifndef's allow overriding in mpconfigboard.mk. + +ifndef CIRCUITPY_BOARD CIRCUITPY_BOARD = 1 +endif + +ifndef CIRCUITPY_DIGITALIO CIRCUITPY_DIGITALIO = 1 +endif + +ifndef CIRCUITPY_ANALOGIO CIRCUITPY_ANALOGIO = 1 +endif + +ifndef CIRCUITPY_MICROCONTROLLER CIRCUITPY_MICROCONTROLLER = 1 +endif + +ifndef CIRCUITPY_BUSIO CIRCUITPY_BUSIO = 1 +endif + +ifndef CIRCUITPY_PULSEIO CIRCUITPY_PULSEIO = 1 +endif + +ifndef CIRCUITPY_OS CIRCUITPY_OS = 1 +endif + +ifndef CIRCUITPY_STORAGE CIRCUITPY_STORAGE = 1 +endif + +ifndef CIRCUITPY_RANDOM CIRCUITPY_RANDOM = 1 +endif + +ifndef CRICUITPY_USB_HID CIRCUITPY_USB_HID = 1 +endif + +ifndef CIRCUITPY_USB_MIDI CIRCUITPY_USB_MIDI = 1 +endif + +ifndef CIRCUITPY_NEOPIXEL_WRITE CIRCUITPY_NEOPIXEL_WRITE = 1 +endif + #ifeq ($(MCU_SUB_VARIANT), stm32f412zx) #endif From 1ccb7b4c5e4706943f8ee721eb1880ecb337fecc Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 22 Nov 2019 16:30:10 -0500 Subject: [PATCH 097/189] cosmetic commit, mostly to re-run --- ports/atmel-samd/mpconfigport.mk | 2 ++ ports/nrf/mpconfigport.mk | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 8958550060..df108664ad 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -38,6 +38,8 @@ ifeq ($(CHIP_FAMILY),samd51) # No native touchio on SAMD51. CIRCUITPY_TOUCHIO_USE_NATIVE = 0 +# The ifndef's allow overriding in mpconfigboard.mk. + ifndef CIRCUITPY_NETWORK CIRCUITPY_NETWORK = 1 MICROPY_PY_WIZNET5K = 5500 diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index d070978b71..f61d9f8eae 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -17,6 +17,8 @@ endif CIRCUITPY_AUDIOIO = 0 +# The ifndef's allow overriding in mpconfigboard.mk. + ifndef CIRCUITPY_AUDIOMIXER CIRCUITPY_AUDIOMIXER = 1 endif From 5823f5ed04d9a213d5aed463cc157dc93abb4050 Mon Sep 17 00:00:00 2001 From: Ayan Pahwa Date: Sat, 23 Nov 2019 20:43:24 +0530 Subject: [PATCH 098/189] Add \n to file end --- supervisor/shared/filesystem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supervisor/shared/filesystem.c b/supervisor/shared/filesystem.c index 225dd8d047..d26491721a 100644 --- a/supervisor/shared/filesystem.c +++ b/supervisor/shared/filesystem.c @@ -73,11 +73,11 @@ static void make_empty_file(FATFS *fatfs, const char *path) { static void make_sample_code_file(FATFS *fatfs) { FIL fs; UINT *char_written = 0; - const byte buffer[] = "print('Hello World!')"; + const byte buffer[] = "print('Hello World!')\n"; //Create or modify existing code.py file f_open(fatfs, &fs, "/code.py", FA_WRITE | FA_CREATE_ALWAYS); - f_write(&fs, buffer, sizeof(buffer), char_written); + f_write(&fs, buffer, sizeof(buffer) - 1, char_written); f_close(&fs); } From 262cfd4ea3f80697baf8ca2ccfe63ec243c02870 Mon Sep 17 00:00:00 2001 From: Ayan Pahwa Date: Sat, 23 Nov 2019 20:47:30 +0530 Subject: [PATCH 099/189] Passing address of char_written at f_write --- supervisor/shared/filesystem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supervisor/shared/filesystem.c b/supervisor/shared/filesystem.c index d26491721a..261c481727 100644 --- a/supervisor/shared/filesystem.c +++ b/supervisor/shared/filesystem.c @@ -72,12 +72,12 @@ static void make_empty_file(FATFS *fatfs, const char *path) { static void make_sample_code_file(FATFS *fatfs) { FIL fs; - UINT *char_written = 0; + UINT char_written = 0; const byte buffer[] = "print('Hello World!')\n"; //Create or modify existing code.py file f_open(fatfs, &fs, "/code.py", FA_WRITE | FA_CREATE_ALWAYS); - f_write(&fs, buffer, sizeof(buffer) - 1, char_written); + f_write(&fs, buffer, sizeof(buffer) - 1, &char_written); f_close(&fs); } From 180b485f8b109baf64252a4b9793a37377af8c25 Mon Sep 17 00:00:00 2001 From: Ayan Pahwa Date: Sat, 23 Nov 2019 20:58:33 +0530 Subject: [PATCH 100/189] Enable creation of code.py only for full builds --- supervisor/shared/filesystem.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/supervisor/shared/filesystem.c b/supervisor/shared/filesystem.c index 261c481727..b4f6d8bb9f 100644 --- a/supervisor/shared/filesystem.c +++ b/supervisor/shared/filesystem.c @@ -75,10 +75,15 @@ static void make_sample_code_file(FATFS *fatfs) { UINT char_written = 0; const byte buffer[] = "print('Hello World!')\n"; + #if CIRCUITPY_FULL_BUILD == 0 + make_empty_file(&vfs_fat->fatfs, "/code.py"); + + #else //Create or modify existing code.py file f_open(fatfs, &fs, "/code.py", FA_WRITE | FA_CREATE_ALWAYS); f_write(&fs, buffer, sizeof(buffer) - 1, &char_written); f_close(&fs); + #endif } // we don't make this function static because it needs a lot of stack and we From 19d122e546016f02b4315a5b4a35a3e6884e127f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 25 Nov 2019 09:07:20 -0600 Subject: [PATCH 101/189] nrf: i2sout: Fix double-increment when copying samples This caused two problems when playing unsigned samples: * When an even number of samples were present, it "worked" but only every other sample was copied into the output, changing the waveform * When an odd number of samples were present, the copy continued beyond the end of the buffers and caused a hard fault --- ports/nrf/common-hal/audiobusio/I2SOut.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/nrf/common-hal/audiobusio/I2SOut.c b/ports/nrf/common-hal/audiobusio/I2SOut.c index ac369277f2..b8d7ec8a26 100644 --- a/ports/nrf/common-hal/audiobusio/I2SOut.c +++ b/ports/nrf/common-hal/audiobusio/I2SOut.c @@ -139,14 +139,14 @@ static void i2s_buffer_fill(audiobusio_i2sout_obj_t* self) { uint16_t *bp = (uint16_t*)buffer; uint16_t *be = (uint16_t*)(buffer + bytecount); uint16_t *sp = (uint16_t*)self->sample_data; - for (; bp != be; bp++) { + for (; bp != be;) { *bp++ = *sp++ + 0x8000; } } else { uint8_t *bp = (uint8_t*)buffer; uint8_t *be = (uint8_t*)(buffer + bytecount); uint8_t *sp = (uint8_t*)self->sample_data; - for (; bp != be; bp++) { + for (; bp != be;) { *bp++ = *sp++ + 0x80; } } From c9946dfd63c642fc5378b222b33171f5607fc324 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 25 Nov 2019 09:17:02 -0600 Subject: [PATCH 102/189] nrf: i2sout: Use <, not !=, for loop condition This is good C style, h/t @danh --- ports/nrf/common-hal/audiobusio/I2SOut.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/nrf/common-hal/audiobusio/I2SOut.c b/ports/nrf/common-hal/audiobusio/I2SOut.c index b8d7ec8a26..04c4151962 100644 --- a/ports/nrf/common-hal/audiobusio/I2SOut.c +++ b/ports/nrf/common-hal/audiobusio/I2SOut.c @@ -139,14 +139,14 @@ static void i2s_buffer_fill(audiobusio_i2sout_obj_t* self) { uint16_t *bp = (uint16_t*)buffer; uint16_t *be = (uint16_t*)(buffer + bytecount); uint16_t *sp = (uint16_t*)self->sample_data; - for (; bp != be;) { + for (; bp < be;) { *bp++ = *sp++ + 0x8000; } } else { uint8_t *bp = (uint8_t*)buffer; uint8_t *be = (uint8_t*)(buffer + bytecount); uint8_t *sp = (uint8_t*)self->sample_data; - for (; bp != be;) { + for (; bp < be;) { *bp++ = *sp++ + 0x80; } } From 5115fdaa6f651ae4e1236e5cf7194438fe1c0533 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 25 Nov 2019 09:53:55 -0600 Subject: [PATCH 103/189] shared-bindings: I2SOut: Ensure object is deinitialised (or deinitialized, for those of us on this side of the pond) Otherwise, a sequence like ``` audio = audiobusio.I2SOut(bit_clock=board.D6, word_select=board.D9, data=board.D10) sine_wave_sample = audiocore.RawSample(sine_wave) audio.play(sine_wave_sample, loop=True) del audio ``` could free the memory associated with audio without stopping the related background task. Later, when fresh objects are allocated within a now-freed memory region, they can get overwritten in the background task, leading to a hard crash. This presumably can affect multiple I2S implementations, but it was reported against the nRF one. --- shared-bindings/audiobusio/I2SOut.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shared-bindings/audiobusio/I2SOut.c b/shared-bindings/audiobusio/I2SOut.c index 81383c7776..8f7382fde5 100644 --- a/shared-bindings/audiobusio/I2SOut.c +++ b/shared-bindings/audiobusio/I2SOut.c @@ -117,7 +117,7 @@ STATIC mp_obj_t audiobusio_i2sout_make_new(const mp_obj_type_t *type, size_t n_a assert_pin(data_obj, false); const mcu_pin_obj_t *data = MP_OBJ_TO_PTR(data_obj); - audiobusio_i2sout_obj_t *self = m_new_obj(audiobusio_i2sout_obj_t); + audiobusio_i2sout_obj_t *self = m_new_obj_with_finaliser(audiobusio_i2sout_obj_t); self->base.type = &audiobusio_i2sout_type; common_hal_audiobusio_i2sout_construct(self, bit_clock, word_select, data, args[ARG_left_justified].u_bool); @@ -268,6 +268,7 @@ const mp_obj_property_t audiobusio_i2sout_paused_obj = { STATIC const mp_rom_map_elem_t audiobusio_i2sout_locals_dict_table[] = { // Methods + { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&audiobusio_i2sout_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&audiobusio_i2sout_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&audiobusio_i2sout___exit___obj) }, From fc71ed9789243d4aec94eec7bdc13e3ac75319c2 Mon Sep 17 00:00:00 2001 From: Thomas Sarlandie Date: Fri, 15 Nov 2019 21:05:42 -0800 Subject: [PATCH 104/189] add shirtty board - hackaday supercon 2019 addon --- ports/atmel-samd/boards/shirtty/board.c | 37 ++++++++++ .../atmel-samd/boards/shirtty/mpconfigboard.h | 67 +++++++++++++++++++ .../boards/shirtty/mpconfigboard.mk | 15 +++++ ports/atmel-samd/boards/shirtty/pins.c | 36 ++++++++++ 4 files changed, 155 insertions(+) create mode 100644 ports/atmel-samd/boards/shirtty/board.c create mode 100644 ports/atmel-samd/boards/shirtty/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/shirtty/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/shirtty/pins.c diff --git a/ports/atmel-samd/boards/shirtty/board.c b/ports/atmel-samd/boards/shirtty/board.c new file mode 100644 index 0000000000..d7e856d611 --- /dev/null +++ b/ports/atmel-samd/boards/shirtty/board.c @@ -0,0 +1,37 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 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 "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/shirtty/mpconfigboard.h b/ports/atmel-samd/boards/shirtty/mpconfigboard.h new file mode 100644 index 0000000000..d5ad8e4bd1 --- /dev/null +++ b/ports/atmel-samd/boards/shirtty/mpconfigboard.h @@ -0,0 +1,67 @@ +#define MICROPY_HW_BOARD_NAME "@sarfata shIRtty" +#define MICROPY_HW_MCU_NAME "samd21e18" + +#define MICROPY_HW_LED_STATUS (&pin_PA16) + +#define MICROPY_PORT_A (PORT_PA00 | PORT_PA01) +#define MICROPY_PORT_B (0) +#define MICROPY_PORT_C (0) + +#define CIRCUITPY_INTERNAL_NVM_SIZE 256 + +#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) + +// #define IGNORE_PIN_PA00 1 +// #define IGNORE_PIN_PA01 1 +// #define IGNORE_PIN_PA02 1 +#define IGNORE_PIN_PA03 1 +#define IGNORE_PIN_PA04 1 +#define IGNORE_PIN_PA05 1 +#define IGNORE_PIN_PA11 1 +#define IGNORE_PIN_PA12 1 +#define IGNORE_PIN_PA13 1 +#define IGNORE_PIN_PA17 1 +#define IGNORE_PIN_PA18 1 +#define IGNORE_PIN_PA19 1 +#define IGNORE_PIN_PA20 1 +#define IGNORE_PIN_PA21 1 +#define IGNORE_PIN_PA22 1 +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 +#define IGNORE_PIN_PA27 1 +#define IGNORE_PIN_PA28 1 +#define IGNORE_PIN_PA30 1 +#define IGNORE_PIN_PA31 1 +#define IGNORE_PIN_PB01 1 +#define IGNORE_PIN_PB02 1 +#define IGNORE_PIN_PB03 1 +#define IGNORE_PIN_PB04 1 +#define IGNORE_PIN_PB05 1 +#define IGNORE_PIN_PB06 1 +#define IGNORE_PIN_PB07 1 +#define IGNORE_PIN_PB08 1 +#define IGNORE_PIN_PB09 1 +#define IGNORE_PIN_PB10 1 +#define IGNORE_PIN_PB11 1 +#define IGNORE_PIN_PB12 1 +#define IGNORE_PIN_PB13 1 +#define IGNORE_PIN_PB14 1 +#define IGNORE_PIN_PB15 1 +#define IGNORE_PIN_PB16 1 +#define IGNORE_PIN_PB17 1 +#define IGNORE_PIN_PB22 1 +#define IGNORE_PIN_PB23 1 +#define IGNORE_PIN_PB30 1 +#define IGNORE_PIN_PB31 1 +#define IGNORE_PIN_PB00 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_PA09) +#define DEFAULT_I2C_BUS_SDA (&pin_PA08) + +#define DEFAULT_SPI_BUS_SCK (&pin_PA07) +#define DEFAULT_SPI_BUS_MOSI (&pin_PA06) +#define DEFAULT_SPI_BUS_MISO (&pin_PA09) + +#define DEFAULT_UART_BUS_RX (&pin_PA07) +#define DEFAULT_UART_BUS_TX (&pin_PA06) diff --git a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk new file mode 100644 index 0000000000..e713a36b73 --- /dev/null +++ b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk @@ -0,0 +1,15 @@ +LD_FILE = boards/samd21x18-bootloader.ld +USB_VID = 0x239A +USB_PID = 0x801F +USB_PRODUCT = "shIRtty" +USB_MANUFACTURER = "@sarfata" + +CHIP_VARIANT = SAMD21E18A +CHIP_FAMILY = samd21 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE +CIRCUITPY_SMALL_BUILD = 1 +CIRCUITPY_I2CSLAVE = 1 + +SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/shirtty/pins.c b/ports/atmel-samd/boards/shirtty/pins.c new file mode 100644 index 0000000000..40e8192341 --- /dev/null +++ b/ports/atmel-samd/boards/shirtty/pins.c @@ -0,0 +1,36 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_IR_RX), MP_ROM_PTR(&pin_PA10) }, + + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA09) }, + + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA07) }, + + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA06) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA16) }, + + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_IR_TX), MP_ROM_PTR(&pin_PA23) }, + + { 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_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From 3091952c9006327fddbcf1f8a77a6ec70bfaa5fc Mon Sep 17 00:00:00 2001 From: Thomas Sarlandie Date: Mon, 25 Nov 2019 17:58:00 +0100 Subject: [PATCH 105/189] ci: add shirtty to build matrix per instructions --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1d5793573f..bc22361bde 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -140,6 +140,7 @@ jobs: - "robohatmm1_m4" - "sam32" - "serpente" + - "shirtty" - "snekboard" - "sparkfun_lumidrive" - "sparkfun_nrf52840_mini" From 8f4bab2d2478719450fb6ddb2b695709388add69 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 25 Nov 2019 10:59:21 -0600 Subject: [PATCH 106/189] i2sout: Correctly retrieve channel_count The meaning of the "single channel" parameter is not well-documented, but in fact it seems that "true" must be passed or else the returned channel_count is always 1. This caused stereo samples to be played incorrectly. --- ports/nrf/common-hal/audiobusio/I2SOut.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/common-hal/audiobusio/I2SOut.c b/ports/nrf/common-hal/audiobusio/I2SOut.c index 04c4151962..4590356603 100644 --- a/ports/nrf/common-hal/audiobusio/I2SOut.c +++ b/ports/nrf/common-hal/audiobusio/I2SOut.c @@ -240,7 +240,7 @@ void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t* self, uint32_t max_buffer_length; bool single_buffer, samples_signed; - audiosample_get_buffer_structure(sample, /* single channel */ false, + audiosample_get_buffer_structure(sample, /* single channel */ true, &single_buffer, &samples_signed, &max_buffer_length, &self->channel_count); self->single_buffer = single_buffer; From 9c6466cffb0ac3a303e49bd0b685a47807a30367 Mon Sep 17 00:00:00 2001 From: Ayan Pahwa Date: Mon, 25 Nov 2019 22:31:01 +0530 Subject: [PATCH 107/189] Fix build failure for boards with less memory --- supervisor/shared/filesystem.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/supervisor/shared/filesystem.c b/supervisor/shared/filesystem.c index b4f6d8bb9f..6745c496d5 100644 --- a/supervisor/shared/filesystem.c +++ b/supervisor/shared/filesystem.c @@ -71,14 +71,13 @@ static void make_empty_file(FATFS *fatfs, const char *path) { static void make_sample_code_file(FATFS *fatfs) { + #if CIRCUITPY_FULL_BUILD == 0 + make_empty_file(fatfs, "/code.py"); + + #else FIL fs; UINT char_written = 0; const byte buffer[] = "print('Hello World!')\n"; - - #if CIRCUITPY_FULL_BUILD == 0 - make_empty_file(&vfs_fat->fatfs, "/code.py"); - - #else //Create or modify existing code.py file f_open(fatfs, &fs, "/code.py", FA_WRITE | FA_CREATE_ALWAYS); f_write(&fs, buffer, sizeof(buffer) - 1, &char_written); From 47a6eaa297216d3d1120f99dbc6a574797384700 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 25 Nov 2019 11:43:29 -0600 Subject: [PATCH 108/189] nrf: i2sout: Assign SWIDTH The sample width register was never set, so all samples were played as though they were 16 bit. After this change, 8-bit samples no longer produce audio on the MAX 98357A BOB, because only 16-, 24-, and 32-bit samples are supported by the hardware. This will be addressed by a future change to pad samples to 16 bits; see #2323 and the 98357A datasheet page 6. --- ports/nrf/common-hal/audiobusio/I2SOut.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/nrf/common-hal/audiobusio/I2SOut.c b/ports/nrf/common-hal/audiobusio/I2SOut.c index 4590356603..1110c84463 100644 --- a/ports/nrf/common-hal/audiobusio/I2SOut.c +++ b/ports/nrf/common-hal/audiobusio/I2SOut.c @@ -246,6 +246,10 @@ void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t* self, self->single_buffer = single_buffer; self->samples_signed = samples_signed; + + NRF_I2S->CONFIG.SWIDTH = self->bytes_per_sample == 1 + ? I2S_CONFIG_SWIDTH_SWIDTH_8Bit + : I2S_CONFIG_SWIDTH_SWIDTH_16Bit; choose_i2s_clocking(self, sample_rate); /* Allocate buffers based on a maximum duration * This duration was chosen empirically based on what would From 1ee35fd6fde6ef6e1aa9fd8d5d15cfd821f2a83d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 25 Nov 2019 11:43:51 -0600 Subject: [PATCH 109/189] nrf: i2sout: move register settings closer together .. just for consistency's sake --- ports/nrf/common-hal/audiobusio/I2SOut.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ports/nrf/common-hal/audiobusio/I2SOut.c b/ports/nrf/common-hal/audiobusio/I2SOut.c index 1110c84463..9958e5f00b 100644 --- a/ports/nrf/common-hal/audiobusio/I2SOut.c +++ b/ports/nrf/common-hal/audiobusio/I2SOut.c @@ -250,6 +250,10 @@ void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t* self, NRF_I2S->CONFIG.SWIDTH = self->bytes_per_sample == 1 ? I2S_CONFIG_SWIDTH_SWIDTH_8Bit : I2S_CONFIG_SWIDTH_SWIDTH_16Bit; + NRF_I2S->CONFIG.CHANNELS = self->channel_count == 1 + ? I2S_CONFIG_CHANNELS_CHANNELS_Left + : I2S_CONFIG_CHANNELS_CHANNELS_Stereo; + choose_i2s_clocking(self, sample_rate); /* Allocate buffers based on a maximum duration * This duration was chosen empirically based on what would @@ -273,9 +277,6 @@ void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t* self, self->stopping = false; i2s_buffer_fill(self); - NRF_I2S->CONFIG.CHANNELS = self->channel_count == 1 ? I2S_CONFIG_CHANNELS_CHANNELS_Left : I2S_CONFIG_CHANNELS_CHANNELS_Stereo; - - NRF_I2S->RXTXD.MAXCNT = self->buffer_length / 4; NRF_I2S->ENABLE = I2S_ENABLE_ENABLE_Enabled; From 5e1740d11f9cc446611281210a89b68013be8090 Mon Sep 17 00:00:00 2001 From: Ayan Pahwa Date: Tue, 26 Nov 2019 00:06:03 +0530 Subject: [PATCH 110/189] Not creating code.py file for non-express boards --- supervisor/shared/filesystem.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/supervisor/shared/filesystem.c b/supervisor/shared/filesystem.c index 6745c496d5..a0c2b915fa 100644 --- a/supervisor/shared/filesystem.c +++ b/supervisor/shared/filesystem.c @@ -71,10 +71,7 @@ static void make_empty_file(FATFS *fatfs, const char *path) { static void make_sample_code_file(FATFS *fatfs) { - #if CIRCUITPY_FULL_BUILD == 0 - make_empty_file(fatfs, "/code.py"); - - #else + #if CIRCUITPY_FULL_BUILD == 1 FIL fs; UINT char_written = 0; const byte buffer[] = "print('Hello World!')\n"; From 718a28c886b996c7793ad563334070f5b7517477 Mon Sep 17 00:00:00 2001 From: Ayan Pahwa Date: Tue, 26 Nov 2019 01:13:46 +0530 Subject: [PATCH 111/189] update filesystem.c --- supervisor/shared/filesystem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/shared/filesystem.c b/supervisor/shared/filesystem.c index a0c2b915fa..92727f6fb8 100644 --- a/supervisor/shared/filesystem.c +++ b/supervisor/shared/filesystem.c @@ -71,7 +71,7 @@ static void make_empty_file(FATFS *fatfs, const char *path) { static void make_sample_code_file(FATFS *fatfs) { - #if CIRCUITPY_FULL_BUILD == 1 + #if CIRCUITPY_FULL_BUILD FIL fs; UINT char_written = 0; const byte buffer[] = "print('Hello World!')\n"; From 11dc572bcea048f8b2bd6c055d6014101d2adc04 Mon Sep 17 00:00:00 2001 From: Thomas Sarlandie Date: Mon, 25 Nov 2019 21:56:42 +0100 Subject: [PATCH 112/189] feature: our own PID - thanks @ladyada --- ports/atmel-samd/boards/shirtty/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk index e713a36b73..1e5f415d30 100644 --- a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk +++ b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk @@ -1,6 +1,6 @@ LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A -USB_PID = 0x801F +USB_PID = 0x806C USB_PRODUCT = "shIRtty" USB_MANUFACTURER = "@sarfata" From 8f24ea48fbddf19429e02a211bae62c3913e4f9d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 26 Nov 2019 08:33:22 -0600 Subject: [PATCH 113/189] time: struct_time: allow construction from another struct_time This doesn't cover ALL the cases that CPython permits for construction of a struct_time, but it at least makes constructing from any namedtuple work. Closes: #2326 --- shared-bindings/time/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/time/__init__.c b/shared-bindings/time/__init__.c index 2654de09aa..7f9e5816ea 100644 --- a/shared-bindings/time/__init__.c +++ b/shared-bindings/time/__init__.c @@ -87,7 +87,7 @@ mp_obj_t struct_time_make_new(const mp_obj_type_t *type, size_t n_args, const mp if (n_args != 1 || (kw_args != NULL && kw_args->used > 0)) { mp_raise_TypeError(translate("time.struct_time() takes exactly 1 argument")); } - if (!MP_OBJ_IS_TYPE(args[0], &mp_type_tuple) || ((mp_obj_tuple_t*) MP_OBJ_TO_PTR(args[0]))->len != 9) { + if (mp_obj_get_type(args[0])->getiter != mp_obj_tuple_getiter || ((mp_obj_tuple_t*) MP_OBJ_TO_PTR(args[0]))->len != 9) { mp_raise_TypeError(translate("time.struct_time() takes a 9-sequence")); } From e188ae8b230c464d1deb4cc4a1e853c32d093c4d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 26 Nov 2019 08:45:07 -0600 Subject: [PATCH 114/189] time: struct_time: allow construction like a namedtuple, too Whenever there is more than one argument, delegate the operation to namedtuple_make_new. This allows other circuitpython-compatible idioms, like with keywords time.struct_time(tm_year=2000, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=14, tm_wday=5, tm_yday=5, tm_isdst=-1) with 9 positional arguments, etc. The only vaguely plausible CPython behavior still not permitted in CircuitPython that I found is constructing a timetuple from a length-9 list, a la time.struct_time(list(time.localtime()) Even better, by getting rid of an error message, the build shrinks a tiny bit. --- shared-bindings/time/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/time/__init__.c b/shared-bindings/time/__init__.c index 7f9e5816ea..b3e4604b51 100644 --- a/shared-bindings/time/__init__.c +++ b/shared-bindings/time/__init__.c @@ -85,7 +85,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(time_sleep_obj, time_sleep); #if MICROPY_PY_COLLECTIONS mp_obj_t struct_time_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { if (n_args != 1 || (kw_args != NULL && kw_args->used > 0)) { - mp_raise_TypeError(translate("time.struct_time() takes exactly 1 argument")); + return namedtuple_make_new(type, n_args, args, kw_args); } if (mp_obj_get_type(args[0])->getiter != mp_obj_tuple_getiter || ((mp_obj_tuple_t*) MP_OBJ_TO_PTR(args[0]))->len != 9) { mp_raise_TypeError(translate("time.struct_time() takes a 9-sequence")); From 2e4a6b94e71edd3c27cb66eaa56aec9b1e42be33 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 21 Nov 2019 09:57:20 -0600 Subject: [PATCH 115/189] atmel-samd: get most constrained m0 builds to work again By tweaking the optimizer flags, we can get back a few hundred bytes and allow these builds to work with the gcc9 compiler. --- ports/atmel-samd/Makefile | 5 +++++ ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk | 2 ++ ports/atmel-samd/boards/pyruler/mpconfigboard.mk | 2 ++ ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk | 2 ++ 4 files changed, 11 insertions(+) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 11e6874edd..f26d1f53ec 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -122,7 +122,12 @@ else ifdef CFLAGS_INLINE_LIMIT CFLAGS += -finline-limit=$(CFLAGS_INLINE_LIMIT) endif + CFLAGS += -flto -flto-partition=none + + ifdef CFLAGS_BOARD + CFLAGS += $(CFLAGS_BOARD) + endif endif CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) diff --git a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk index 686c9099fc..fe48db1411 100644 --- a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk @@ -29,3 +29,5 @@ SUPEROPT_GC = 0 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 inline-unit-growth=15 --param max-inline-insns-auto=20 diff --git a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk index 9663944a38..2fbc178afd 100644 --- a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk @@ -12,3 +12,5 @@ LONGINT_IMPL = NONE CIRCUITPY_SMALL_BUILD = 1 SUPEROPT_GC = 0 + +CFLAGS_BOARD = --param inline-unit-growth=15 --param max-inline-insns-auto=20 diff --git a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk index b4a00b654a..7cbfc36305 100644 --- a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk @@ -12,3 +12,5 @@ LONGINT_IMPL = NONE CIRCUITPY_SMALL_BUILD = 1 SUPEROPT_GC = 0 + +CFLAGS_BOARD = --param inline-unit-growth=15 --param max-inline-insns-auto=20 From 3ed6de7bafb3e128a77af749492a1267fb208f3a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 21 Nov 2019 09:57:20 -0600 Subject: [PATCH 116/189] atmel-samd: reduce inlining on pyruler again By tweaking the optimizer flags further, this build also fits --- ports/atmel-samd/boards/pyruler/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk index 2fbc178afd..44537cea76 100644 --- a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk @@ -13,4 +13,4 @@ CIRCUITPY_SMALL_BUILD = 1 SUPEROPT_GC = 0 -CFLAGS_BOARD = --param inline-unit-growth=15 --param max-inline-insns-auto=20 +CFLAGS_BOARD = --param inline-unit-growth=15 --param max-inline-insns-auto=15 From 82f55dc046ace450a518ed3700cffa72e1183c4f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 22 Nov 2019 14:27:44 -0600 Subject: [PATCH 117/189] atmel-samd: reduce inlining on constrained boards again pewpew10, pirkey_m0, and uchip all fit now. However, pirkey_m0 now has just 76 bytes flash available. --- ports/atmel-samd/boards/pewpew10/mpconfigboard.mk | 2 ++ ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/uchip/mpconfigboard.mk | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk index e24a290519..f9094db913 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk @@ -23,3 +23,5 @@ CIRCUITPY_USB_MIDI = 0 SUPEROPT_GC = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/pew-pewpew-standalone-10.x + +CFLAGS_BOARD = --param inline-unit-growth=15 --param max-inline-insns-auto=15 diff --git a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk index fe48db1411..18a1ad8686 100644 --- a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk @@ -30,4 +30,4 @@ 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 inline-unit-growth=15 --param max-inline-insns-auto=20 +CFLAGS_BOARD = --param inline-unit-growth=15 --param max-inline-insns-auto=12 diff --git a/ports/atmel-samd/boards/uchip/mpconfigboard.mk b/ports/atmel-samd/boards/uchip/mpconfigboard.mk index 109492b764..3967b76ee9 100644 --- a/ports/atmel-samd/boards/uchip/mpconfigboard.mk +++ b/ports/atmel-samd/boards/uchip/mpconfigboard.mk @@ -10,3 +10,5 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_SMALL_BUILD = 1 + +CFLAGS_BOARD = --param inline-unit-growth=15 --param max-inline-insns-auto=20 From 58ad38a88ed3e7dc33ca911f889f5a6b3aebae22 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 26 Nov 2019 09:31:44 -0800 Subject: [PATCH 118/189] Remove DotStar from pIRkey M0 for now to free up space Once we use PixelBuf, the library will be much smaller. --- ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk index 686c9099fc..6ce25cf690 100644 --- a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk @@ -26,6 +26,6 @@ CIRCUITPY_SMALL_BUILD = 1 SUPEROPT_GC = 0 # Include these Python libraries in firmware. -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar +# FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_IRRemote From 2647ea0754f891243664a34c8d1059a46d71d65c Mon Sep 17 00:00:00 2001 From: Thomas Sarlandie Date: Tue, 26 Nov 2019 19:26:18 +0100 Subject: [PATCH 119/189] fix: disable touchio to save some space --- ports/atmel-samd/boards/shirtty/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk index 1e5f415d30..9f3710e5ae 100644 --- a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk +++ b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk @@ -11,5 +11,6 @@ INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_SMALL_BUILD = 1 CIRCUITPY_I2CSLAVE = 1 +CIRCUITPY_TOUCHIO = 0 SUPEROPT_GC = 0 From e77046d49b739129f6fb25b8494c368bc7aec948 Mon Sep 17 00:00:00 2001 From: Thea Flowers Date: Tue, 26 Nov 2019 10:59:12 -0800 Subject: [PATCH 120/189] Set USB_INTERFACE_NAME for winterbloom_sol --- ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk index aa94af6a40..1f624df998 100644 --- a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk @@ -6,6 +6,7 @@ USB_VID = 0x239A USB_PID = 0x8062 USB_PRODUCT = "Sol" USB_MANUFACTURER = "Winterbloom" +USB_INTERFACE_NAME = "Sol" CHIP_VARIANT = SAMD51J20A CHIP_FAMILY = samd51 From d32dc814d3f0d3e845e54a043467f37a5908f5f0 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 26 Nov 2019 12:48:36 -0800 Subject: [PATCH 121/189] Fix ePaper so it works after a GC. We weren't correctly collecting the start and stop sequences. As a result, the GC would free the space and allocate other info there. Thanks to JacobT on Discord for the bug report! --- shared-module/displayio/EPaperDisplay.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index df1d5162b7..252b39eb74 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -26,6 +26,7 @@ #include "shared-bindings/displayio/EPaperDisplay.h" +#include "py/gc.h" #include "py/runtime.h" #include "shared-bindings/displayio/ColorConverter.h" #include "shared-bindings/displayio/FourWire.h" @@ -298,7 +299,7 @@ bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t* self, c } bool common_hal_displayio_epaperdisplay_refresh(displayio_epaperdisplay_obj_t* self) { - + if (self->refreshing && self->busy.base.type == &digitalio_digitalinout_type) { if (common_hal_digitalio_digitalinout_get_value(&self->busy) != self->busy_state) { self->refreshing = false; @@ -365,6 +366,8 @@ void release_epaperdisplay(displayio_epaperdisplay_obj_t* self) { void displayio_epaperdisplay_collect_ptrs(displayio_epaperdisplay_obj_t* self) { displayio_display_core_collect_ptrs(&self->core); + gc_collect_ptr(self->start_sequence); + gc_collect_ptr(self->stop_sequence); } bool maybe_refresh_epaperdisplay(void) { From 84e1d7f304fc92f69eb1120682fe91dff7188ddc Mon Sep 17 00:00:00 2001 From: Thea Flowers Date: Tue, 12 Nov 2019 12:33:52 -0800 Subject: [PATCH 122/189] Make the @micropython.native decorator no-op if support isn't enabled When adding the ability for boards to turn on the `@micropython.native`, `viper`, and `asm_thumb` decorators it was pointed out that it's somewhat awkward to write libraries and drivers that can take advantage of this since the decorators raise `SyntaxErrors` if they aren't enabled. In the case of `viper` and `asm_thumb` this behavior makes sense as they require writing non-normative code. Drivers could have a normal and viper/thumb implementation and implement them as such: ```python try: import _viper_impl as _impl except SyntaxError: import _python_impl as _impl def do_thing(): return _impl.do_thing() ``` For `native`, however, this behavior and the pattern to work around it is less than ideal. Since `native` code should also be valid Python code (although not necessarily the other way around) using the pattern above means *duplicating* the Python implementation and adding `@micropython.native` in the code. This is an unnecessary maintenance burden. This commit *modifies* the behavior of the `@micropython.native` decorator. On boards with `CIRCUITPY_ENABLE_MPY_NATIVE` turned on it operates as usual. On boards with it turned off it does *nothing*- it doesn't raise a `SyntaxError` and doesn't apply optimizations. This means we can write our drivers/libraries once and take advantage of speedups on boards where they are enabled. --- py/compile.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/py/compile.c b/py/compile.c index 8b17935bda..77715d3fe5 100644 --- a/py/compile.c +++ b/py/compile.c @@ -775,13 +775,22 @@ STATIC bool compile_built_in_decorator(compiler_t *comp, int name_len, mp_parse_ qstr attr = MP_PARSE_NODE_LEAF_ARG(name_nodes[1]); if (attr == MP_QSTR_bytecode) { *emit_options = MP_EMIT_OPT_BYTECODE; -#if MICROPY_EMIT_NATIVE + // @micropython.native decorator. } else if (attr == MP_QSTR_native) { + // Different from MicroPython: native doesn't raise SyntaxError if native support isn't + // compiled, it just passes through the function unmodified. + #if MICROPY_EMIT_NATIVE *emit_options = MP_EMIT_OPT_NATIVE_PYTHON; + #else + return true; + #endif + #if MICROPY_EMIT_NATIVE + // @micropython.viper decorator. } else if (attr == MP_QSTR_viper) { *emit_options = MP_EMIT_OPT_VIPER; -#endif + #endif #if MICROPY_EMIT_INLINE_ASM + // @micropython.asm_thumb decorator. } else if (attr == ASM_DECORATOR_QSTR) { *emit_options = MP_EMIT_OPT_ASM; #endif From b32a9192df04c6fb36027b2b9b3e0e3a3548005a Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 27 Nov 2019 12:52:11 -0500 Subject: [PATCH 123/189] make UART.write be blocking on SAMD; add timeout property --- ports/atmel-samd/common-hal/busio/UART.c | 36 +++++---- ports/cxd56/common-hal/busio/UART.c | 12 ++- ports/cxd56/common-hal/busio/UART.h | 2 +- ports/nrf/common-hal/busio/UART.c | 24 +++--- ports/stm32f4/common-hal/busio/UART.c | 98 +++++++++++++----------- shared-bindings/board/__init__.c | 6 ++ shared-bindings/busio/UART.c | 46 +++++++++-- shared-bindings/busio/UART.h | 3 +- shared-module/board/__init__.c | 2 +- 9 files changed, 144 insertions(+), 85 deletions(-) diff --git a/ports/atmel-samd/common-hal/busio/UART.c b/ports/atmel-samd/common-hal/busio/UART.c index 2505e894af..d869f70ff4 100644 --- a/ports/atmel-samd/common-hal/busio/UART.c +++ b/ports/atmel-samd/common-hal/busio/UART.c @@ -323,29 +323,23 @@ size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, 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; } - // Wait until write is complete or timeout. - bool done = false; - uint64_t start_ticks = ticks_ms; - // Busy-wait for timeout. - while (ticks_ms - start_ticks < self->timeout_ms) { - if (usart_async_is_tx_empty(usart_desc_p)) { - done = true; + // 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; } - if (!done) { - *errcode = MP_EAGAIN; - return MP_STREAM_ERROR; - } - - // All the characters got written. return len; } @@ -368,6 +362,14 @@ void common_hal_busio_uart_set_baudrate(busio_uart_obj_t *self, uint32_t baudrat self->baudrate = baudrate; } +mp_float_t common_hal_busio_uart_get_timeout(busio_uart_obj_t *self) { + return (mp_float_t) (self->timeout_ms / 1000.0f); +} + +void common_hal_busio_uart_set_timeout(busio_uart_obj_t *self, mp_float_t timeout) { + self->timeout_ms = timeout * 1000; +} + 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; @@ -383,12 +385,14 @@ 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; } // This assignment is only here because the usart_async routines take a *const argument. - const struct _usart_async_device * const usart_device_p = - (struct _usart_async_device * const) &self->usart_desc.device; - return _usart_async_is_byte_sent(usart_device_p); + 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); } diff --git a/ports/cxd56/common-hal/busio/UART.c b/ports/cxd56/common-hal/busio/UART.c index 4a1376f19a..6ae2403c13 100644 --- a/ports/cxd56/common-hal/busio/UART.c +++ b/ports/cxd56/common-hal/busio/UART.c @@ -102,7 +102,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, self->tx_pin = tx; self->rx_pin = rx; self->baudrate = baudrate; - self->timeout = timeout; + self->timeout_us = timeout * 1000000; } void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { @@ -135,7 +135,7 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t FD_SET(busio_uart_dev[self->number].fd, &rfds); tv.tv_sec = 0; - tv.tv_usec = self->timeout * 1000; + tv.tv_usec = self->timeout_us; retval = select(busio_uart_dev[self->number].fd + 1, &rfds, NULL, NULL, &tv); @@ -172,6 +172,14 @@ void common_hal_busio_uart_set_baudrate(busio_uart_obj_t *self, uint32_t baudrat ioctl(busio_uart_dev[self->number].fd, TCFLSH, (long unsigned int)NULL); } +mp_float_t common_hal_busio_uart_get_timeout(busio_uart_obj_t *self) { + return (mp_float_t) (self->timeout / 1000000.0f); +} + +void common_hal_busio_uart_set_timeout(busio_uart_obj_t *self, mp_float_t timeout) { + self->timeout_us = timeout * 1000000; +} + uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { int count = 0; diff --git a/ports/cxd56/common-hal/busio/UART.h b/ports/cxd56/common-hal/busio/UART.h index e1d8161491..a69c470566 100644 --- a/ports/cxd56/common-hal/busio/UART.h +++ b/ports/cxd56/common-hal/busio/UART.h @@ -37,7 +37,7 @@ typedef struct { const mcu_pin_obj_t *tx_pin; const mcu_pin_obj_t *rx_pin; uint32_t baudrate; - uint32_t timeout; + uint32_t timeout_us; } busio_uart_obj_t; void busio_uart_reset(void); diff --git a/ports/nrf/common-hal/busio/UART.c b/ports/nrf/common-hal/busio/UART.c index 54a66ddbe7..a0ae8af00e 100644 --- a/ports/nrf/common-hal/busio/UART.c +++ b/ports/nrf/common-hal/busio/UART.c @@ -265,19 +265,6 @@ size_t common_hal_busio_uart_write (busio_uart_obj_t *self, const uint8_t *data, if ( len == 0 ) return 0; - uint64_t start_ticks = ticks_ms; - - // Wait for on-going transfer to complete - while ( nrfx_uarte_tx_in_progress(self->uarte) && (ticks_ms - start_ticks < self->timeout_ms) ) { - RUN_BACKGROUND_TASKS; - } - - // Time up - if ( !(ticks_ms - start_ticks < self->timeout_ms) ) { - *errcode = MP_EAGAIN; - return MP_STREAM_ERROR; - } - // EasyDMA can only access SRAM uint8_t * tx_buf = (uint8_t*) data; if ( !nrfx_is_in_ram(data) ) { @@ -290,7 +277,8 @@ size_t common_hal_busio_uart_write (busio_uart_obj_t *self, const uint8_t *data, _VERIFY_ERR(*errcode); (*errcode) = 0; - while ( nrfx_uarte_tx_in_progress(self->uarte) && (ticks_ms - start_ticks < self->timeout_ms) ) { + // Wait for write to complete. + while ( nrfx_uarte_tx_in_progress(self->uarte) ) { RUN_BACKGROUND_TASKS; } @@ -310,6 +298,14 @@ void common_hal_busio_uart_set_baudrate(busio_uart_obj_t *self, uint32_t baudrat nrf_uarte_baudrate_set(self->uarte->p_reg, get_nrf_baud(baudrate)); } +mp_float_t common_hal_busio_uart_get_timeout(busio_uart_obj_t *self) { + return (mp_float_t) (self->timeout_ms / 1000.0f); +} + +void common_hal_busio_uart_set_timeout(busio_uart_obj_t *self, mp_float_t timeout) { + self->timeout_ms = timeout * 1000; +} + uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { return ringbuf_count(&self->rbuf); } diff --git a/ports/stm32f4/common-hal/busio/UART.c b/ports/stm32f4/common-hal/busio/UART.c index c4ab237cd1..f0e0cc9eb4 100644 --- a/ports/stm32f4/common-hal/busio/UART.c +++ b/ports/stm32f4/common-hal/busio/UART.c @@ -36,7 +36,7 @@ #include "supervisor/shared/translate.h" #include "tick.h" -#include "stm32f4xx_hal.h" +#include "stm32f4xx_hal.h" #define ALL_UARTS 0xFFFF @@ -55,7 +55,7 @@ void uart_reset(void) { uart_clock_disable(ALL_UARTS); } -STATIC USART_TypeDef * assign_uart_or_throw(busio_uart_obj_t* self, bool pin_eval, +STATIC USART_TypeDef * assign_uart_or_throw(busio_uart_obj_t* self, bool pin_eval, int uart_index, bool uart_taken) { if (pin_eval) { //assign a root pointer pointer for IRQ @@ -82,7 +82,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t* self, uint8_t rx_len = sizeof(mcu_uart_rx_list)/sizeof(*mcu_uart_rx_list); bool uart_taken = false; uint8_t uart_index = 0; //origin 0 corrected - + //Can have both pins, or either if ((tx != mp_const_none) && (rx != mp_const_none)) { //normal find loop if both pins exist @@ -90,7 +90,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t* self, if (mcu_uart_tx_list[i].pin == tx) { //rx for (uint j = 0; j < rx_len; j++) { - if (mcu_uart_rx_list[j].pin == rx + if (mcu_uart_rx_list[j].pin == rx && mcu_uart_rx_list[j].uart_index == mcu_uart_tx_list[i].uart_index) { //keep looking if the UART is taken, edge case if (reserved_uart[mcu_uart_tx_list[i].uart_index - 1]) { @@ -106,7 +106,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t* self, } } uart_index = self->tx->uart_index - 1; - USARTx = assign_uart_or_throw(self, (self->tx != NULL && self->rx != NULL), + USARTx = assign_uart_or_throw(self, (self->tx != NULL && self->rx != NULL), uart_index, uart_taken); } else if (tx == mp_const_none) { //If there is no tx, run only rx @@ -123,7 +123,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t* self, } } uart_index = self->rx->uart_index - 1; - USARTx = assign_uart_or_throw(self, (self->rx != NULL), + USARTx = assign_uart_or_throw(self, (self->rx != NULL), uart_index, uart_taken); } else if (rx == mp_const_none) { //If there is no rx, run only tx @@ -140,7 +140,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t* self, } } uart_index = self->tx->uart_index - 1; - USARTx = assign_uart_or_throw(self, (self->tx != NULL), + USARTx = assign_uart_or_throw(self, (self->tx != NULL), uart_index, uart_taken); } else { //both pins cannot be empty @@ -173,7 +173,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t* self, GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_PULLUP; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = self->rx->altfn_index; + GPIO_InitStruct.Alternate = self->rx->altfn_index; HAL_GPIO_Init(pin_port(rx->port), &GPIO_InitStruct); } @@ -186,7 +186,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t* self, self->handle.Init.BaudRate = baudrate; self->handle.Init.WordLength = (bits == 9) ? UART_WORDLENGTH_9B : UART_WORDLENGTH_8B; self->handle.Init.StopBits = (stop > 1) ? UART_STOPBITS_2 : UART_STOPBITS_1; - self->handle.Init.Parity = (parity == PARITY_ODD) ? UART_PARITY_ODD : + self->handle.Init.Parity = (parity == PARITY_ODD) ? UART_PARITY_ODD : (parity == PARITY_EVEN) ? UART_PARITY_EVEN : UART_PARITY_NONE; self->handle.Init.Mode = (self->tx != NULL && self->rx != NULL) ? UART_MODE_TX_RX : @@ -234,7 +234,7 @@ bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { if (common_hal_busio_uart_deinited(self)) return; - + reset_pin_number(self->tx->pin->port,self->tx->pin->number); reset_pin_number(self->rx->pin->port,self->rx->pin->number); self->tx = mp_const_none; @@ -279,7 +279,7 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t *errcode = EAGAIN; return MP_STREAM_ERROR; } - return rx_bytes; + return rx_bytes; } // Write characters. @@ -290,13 +290,15 @@ size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, bool write_err = false; //write error shouldn't disable interrupts HAL_NVIC_DisableIRQ(self->irq); - if (HAL_UART_Transmit(&self->handle, (uint8_t*)data, len, self->timeout_ms) != HAL_OK) { + if (HAL_UART_Transmit(&self->handle, (uint8_t*)data, len, HAL_MAX_DELAY) != HAL_OK) { write_err = true; } HAL_UART_Receive_IT(&self->handle, &self->rx_char, 1); HAL_NVIC_EnableIRQ(self->irq); - if (write_err) mp_raise_ValueError(translate("UART write error")); + if (write_err) { + mp_raise_ValueError(translate("UART write error")); + } return len; } @@ -312,7 +314,7 @@ void HAL_UART_RxCpltCallback(UART_HandleTypeDef *handle) } ringbuf_put_n(&context->rbuf, &context->rx_char, 1); errflag = HAL_UART_Receive_IT(handle, &context->rx_char, 1); - + return; } } @@ -360,6 +362,14 @@ void common_hal_busio_uart_set_baudrate(busio_uart_obj_t *self, uint32_t baudrat self->baudrate = baudrate; } +mp_float_t common_hal_busio_uart_get_timeout(busio_uart_obj_t *self) { + return (mp_float_t) (self->timeout_ms / 1000.0f); +} + +void common_hal_busio_uart_set_timeout(busio_uart_obj_t *self, mp_float_t timeout) { + self->timeout_ms = timeout * 1000; +} + uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { return ringbuf_count(&self->rbuf); } @@ -414,71 +424,71 @@ STATIC void uart_clock_enable(uint16_t mask) { if (mask & (1 << 0)) { __HAL_RCC_USART1_FORCE_RESET(); __HAL_RCC_USART1_RELEASE_RESET(); - __HAL_RCC_USART1_CLK_ENABLE(); + __HAL_RCC_USART1_CLK_ENABLE(); } #endif #ifdef USART2 if (mask & (1 << 1)) { __HAL_RCC_USART2_FORCE_RESET(); __HAL_RCC_USART2_RELEASE_RESET(); - __HAL_RCC_USART2_CLK_ENABLE(); + __HAL_RCC_USART2_CLK_ENABLE(); } #endif #ifdef USART3 if (mask & (1 << 2)) { __HAL_RCC_USART3_FORCE_RESET(); __HAL_RCC_USART3_RELEASE_RESET(); - __HAL_RCC_USART3_CLK_ENABLE(); + __HAL_RCC_USART3_CLK_ENABLE(); } #endif #ifdef UART4 if (mask & (1 << 3)) { __HAL_RCC_UART4_FORCE_RESET(); __HAL_RCC_UART4_RELEASE_RESET(); - __HAL_RCC_UART4_CLK_ENABLE(); + __HAL_RCC_UART4_CLK_ENABLE(); } #endif #ifdef UART5 if (mask & (1 << 4)) { __HAL_RCC_UART5_FORCE_RESET(); __HAL_RCC_UART5_RELEASE_RESET(); - __HAL_RCC_UART5_CLK_ENABLE(); + __HAL_RCC_UART5_CLK_ENABLE(); } #endif #ifdef USART6 if (mask & (1 << 5)) { __HAL_RCC_USART6_FORCE_RESET(); __HAL_RCC_USART6_RELEASE_RESET(); - __HAL_RCC_USART6_CLK_ENABLE(); - } + __HAL_RCC_USART6_CLK_ENABLE(); + } #endif #ifdef UART7 if (mask & (1 << 6)) { __HAL_RCC_UART7_FORCE_RESET(); __HAL_RCC_UART7_RELEASE_RESET(); - __HAL_RCC_UART7_CLK_ENABLE(); - } + __HAL_RCC_UART7_CLK_ENABLE(); + } #endif #ifdef UART8 if (mask & (1 << 7)) { __HAL_RCC_UART8_FORCE_RESET(); __HAL_RCC_UART8_RELEASE_RESET(); - __HAL_RCC_UART8_CLK_ENABLE(); - } + __HAL_RCC_UART8_CLK_ENABLE(); + } #endif #ifdef UART9 if (mask & (1 << 8)) { __HAL_RCC_UART9_FORCE_RESET(); __HAL_RCC_UART9_RELEASE_RESET(); - __HAL_RCC_UART9_CLK_ENABLE(); - } + __HAL_RCC_UART9_CLK_ENABLE(); + } #endif #ifdef UART10 if (mask & (1 << 9)) { __HAL_RCC_UART10_FORCE_RESET(); __HAL_RCC_UART10_RELEASE_RESET(); - __HAL_RCC_UART10_CLK_ENABLE(); - } + __HAL_RCC_UART10_CLK_ENABLE(); + } #endif } @@ -487,71 +497,71 @@ STATIC void uart_clock_disable(uint16_t mask) { if (mask & (1 << 0)) { __HAL_RCC_USART1_FORCE_RESET(); __HAL_RCC_USART1_RELEASE_RESET(); - __HAL_RCC_USART1_CLK_DISABLE(); + __HAL_RCC_USART1_CLK_DISABLE(); } #endif #ifdef USART2 if (mask & (1 << 1)) { __HAL_RCC_USART2_FORCE_RESET(); __HAL_RCC_USART2_RELEASE_RESET(); - __HAL_RCC_USART2_CLK_DISABLE(); + __HAL_RCC_USART2_CLK_DISABLE(); } #endif #ifdef USART3 if (mask & (1 << 2)) { __HAL_RCC_USART3_FORCE_RESET(); __HAL_RCC_USART3_RELEASE_RESET(); - __HAL_RCC_USART3_CLK_DISABLE(); + __HAL_RCC_USART3_CLK_DISABLE(); } #endif #ifdef UART4 if (mask & (1 << 3)) { __HAL_RCC_UART4_FORCE_RESET(); __HAL_RCC_UART4_RELEASE_RESET(); - __HAL_RCC_UART4_CLK_DISABLE(); + __HAL_RCC_UART4_CLK_DISABLE(); } #endif #ifdef UART5 if (mask & (1 << 4)) { __HAL_RCC_UART5_FORCE_RESET(); __HAL_RCC_UART5_RELEASE_RESET(); - __HAL_RCC_UART5_CLK_DISABLE(); + __HAL_RCC_UART5_CLK_DISABLE(); } #endif #ifdef USART6 if (mask & (1 << 5)) { __HAL_RCC_USART6_FORCE_RESET(); __HAL_RCC_USART6_RELEASE_RESET(); - __HAL_RCC_USART6_CLK_DISABLE(); - } + __HAL_RCC_USART6_CLK_DISABLE(); + } #endif #ifdef UART7 if (mask & (1 << 6)) { __HAL_RCC_UART7_FORCE_RESET(); __HAL_RCC_UART7_RELEASE_RESET(); - __HAL_RCC_UART7_CLK_DISABLE(); - } + __HAL_RCC_UART7_CLK_DISABLE(); + } #endif #ifdef UART8 if (mask & (1 << 7)) { __HAL_RCC_UART8_FORCE_RESET(); __HAL_RCC_UART8_RELEASE_RESET(); - __HAL_RCC_UART8_CLK_DISABLE(); - } + __HAL_RCC_UART8_CLK_DISABLE(); + } #endif #ifdef UART9 if (mask & (1 << 8)) { __HAL_RCC_UART9_FORCE_RESET(); __HAL_RCC_UART9_RELEASE_RESET(); - __HAL_RCC_UART9_CLK_DISABLE(); - } + __HAL_RCC_UART9_CLK_DISABLE(); + } #endif #ifdef UART10 if (mask & (1 << 9)) { __HAL_RCC_UART10_FORCE_RESET(); __HAL_RCC_UART10_RELEASE_RESET(); - __HAL_RCC_UART10_CLK_DISABLE(); - } + __HAL_RCC_UART10_CLK_DISABLE(); + } #endif } diff --git a/shared-bindings/board/__init__.c b/shared-bindings/board/__init__.c index 47e2d64bc8..3dda59fb8e 100644 --- a/shared-bindings/board/__init__.c +++ b/shared-bindings/board/__init__.c @@ -93,6 +93,12 @@ MP_DEFINE_CONST_FUN_OBJ_0(board_spi_obj, board_spi); //| //| Returns the `busio.UART` object for the board designated TX and RX pins. It is a singleton. //| +//| The object created uses the default parameter values for `busio.UART`. If you need to set +//| parameters that are not changeable after creation, such as ``receiver_buffer_size``, +//| do not use `board.UART()`; instead create a `busio.UART` object explicitly with the +//| desired parameters. +//| +//| #if BOARD_UART mp_obj_t board_uart(void) { mp_obj_t singleton = common_hal_board_get_uart(); diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index c7eef8c438..9606c77e9e 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -57,7 +57,7 @@ //| :param int bits: the number of bits per byte, 7, 8 or 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. Raises ``ValueError`` if timeout >100 seconds. +//| :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. //| :param int receiver_buffer_size: the character length of the read buffer (0 to disable). (When a character is 9 bits the buffer will be 2 * receiver_buffer_size bytes.) //| //| *New in CircuitPython 4.0:* ``timeout`` has incompatibly changed units from milliseconds to seconds. @@ -69,6 +69,12 @@ typedef struct { extern const busio_uart_parity_obj_t busio_uart_parity_even_obj; extern const busio_uart_parity_obj_t busio_uart_parity_odd_obj; +STATIC void validate_timeout(mp_float_t timeout) { + if (timeout < (mp_float_t) 0.0f || timeout > (mp_float_t) 100.0f) { + mp_raise_ValueError(translate("timeout must be 0.0-100.0 (units are now seconds, not msecs)")); + } +} + STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { // Always initially allocate the UART object within the long-lived heap. // This is needed to avoid crashes with certain UART implementations which @@ -116,9 +122,7 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co } mp_float_t timeout = mp_obj_get_float(args[ARG_timeout].u_obj); - if (timeout > (mp_float_t)100.0) { - mp_raise_ValueError(translate("timeout >100 (units are now seconds, not msecs)")); - } + validate_timeout(timeout); common_hal_busio_uart_construct(self, tx, rx, args[ARG_baudrate].u_int, bits, parity, stop, timeout, @@ -286,6 +290,35 @@ const mp_obj_property_t busio_uart_in_waiting_obj = { (mp_obj_t)&mp_const_none_obj}, }; +//| .. attribute:: timeout +//| +//| The current timeout, in seconds (float). +//| +STATIC mp_obj_t busio_uart_obj_get_timeout(mp_obj_t self_in) { + busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_float(common_hal_busio_uart_get_timeout(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(busio_uart_get_timeout_obj, busio_uart_obj_get_timeout); + +STATIC mp_obj_t busio_uart_obj_set_timeout(mp_obj_t self_in, mp_obj_t timeout) { + busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + mp_float_t timeout_float = mp_obj_get_float(timeout); + validate_timeout(timeout_float); + common_hal_busio_uart_set_timeout(self, timeout_float); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(busio_uart_set_timeout_obj, busio_uart_obj_set_timeout); + + +const mp_obj_property_t busio_uart_timeout_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&busio_uart_get_timeout_obj, + (mp_obj_t)&busio_uart_set_timeout_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + //| .. method:: reset_input_buffer() //| //| Discard any unread characters in the input buffer. @@ -355,8 +388,9 @@ STATIC const mp_rom_map_elem_t busio_uart_locals_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_reset_input_buffer), MP_ROM_PTR(&busio_uart_reset_input_buffer_obj) }, // Properties - { MP_ROM_QSTR(MP_QSTR_baudrate), MP_ROM_PTR(&busio_uart_baudrate_obj) }, - { MP_ROM_QSTR(MP_QSTR_in_waiting), MP_ROM_PTR(&busio_uart_in_waiting_obj) }, + { MP_ROM_QSTR(MP_QSTR_baudrate), MP_ROM_PTR(&busio_uart_baudrate_obj) }, + { MP_ROM_QSTR(MP_QSTR_in_waiting), MP_ROM_PTR(&busio_uart_in_waiting_obj) }, + { MP_ROM_QSTR(MP_QSTR_timeout), MP_ROM_PTR(&busio_uart_timeout_obj) }, // Nested Enum-like Classes. { MP_ROM_QSTR(MP_QSTR_Parity), MP_ROM_PTR(&busio_uart_parity_type) }, diff --git a/shared-bindings/busio/UART.h b/shared-bindings/busio/UART.h index 776a996be8..cfd2c800c3 100644 --- a/shared-bindings/busio/UART.h +++ b/shared-bindings/busio/UART.h @@ -57,7 +57,8 @@ extern size_t common_hal_busio_uart_write(busio_uart_obj_t *self, extern uint32_t common_hal_busio_uart_get_baudrate(busio_uart_obj_t *self); extern void common_hal_busio_uart_set_baudrate(busio_uart_obj_t *self, uint32_t baudrate); - +extern mp_float_t common_hal_busio_uart_get_timeout(busio_uart_obj_t *self); +extern void common_hal_busio_uart_set_timeout(busio_uart_obj_t *self, mp_float_t timeout); extern uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self); extern void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self); diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c index dd07d7190c..914bc43137 100644 --- a/shared-module/board/__init__.c +++ b/shared-module/board/__init__.c @@ -101,7 +101,7 @@ mp_obj_t common_hal_board_create_uart(void) { const mcu_pin_obj_t* rx = MP_OBJ_TO_PTR(DEFAULT_UART_BUS_RX); const mcu_pin_obj_t* tx = MP_OBJ_TO_PTR(DEFAULT_UART_BUS_TX); - common_hal_busio_uart_construct(self, tx, rx, 9600, 8, PARITY_NONE, 1, 1000, 64); + common_hal_busio_uart_construct(self, tx, rx, 9600, 8, PARITY_NONE, 1, 1.0f, 64); MP_STATE_VM(shared_uart_bus) = MP_OBJ_FROM_PTR(self); return MP_STATE_VM(shared_uart_bus); } From 778a7a73e55b906cca170f9bfc961b87c18b4455 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 27 Nov 2019 13:13:29 -0500 Subject: [PATCH 124/189] make translate --- locale/ID.po | 20 ++++++++------------ locale/circuitpython.pot | 8 ++------ locale/de_DE.po | 19 ++----------------- locale/en_US.po | 8 ++------ locale/en_x_pirate.po | 8 ++------ locale/es.po | 26 ++++++++++---------------- locale/fil.po | 28 +++++++++++++++------------- locale/fr.po | 31 +++++++++++++++---------------- locale/it_IT.po | 25 +++++++++++-------------- locale/ko.po | 8 ++------ locale/pl.po | 25 +++++++++---------------- locale/pt_BR.po | 20 ++++++++------------ locale/zh_Latn_pinyin.po | 28 +++++++++------------------- 13 files changed, 95 insertions(+), 159 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index fdbf3863bb..55dd77d54c 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-21 16:50-0800\n" +"POT-Creation-Date: 2019-11-27 13:13-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2454,12 +2454,8 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes exactly 1 argument" -msgstr "" - #: shared-bindings/busio/UART.c -msgid "timeout >100 (units are now seconds, not msecs)" +msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -2734,7 +2730,7 @@ msgstr "" #~ msgid "Failed to notify or indicate attribute value, err %0x04x" #~ msgstr "Gagal untuk melaporkan nilai atribut, status: 0x%08lX" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to read CCCD value, err 0x%04x" #~ msgstr "Gagal untuk membaca nilai atribut, status: 0x%08lX" @@ -2742,11 +2738,11 @@ msgstr "" #~ msgid "Failed to read attribute value, err %0x04x" #~ msgstr "Gagal untuk membaca nilai atribut, status: 0x%08lX" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to read gatts value, err 0x%04x" #~ msgstr "Gagal untuk menulis nilai gatts, status: 0x%08lX" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to register Vendor-Specific UUID, err 0x%04x" #~ msgstr "Gagal untuk menambahkan Vendor Spesific UUID, status: 0x%08lX" @@ -2766,7 +2762,7 @@ msgstr "" #~ msgid "Failed to start scanning" #~ msgstr "Gagal untuk melakukan scanning, status: 0x%08lX" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to start scanning, err 0x%04x" #~ msgstr "Gagal untuk melakukan scanning, status: 0x%08lX" @@ -2778,11 +2774,11 @@ msgstr "" #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Gagal untuk memberhentikan advertisement, status: 0x%08lX" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to write attribute value, err 0x%04x" #~ msgstr "Gagal untuk menulis nilai atribut, status: 0x%08lX" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to write gatts value, err 0x%04x" #~ msgstr "Gagal untuk menulis nilai gatts, status: 0x%08lX" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 24278f33c1..0fbb0d5cb9 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-21 16:50-0800\n" +"POT-Creation-Date: 2019-11-27 13:13-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2423,12 +2423,8 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes exactly 1 argument" -msgstr "" - #: shared-bindings/busio/UART.c -msgid "timeout >100 (units are now seconds, not msecs)" +msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c diff --git a/locale/de_DE.po b/locale/de_DE.po index ff4edd3705..6f0e57978a 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-21 16:50-0800\n" +"POT-Creation-Date: 2019-11-27 13:13-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -2484,12 +2484,8 @@ msgstr "threshold muss im Intervall 0-65536 liegen" msgid "time.struct_time() takes a 9-sequence" msgstr "" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes exactly 1 argument" -msgstr "" - #: shared-bindings/busio/UART.c -msgid "timeout >100 (units are now seconds, not msecs)" +msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -2720,7 +2716,6 @@ msgstr "" #~ msgid "Characteristic already in use by another Service." #~ msgstr "Characteristic wird bereits von einem anderen Dienst verwendet." -#, c-format #~ msgid "Could not decode ble_uuid, err 0x%04x" #~ msgstr "Konnte ble_uuid nicht decodieren. Status: 0x%04x" @@ -2749,7 +2744,6 @@ msgstr "" #~ msgid "Failed to add characteristic, err 0x%04x" #~ msgstr "Hinzufügen des Characteristic ist gescheitert. Status: 0x%04x" -#, c-format #~ msgid "Failed to add descriptor, err 0x%04x" #~ msgstr "Deskriptor konnte nicht hinzugefügt werden. Status: 0x%04x" @@ -2789,22 +2783,18 @@ msgstr "" #~ msgid "Failed to pair" #~ msgstr "Koppeln fehlgeschlagen" -#, c-format #~ msgid "Failed to read CCCD value, err 0x%04x" #~ msgstr "Kann CCCD value nicht lesen. Status: 0x%04x" #~ msgid "Failed to read attribute value, err %0x04x" #~ msgstr "Kann den Attributwert nicht lesen. Status: 0x%04x" -#, c-format #~ msgid "Failed to read attribute value, err 0x%04x" #~ msgstr "Kann Attributwert nicht lesen, Status: 0x%04x" -#, c-format #~ msgid "Failed to read gatts value, err 0x%04x" #~ msgstr "gatts value konnte nicht gelesen werden. Status: 0x%04x" -#, c-format #~ msgid "Failed to register Vendor-Specific UUID, err 0x%04x" #~ msgstr "Kann keine herstellerspezifische UUID hinzufügen. Status: 0x%04x" @@ -2820,7 +2810,6 @@ msgstr "" #~ msgid "Failed to start advertising, err 0x%04x" #~ msgstr "Kann advertisement nicht starten. Status: 0x%04x" -#, c-format #~ msgid "Failed to start connecting, error 0x%04x" #~ msgstr "Verbindung konnte nicht hergestellt werden. Status: 0x%04x" @@ -2830,7 +2819,6 @@ msgstr "" #~ msgid "Failed to start scanning" #~ msgstr "Der Scanvorgang kann nicht gestartet werden" -#, c-format #~ msgid "Failed to start scanning, err 0x%04x" #~ msgstr "Der Scanvorgang kann nicht gestartet werden. Status: 0x%04x" @@ -2840,15 +2828,12 @@ msgstr "" #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Kann advertisement nicht stoppen. Status: 0x%04x" -#, c-format #~ msgid "Failed to write CCCD, err 0x%04x" #~ msgstr "Konnte CCCD nicht schreiben, Status: 0x%04x" -#, c-format #~ msgid "Failed to write attribute value, err 0x%04x" #~ msgstr "Kann den Attributwert nicht schreiben. Status: 0x%04x" -#, c-format #~ msgid "Failed to write gatts value, err 0x%04x" #~ msgstr "gatts value konnte nicht geschrieben werden. Status: 0x%04x" diff --git a/locale/en_US.po b/locale/en_US.po index b8025aa98e..4f07b2aa4c 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-21 16:50-0800\n" +"POT-Creation-Date: 2019-11-27 13:13-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -2423,12 +2423,8 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes exactly 1 argument" -msgstr "" - #: shared-bindings/busio/UART.c -msgid "timeout >100 (units are now seconds, not msecs)" +msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index a307167aad..1593d935ea 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-21 16:50-0800\n" +"POT-Creation-Date: 2019-11-27 13:13-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -2427,12 +2427,8 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes exactly 1 argument" -msgstr "" - #: shared-bindings/busio/UART.c -msgid "timeout >100 (units are now seconds, not msecs)" +msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c diff --git a/locale/es.po b/locale/es.po index 07ad7fe1b3..e71527cb27 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-21 16:50-0800\n" +"POT-Creation-Date: 2019-11-27 13:13-0500\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -2487,13 +2487,9 @@ msgstr "limite debe ser en el rango 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() toma un sequencio 9" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes exactly 1 argument" -msgstr "time.struct_time() acepta exactamente 1 argumento" - #: shared-bindings/busio/UART.c -msgid "timeout >100 (units are now seconds, not msecs)" -msgstr "timepo muerto >100 (unidades en segundos)" +msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" +msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "timeout must be >= 0.0" @@ -2718,7 +2714,6 @@ msgstr "paso cero" #~ msgid "Characteristic already in use by another Service." #~ msgstr "Características ya esta en uso por otro Serivice" -#, c-format #~ msgid "Could not decode ble_uuid, err 0x%04x" #~ msgstr "No se puede descodificar ble_uuid, err 0x%04x" @@ -2785,11 +2780,9 @@ msgstr "paso cero" #~ msgid "Failed to notify or indicate attribute value, err %0x04x" #~ msgstr "No se puede notificar el valor del anuncio. status: 0x%02x" -#, c-format #~ msgid "Failed to notify or indicate attribute value, err 0x%04x" #~ msgstr "Error al notificar o indicar el valor del atributo, err 0x%04x" -#, c-format #~ msgid "Failed to read CCCD value, err 0x%04x" #~ msgstr "No se puede leer el valor del atributo. err 0x%02x" @@ -2797,15 +2790,13 @@ msgstr "paso cero" #~ msgid "Failed to read attribute value, err %0x04x" #~ msgstr "No se puede leer el valor del atributo. status 0x%02x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to read attribute value, err 0x%04x" #~ msgstr "Error al leer valor del atributo, err 0x%04" -#, c-format #~ msgid "Failed to read gatts value, err 0x%04x" #~ msgstr "No se puede escribir el valor del atributo. status: 0x%02x" -#, c-format #~ msgid "Failed to register Vendor-Specific UUID, err 0x%04x" #~ msgstr "Fallo al registrar el Vendor-Specific UUID, err 0x%04x" @@ -2824,7 +2815,6 @@ msgstr "paso cero" #~ msgid "Failed to start scanning" #~ msgstr "No se puede iniciar el escaneo. status: 0x%02x" -#, c-format #~ msgid "Failed to start scanning, err 0x%04x" #~ msgstr "No se puede iniciar el escaneo. err 0x%04x" @@ -2835,11 +2825,9 @@ msgstr "paso cero" #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "No se puede detener el anuncio. err: 0x%04x" -#, c-format #~ msgid "Failed to write attribute value, err 0x%04x" #~ msgstr "No se puede escribir el valor del atributo. err: 0x%04x" -#, c-format #~ msgid "Failed to write gatts value, err 0x%04x" #~ msgstr "No se puede escribir el valor del atributo. err: 0x%04x" @@ -3039,6 +3027,12 @@ msgstr "paso cero" #~ msgid "tile index out of bounds" #~ msgstr "el indice del tile fuera de limite" +#~ msgid "time.struct_time() takes exactly 1 argument" +#~ msgstr "time.struct_time() acepta exactamente 1 argumento" + +#~ msgid "timeout >100 (units are now seconds, not msecs)" +#~ msgstr "timepo muerto >100 (unidades en segundos)" + #~ msgid "too many arguments" #~ msgstr "muchos argumentos" diff --git a/locale/fil.po b/locale/fil.po index 8cf49583ac..90d2bc54bb 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-21 16:50-0800\n" +"POT-Creation-Date: 2019-11-27 13:13-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -2495,13 +2495,9 @@ msgstr "ang threshold ay dapat sa range 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() kumukuha ng 9-sequence" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes exactly 1 argument" -msgstr "time.struct_time() kumukuha ng 1 argument" - #: shared-bindings/busio/UART.c -msgid "timeout >100 (units are now seconds, not msecs)" -msgstr "timeout >100 (units ay seconds, hindi na msecs)" +msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" +msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c #, fuzzy @@ -2789,7 +2785,7 @@ msgstr "zero step" #~ msgid "Failed to notify or indicate attribute value, err %0x04x" #~ msgstr "Hindi mabalitaan ang attribute value, status: 0x%08lX" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to read CCCD value, err 0x%04x" #~ msgstr "Hindi mabasa ang value ng attribute, status: 0x%08lX" @@ -2797,11 +2793,11 @@ msgstr "zero step" #~ msgid "Failed to read attribute value, err %0x04x" #~ msgstr "Hindi mabasa ang value ng attribute, status: 0x%08lX" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to read gatts value, err 0x%04x" #~ msgstr "Hindi maisulat ang gatts value, status: 0x%08lX" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to register Vendor-Specific UUID, err 0x%04x" #~ msgstr "" #~ "Hindi matagumpay ang paglagay ng Vender Specific UUID, status: 0x%08lX" @@ -2822,7 +2818,7 @@ msgstr "zero step" #~ msgid "Failed to start scanning" #~ msgstr "Hindi masimulaan mag i-scan, status: 0x%0xlX" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to start scanning, err 0x%04x" #~ msgstr "Hindi masimulaan mag i-scan, status: 0x%0xlX" @@ -2834,11 +2830,11 @@ msgstr "zero step" #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Hindi mahinto ang advertisement, status: 0x%08lX" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to write attribute value, err 0x%04x" #~ msgstr "Hindi maisulat ang attribute value, status: 0x%08lX" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to write gatts value, err 0x%04x" #~ msgstr "Hindi maisulat ang gatts value, status: 0x%08lX" @@ -3006,6 +3002,12 @@ msgstr "zero step" #~ msgid "scan failed" #~ msgstr "nabigo ang pag-scan" +#~ msgid "time.struct_time() takes exactly 1 argument" +#~ msgstr "time.struct_time() kumukuha ng 1 argument" + +#~ msgid "timeout >100 (units are now seconds, not msecs)" +#~ msgstr "timeout >100 (units ay seconds, hindi na msecs)" + #~ msgid "too many arguments" #~ msgstr "masyadong maraming argumento" diff --git a/locale/fr.po b/locale/fr.po index 3a3f81653c..c6987c1615 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-21 16:50-0800\n" +"POT-Creation-Date: 2019-11-27 13:13-0500\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -2535,13 +2535,9 @@ msgstr "le seuil doit être dans la gamme 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() prend une séquence de longueur 9" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes exactly 1 argument" -msgstr "time.struct_time() prend exactement 1 argument" - #: shared-bindings/busio/UART.c -msgid "timeout >100 (units are now seconds, not msecs)" -msgstr "timeout >100 (exprimé en secondes, pas en ms)" +msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" +msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c #, fuzzy @@ -2769,7 +2765,6 @@ msgstr "'step' nul" #~ msgid "Characteristic already in use by another Service." #~ msgstr "'Characteristic' déjà en utilisation par un autre service" -#, c-format #~ msgid "Could not decode ble_uuid, err 0x%04x" #~ msgstr "Impossible de décoder le 'ble_uuid', err 0x%04x" @@ -2840,12 +2835,11 @@ msgstr "'step' nul" #~ msgid "Failed to notify or indicate attribute value, err %0x04x" #~ msgstr "Impossible de notifier la valeur de l'attribut. status: 0x%08lX" -#, c-format #~ msgid "Failed to notify or indicate attribute value, err 0x%04x" #~ msgstr "" #~ "Impossible de notifier ou d'indiquer la valeur de l'attribut, err 0x%04x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to read CCCD value, err 0x%04x" #~ msgstr "Impossible de lire la valeur 'CCCD', err 0x%04x" @@ -2853,15 +2847,14 @@ msgstr "'step' nul" #~ msgid "Failed to read attribute value, err %0x04x" #~ msgstr "Impossible de lire la valeur de l'attribut. status: 0x%08lX" -#, c-format #~ msgid "Failed to read attribute value, err 0x%04x" #~ msgstr "Impossible de lire la valeur de l'attribut, err 0x%04x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to read gatts value, err 0x%04x" #~ msgstr "Impossible de lire la valeur de 'gatts', err 0x%04x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to register Vendor-Specific UUID, err 0x%04x" #~ msgstr "Echec de l'ajout de l'UUID du fournisseur, err 0x%04x" @@ -2881,7 +2874,7 @@ msgstr "'step' nul" #~ msgid "Failed to start scanning" #~ msgstr "Impossible de commencer à scanner" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to start scanning, err 0x%04x" #~ msgstr "Impossible de commencer à scanner, err 0x%04x" @@ -2893,11 +2886,11 @@ msgstr "'step' nul" #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Echec de l'arrêt de diffusion, err 0x%04x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to write attribute value, err 0x%04x" #~ msgstr "Impossible d'écrire la valeur de l'attribut, err 0x%04x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to write gatts value, err 0x%04x" #~ msgstr "Impossible d'écrire la valeur de 'gatts', err 0x%04x" @@ -3091,6 +3084,12 @@ msgstr "'step' nul" #~ msgid "tile index out of bounds" #~ msgstr "indice de tuile hors limites" +#~ msgid "time.struct_time() takes exactly 1 argument" +#~ msgstr "time.struct_time() prend exactement 1 argument" + +#~ msgid "timeout >100 (units are now seconds, not msecs)" +#~ msgstr "timeout >100 (exprimé en secondes, pas en ms)" + #~ msgid "too many arguments" #~ msgstr "trop d'arguments" diff --git a/locale/it_IT.po b/locale/it_IT.po index 30d843142c..9c72bd6071 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-21 16:50-0800\n" +"POT-Creation-Date: 2019-11-27 13:13-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -2494,12 +2494,8 @@ msgstr "la soglia deve essere nell'intervallo 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes exactly 1 argument" -msgstr "time.struct_time() prende esattamente un argomento" - #: shared-bindings/busio/UART.c -msgid "timeout >100 (units are now seconds, not msecs)" +msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -2790,11 +2786,10 @@ msgstr "zero step" #~ msgid "Failed to notify or indicate attribute value, err %0x04x" #~ msgstr "Impossibile notificare valore dell'attributo. status: 0x%02x" -#, c-format #~ msgid "Failed to notify or indicate attribute value, err 0x%04x" #~ msgstr "Notificamento o indicazione di attribute value fallito, err 0x%04x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to read CCCD value, err 0x%04x" #~ msgstr "Impossibile leggere valore dell'attributo. status: 0x%02x" @@ -2802,15 +2797,14 @@ msgstr "zero step" #~ msgid "Failed to read attribute value, err %0x04x" #~ msgstr "Impossibile leggere valore dell'attributo. status: 0x%02x" -#, c-format #~ msgid "Failed to read attribute value, err 0x%04x" #~ msgstr "Tentative leggere attribute value fallito, err 0x%04x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to read gatts value, err 0x%04x" #~ msgstr "Impossibile scrivere valore dell'attributo. status: 0x%02x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to register Vendor-Specific UUID, err 0x%04x" #~ msgstr "Non è possibile aggiungere l'UUID del vendor specifico da 128-bit" @@ -2830,7 +2824,7 @@ msgstr "zero step" #~ msgid "Failed to start scanning" #~ msgstr "Impossible iniziare la scansione. status: 0x%02x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to start scanning, err 0x%04x" #~ msgstr "Impossible iniziare la scansione. status: 0x%02x" @@ -2842,11 +2836,11 @@ msgstr "zero step" #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Impossibile fermare advertisement. status: 0x%02x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to write attribute value, err 0x%04x" #~ msgstr "Impossibile scrivere valore dell'attributo. status: 0x%02x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to write gatts value, err 0x%04x" #~ msgstr "Impossibile scrivere valore dell'attributo. status: 0x%02x" @@ -3008,6 +3002,9 @@ msgstr "zero step" #~ msgid "scan failed" #~ msgstr "scansione fallita" +#~ msgid "time.struct_time() takes exactly 1 argument" +#~ msgstr "time.struct_time() prende esattamente un argomento" + #~ msgid "too many arguments" #~ msgstr "troppi argomenti" diff --git a/locale/ko.po b/locale/ko.po index 1452bd7e70..868bb640ad 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-21 16:50-0800\n" +"POT-Creation-Date: 2019-11-27 13:13-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -2428,12 +2428,8 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes exactly 1 argument" -msgstr "" - #: shared-bindings/busio/UART.c -msgid "timeout >100 (units are now seconds, not msecs)" +msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c diff --git a/locale/pl.po b/locale/pl.po index ed57964325..857d7f7ab4 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-21 16:50-0800\n" +"POT-Creation-Date: 2019-11-27 13:13-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -2450,13 +2450,9 @@ msgstr "threshold musi być w zakresie 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() wymaga 9-elementowej sekwencji" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes exactly 1 argument" -msgstr "time.struct_time() wymaga jednego argumentu" - #: shared-bindings/busio/UART.c -msgid "timeout >100 (units are now seconds, not msecs)" -msgstr "timeout > 100 (jednostkami są sekundy)" +msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" +msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "timeout must be >= 0.0" @@ -2664,7 +2660,6 @@ msgstr "zerowy krok" #~ msgid "Characteristic already in use by another Service." #~ msgstr "Charakterystyka w użyciu w innym serwisie" -#, c-format #~ msgid "Could not decode ble_uuid, err 0x%04x" #~ msgstr "Nie można zdekodować ble_uuid, błąd 0x%04x" @@ -2708,23 +2703,18 @@ msgstr "zerowy krok" #~ msgid "Failed to get softdevice state" #~ msgstr "Nie udało się odczytać stanu softdevice" -#, c-format #~ msgid "Failed to notify or indicate attribute value, err 0x%04x" #~ msgstr "Nie udało się powiadomić o wartości atrybutu, błąd 0x%04x" -#, c-format #~ msgid "Failed to read CCCD value, err 0x%04x" #~ msgstr "Nie udało się odczytać CCCD, błąd 0x%04x" -#, c-format #~ msgid "Failed to read attribute value, err 0x%04x" #~ msgstr "Nie udało się odczytać wartości atrybutu, błąd 0x%04x" -#, c-format #~ msgid "Failed to read gatts value, err 0x%04x" #~ msgstr "Nie udało się odczytać gatts, błąd 0x%04x" -#, c-format #~ msgid "Failed to register Vendor-Specific UUID, err 0x%04x" #~ msgstr "Nie udało się zarejestrować UUID dostawcy, błąd 0x%04x" @@ -2740,7 +2730,6 @@ msgstr "zerowy krok" #~ msgid "Failed to start scanning" #~ msgstr "Nie udało się rozpocząć skanowania" -#, c-format #~ msgid "Failed to start scanning, err 0x%04x" #~ msgstr "Nie udało się rozpocząć skanowania, błąd 0x%04x" @@ -2750,11 +2739,9 @@ msgstr "zerowy krok" #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Nie udało się zatrzymać rozgłaszania, błąd 0x%04x" -#, c-format #~ msgid "Failed to write attribute value, err 0x%04x" #~ msgstr "Nie udało się zapisać atrybutu, błąd 0x%04x" -#, c-format #~ msgid "Failed to write gatts value, err 0x%04x" #~ msgstr "Nie udało się zapisać gatts, błąd 0x%04x" @@ -2805,3 +2792,9 @@ msgstr "zerowy krok" #~ msgid "tile index out of bounds" #~ msgstr "indeks kafelka poza zakresem" + +#~ msgid "time.struct_time() takes exactly 1 argument" +#~ msgstr "time.struct_time() wymaga jednego argumentu" + +#~ msgid "timeout >100 (units are now seconds, not msecs)" +#~ msgstr "timeout > 100 (jednostkami są sekundy)" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 715a8345d6..24dd56637e 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-21 16:50-0800\n" +"POT-Creation-Date: 2019-11-27 13:13-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -2447,12 +2447,8 @@ msgstr "Limite deve estar no alcance de 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes exactly 1 argument" -msgstr "" - #: shared-bindings/busio/UART.c -msgid "timeout >100 (units are now seconds, not msecs)" +msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -2712,7 +2708,7 @@ msgstr "passo zero" #~ msgid "Failed to notify or indicate attribute value, err %0x04x" #~ msgstr "Não é possível gravar o valor do atributo. status: 0x%02x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to read CCCD value, err 0x%04x" #~ msgstr "Não é possível ler o valor do atributo. status: 0x%02x" @@ -2720,11 +2716,11 @@ msgstr "passo zero" #~ msgid "Failed to read attribute value, err %0x04x" #~ msgstr "Não é possível ler o valor do atributo. status: 0x%02x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to read gatts value, err 0x%04x" #~ msgstr "Não é possível gravar o valor do atributo. status: 0x%02x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to register Vendor-Specific UUID, err 0x%04x" #~ msgstr "" #~ "Não é possível adicionar o UUID de 128 bits específico do fornecedor." @@ -2745,7 +2741,7 @@ msgstr "passo zero" #~ msgid "Failed to start scanning" #~ msgstr "Não é possível iniciar o anúncio. status: 0x%02x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to start scanning, err 0x%04x" #~ msgstr "Não é possível iniciar o anúncio. status: 0x%02x" @@ -2757,11 +2753,11 @@ msgstr "passo zero" #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Não pode parar propaganda. status: 0x%02x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to write attribute value, err 0x%04x" #~ msgstr "Não é possível gravar o valor do atributo. status: 0x%02x" -#, fuzzy, c-format +#, fuzzy #~ msgid "Failed to write gatts value, err 0x%04x" #~ msgstr "Não é possível gravar o valor do atributo. status: 0x%02x" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index fae8b1b329..a7d66bbcd5 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-21 16:50-0800\n" +"POT-Creation-Date: 2019-11-27 13:13-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -2463,13 +2463,9 @@ msgstr "yùzhí bìxū zài fànwéi 0-65536" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() xūyào 9 xùliè" -#: shared-bindings/time/__init__.c -msgid "time.struct_time() takes exactly 1 argument" -msgstr "time.struct_time() xūyào wánquán 1 cānshù" - #: shared-bindings/busio/UART.c -msgid "timeout >100 (units are now seconds, not msecs)" -msgstr "chāoshí >100 (dānwèi shì miǎo, ér bùshì háomiǎo)" +msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" +msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "timeout must be >= 0.0" @@ -2680,7 +2676,6 @@ msgstr "líng bù" #~ msgid "Characteristic already in use by another Service." #~ msgstr "Qítā fúwù bùmén yǐ shǐyòng de gōngnéng." -#, c-format #~ msgid "Could not decode ble_uuid, err 0x%04x" #~ msgstr "Wúfǎ jiěmǎ kě dú_uuid, err 0x%04x" @@ -2696,7 +2691,6 @@ msgstr "líng bù" #~ msgid "Failed to add characteristic, err 0x%04x" #~ msgstr "Tiānjiā tèxìng shībài, err 0x%04x" -#, c-format #~ msgid "Failed to add descriptor, err 0x%04x" #~ msgstr "Wúfǎ tiānjiā miáoshù fú, err 0x%04x" @@ -2733,26 +2727,21 @@ msgstr "líng bù" #~ msgid "Failed to get softdevice state" #~ msgstr "Wúfǎ huòdé ruǎnjiàn shèbèi zhuàngtài" -#, c-format #~ msgid "Failed to notify or indicate attribute value, err 0x%04x" #~ msgstr "Wúfǎ tōngzhī huò xiǎnshì shǔxìng zhí, err 0x%04x" #~ msgid "Failed to pair" #~ msgstr "Pèiduì shībài" -#, c-format #~ msgid "Failed to read CCCD value, err 0x%04x" #~ msgstr "Dòu qǔ CCCD zhí, err 0x%04x shībài" -#, c-format #~ msgid "Failed to read attribute value, err 0x%04x" #~ msgstr "Dòu qǔ shǔxìng zhí shībài, err 0x%04x" -#, c-format #~ msgid "Failed to read gatts value, err 0x%04x" #~ msgstr "Wúfǎ dòu qǔ gatts zhí, err 0x%04x" -#, c-format #~ msgid "Failed to register Vendor-Specific UUID, err 0x%04x" #~ msgstr "Wúfǎ zhùcè màizhǔ tèdìng de UUID, err 0x%04x" @@ -2768,7 +2757,6 @@ msgstr "líng bù" #~ msgid "Failed to start advertising, err 0x%04x" #~ msgstr "Qǐdòng guǎnggào shībài, err 0x%04x" -#, c-format #~ msgid "Failed to start connecting, error 0x%04x" #~ msgstr "Wúfǎ kāishǐ liánjiē, cuòwù 0x%04x" @@ -2778,7 +2766,6 @@ msgstr "líng bù" #~ msgid "Failed to start scanning" #~ msgstr "Qǐdòng sǎomiáo shībài" -#, c-format #~ msgid "Failed to start scanning, err 0x%04x" #~ msgstr "Qǐdòng sǎomiáo shībài, err 0x%04x" @@ -2788,15 +2775,12 @@ msgstr "líng bù" #~ msgid "Failed to stop advertising, err 0x%04x" #~ msgstr "Wúfǎ tíngzhǐ guǎnggào, err 0x%04x" -#, c-format #~ msgid "Failed to write CCCD, err 0x%04x" #~ msgstr "Wúfǎ xiě rù CCCD, cuòwù 0x%04x" -#, c-format #~ msgid "Failed to write attribute value, err 0x%04x" #~ msgstr "Xiě rù shǔxìng zhí shībài, err 0x%04x" -#, c-format #~ msgid "Failed to write gatts value, err 0x%04x" #~ msgstr "Xiě rù gatts zhí,err 0x%04x shībài" @@ -2866,6 +2850,12 @@ msgstr "líng bù" #~ msgid "tile index out of bounds" #~ msgstr "kuài suǒyǐn chāochū fànwéi" +#~ msgid "time.struct_time() takes exactly 1 argument" +#~ msgstr "time.struct_time() xūyào wánquán 1 cānshù" + +#~ msgid "timeout >100 (units are now seconds, not msecs)" +#~ msgstr "chāoshí >100 (dānwèi shì miǎo, ér bùshì háomiǎo)" + #~ msgid "too many arguments" #~ msgstr "tài duō cānshù" From dd6dfeb30a4e688339612d509fb491bc2e72d078 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 27 Nov 2019 14:47:35 -0500 Subject: [PATCH 125/189] Squeeze pyruler zh_Latn_pinyin --- ports/atmel-samd/boards/pyruler/mpconfigboard.mk | 4 ++++ ports/cxd56/common-hal/busio/UART.c | 2 +- shared-bindings/busio/UART.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk index 9663944a38..9d9e4ba349 100644 --- a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk @@ -12,3 +12,7 @@ LONGINT_IMPL = NONE CIRCUITPY_SMALL_BUILD = 1 SUPEROPT_GC = 0 + +ifeq ($(TRANSLATION), zh_Latn_pinyin) +CFLAGS_INLINE_LIMIT = 35 +endif diff --git a/ports/cxd56/common-hal/busio/UART.c b/ports/cxd56/common-hal/busio/UART.c index 6ae2403c13..40ae3b7614 100644 --- a/ports/cxd56/common-hal/busio/UART.c +++ b/ports/cxd56/common-hal/busio/UART.c @@ -173,7 +173,7 @@ void common_hal_busio_uart_set_baudrate(busio_uart_obj_t *self, uint32_t baudrat } mp_float_t common_hal_busio_uart_get_timeout(busio_uart_obj_t *self) { - return (mp_float_t) (self->timeout / 1000000.0f); + return (mp_float_t) (self->timeout_us / 1000000.0f); } void common_hal_busio_uart_set_timeout(busio_uart_obj_t *self, mp_float_t timeout) { diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 9606c77e9e..4c0655e268 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -71,7 +71,7 @@ extern const busio_uart_parity_obj_t busio_uart_parity_odd_obj; STATIC void validate_timeout(mp_float_t timeout) { if (timeout < (mp_float_t) 0.0f || timeout > (mp_float_t) 100.0f) { - mp_raise_ValueError(translate("timeout must be 0.0-100.0 (units are now seconds, not msecs)")); + mp_raise_ValueError(translate("timeout must be 0.0-100.0")); } } From d089f16656f4b6de1f524c691d2135dd0fcbc37d Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 27 Nov 2019 14:49:39 -0500 Subject: [PATCH 126/189] 'seconds' --- shared-bindings/busio/UART.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 4c0655e268..7a3b48e895 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -71,7 +71,7 @@ extern const busio_uart_parity_obj_t busio_uart_parity_odd_obj; STATIC void validate_timeout(mp_float_t timeout) { if (timeout < (mp_float_t) 0.0f || timeout > (mp_float_t) 100.0f) { - mp_raise_ValueError(translate("timeout must be 0.0-100.0")); + mp_raise_ValueError(translate("timeout must be 0.0-100.0 seconds")); } } From ae52ec7c8591450b4953426f6bc21fe17d221531 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 27 Nov 2019 14:54:35 -0500 Subject: [PATCH 127/189] make translate again --- locale/ID.po | 4 ++-- locale/circuitpython.pot | 4 ++-- locale/de_DE.po | 4 ++-- locale/en_US.po | 4 ++-- locale/en_x_pirate.po | 4 ++-- locale/es.po | 4 ++-- locale/fil.po | 4 ++-- locale/fr.po | 4 ++-- locale/it_IT.po | 4 ++-- locale/ko.po | 4 ++-- locale/pl.po | 4 ++-- locale/pt_BR.po | 4 ++-- locale/zh_Latn_pinyin.po | 4 ++-- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 55dd77d54c..6a0b73b6f7 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 13:13-0500\n" +"POT-Creation-Date: 2019-11-27 14:54-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2455,7 +2455,7 @@ msgid "time.struct_time() takes a 9-sequence" msgstr "" #: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" +msgid "timeout must be 0.0-100.0 seconds" msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 0fbb0d5cb9..a24ab186a4 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 13:13-0500\n" +"POT-Creation-Date: 2019-11-27 14:54-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2424,7 +2424,7 @@ msgid "time.struct_time() takes a 9-sequence" msgstr "" #: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" +msgid "timeout must be 0.0-100.0 seconds" msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c diff --git a/locale/de_DE.po b/locale/de_DE.po index 6f0e57978a..37937b94f7 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 13:13-0500\n" +"POT-Creation-Date: 2019-11-27 14:54-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -2485,7 +2485,7 @@ msgid "time.struct_time() takes a 9-sequence" msgstr "" #: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" +msgid "timeout must be 0.0-100.0 seconds" msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c diff --git a/locale/en_US.po b/locale/en_US.po index 4f07b2aa4c..e0e63e4fd4 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 13:13-0500\n" +"POT-Creation-Date: 2019-11-27 14:54-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -2424,7 +2424,7 @@ msgid "time.struct_time() takes a 9-sequence" msgstr "" #: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" +msgid "timeout must be 0.0-100.0 seconds" msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index 1593d935ea..b22687469c 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 13:13-0500\n" +"POT-Creation-Date: 2019-11-27 14:54-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -2428,7 +2428,7 @@ msgid "time.struct_time() takes a 9-sequence" msgstr "" #: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" +msgid "timeout must be 0.0-100.0 seconds" msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c diff --git a/locale/es.po b/locale/es.po index e71527cb27..4e8df4195b 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 13:13-0500\n" +"POT-Creation-Date: 2019-11-27 14:54-0500\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -2488,7 +2488,7 @@ msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() toma un sequencio 9" #: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" +msgid "timeout must be 0.0-100.0 seconds" msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c diff --git a/locale/fil.po b/locale/fil.po index 90d2bc54bb..f3f2b7e3b0 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 13:13-0500\n" +"POT-Creation-Date: 2019-11-27 14:54-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -2496,7 +2496,7 @@ msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() kumukuha ng 9-sequence" #: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" +msgid "timeout must be 0.0-100.0 seconds" msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c diff --git a/locale/fr.po b/locale/fr.po index c6987c1615..098bd8d1fc 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 13:13-0500\n" +"POT-Creation-Date: 2019-11-27 14:54-0500\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -2536,7 +2536,7 @@ msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() prend une séquence de longueur 9" #: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" +msgid "timeout must be 0.0-100.0 seconds" msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c diff --git a/locale/it_IT.po b/locale/it_IT.po index 9c72bd6071..154dda932e 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 13:13-0500\n" +"POT-Creation-Date: 2019-11-27 14:54-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -2495,7 +2495,7 @@ msgid "time.struct_time() takes a 9-sequence" msgstr "" #: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" +msgid "timeout must be 0.0-100.0 seconds" msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c diff --git a/locale/ko.po b/locale/ko.po index 868bb640ad..5fc91553b2 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 13:13-0500\n" +"POT-Creation-Date: 2019-11-27 14:54-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -2429,7 +2429,7 @@ msgid "time.struct_time() takes a 9-sequence" msgstr "" #: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" +msgid "timeout must be 0.0-100.0 seconds" msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c diff --git a/locale/pl.po b/locale/pl.po index 857d7f7ab4..edfce95c62 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 13:13-0500\n" +"POT-Creation-Date: 2019-11-27 14:54-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -2451,7 +2451,7 @@ msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() wymaga 9-elementowej sekwencji" #: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" +msgid "timeout must be 0.0-100.0 seconds" msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 24dd56637e..a2b259fc46 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 13:13-0500\n" +"POT-Creation-Date: 2019-11-27 14:54-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -2448,7 +2448,7 @@ msgid "time.struct_time() takes a 9-sequence" msgstr "" #: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" +msgid "timeout must be 0.0-100.0 seconds" msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index a7d66bbcd5..b45650d87e 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 13:13-0500\n" +"POT-Creation-Date: 2019-11-27 14:54-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -2464,7 +2464,7 @@ msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() xūyào 9 xùliè" #: shared-bindings/busio/UART.c -msgid "timeout must be 0.0-100.0 (units are now seconds, not msecs)" +msgid "timeout must be 0.0-100.0 seconds" msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c From d843156a5e2018a8dd763dbcce325e62cca38cc2 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 29 Nov 2019 10:51:16 -0600 Subject: [PATCH 128/189] samd: Consolidate small build optimization flags .. inline-unit-growth was the same across all boards, and the highest max-inline-insns-auto parameter was shared across 2 of 5 boards, so it's worth a little work to follow the DRY principle --- ports/atmel-samd/Makefile | 4 ++++ ports/atmel-samd/boards/pewpew10/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/pyruler/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk | 2 -- ports/atmel-samd/boards/uchip/mpconfigboard.mk | 2 -- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index f26d1f53ec..5d47fd0871 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -125,6 +125,10 @@ else CFLAGS += -flto -flto-partition=none + ifeq ($(CIRCUITPY_SMALL_BUILD),1) + CFLAGS += --param inline-unit-growth=15 --param max-inline-insns-auto=20 + endif + ifdef CFLAGS_BOARD CFLAGS += $(CFLAGS_BOARD) endif diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk index f9094db913..8a1d6b16a4 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk @@ -24,4 +24,4 @@ SUPEROPT_GC = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/pew-pewpew-standalone-10.x -CFLAGS_BOARD = --param inline-unit-growth=15 --param max-inline-insns-auto=15 +CFLAGS_BOARD = --param max-inline-insns-auto=15 diff --git a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk index 18a1ad8686..12d6ace0c8 100644 --- a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk @@ -30,4 +30,4 @@ 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 inline-unit-growth=15 --param max-inline-insns-auto=12 +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 44537cea76..72893be8da 100644 --- a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk @@ -13,4 +13,4 @@ CIRCUITPY_SMALL_BUILD = 1 SUPEROPT_GC = 0 -CFLAGS_BOARD = --param inline-unit-growth=15 --param max-inline-insns-auto=15 +CFLAGS_BOARD = --param max-inline-insns-auto=15 diff --git a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk index 7cbfc36305..b4a00b654a 100644 --- a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk @@ -12,5 +12,3 @@ LONGINT_IMPL = NONE CIRCUITPY_SMALL_BUILD = 1 SUPEROPT_GC = 0 - -CFLAGS_BOARD = --param inline-unit-growth=15 --param max-inline-insns-auto=20 diff --git a/ports/atmel-samd/boards/uchip/mpconfigboard.mk b/ports/atmel-samd/boards/uchip/mpconfigboard.mk index 3967b76ee9..109492b764 100644 --- a/ports/atmel-samd/boards/uchip/mpconfigboard.mk +++ b/ports/atmel-samd/boards/uchip/mpconfigboard.mk @@ -10,5 +10,3 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_SMALL_BUILD = 1 - -CFLAGS_BOARD = --param inline-unit-growth=15 --param max-inline-insns-auto=20 From 5a49e58fb4191af58cef39035c7b69f2251b2924 Mon Sep 17 00:00:00 2001 From: hexthat Date: Sun, 1 Dec 2019 09:38:39 -0800 Subject: [PATCH 129/189] Update zh_Latn_pinyin.po Added Translations --- locale/zh_Latn_pinyin.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index b45650d87e..de78d35b5f 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -673,11 +673,11 @@ msgstr "Shūrù/shūchū cuòwù" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient authentication" -msgstr "" +msgstr "Rènzhèng bùzú" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient encryption" -msgstr "" +msgstr "Jiāmì bùzú" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2465,7 +2465,7 @@ msgstr "time.struct_time() xūyào 9 xùliè" #: shared-bindings/busio/UART.c msgid "timeout must be 0.0-100.0 seconds" -msgstr "" +msgstr "Chāo shí shíjiān bìxū wèi 0.0 Dào 100.0 Miǎo" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "timeout must be >= 0.0" From 002f5c0f1cb0f44a471dac0fafcc7850521a246f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 2 Dec 2019 08:25:48 -0600 Subject: [PATCH 130/189] samd: trinket_m0: make board fit again --- ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk index b4a00b654a..af8b561a21 100644 --- a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk @@ -12,3 +12,9 @@ LONGINT_IMPL = NONE CIRCUITPY_SMALL_BUILD = 1 SUPEROPT_GC = 0 + +CFLAGS_BOARD = --param max-inline-insns-auto=15 +ifeq ($(TRANSLATION), zh_Latn_pinyin) +CFLAGS_INLINE_LIMIT = 35 +endif + From e06a3bbceb548432969bfcfa1076dc4363478151 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 2 Dec 2019 08:41:03 -0600 Subject: [PATCH 131/189] translation: Compress as unicode, not bytes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By treating each unicode code-point as a single entity for huffman compression, the overall compression rate can be somewhat improved without changing the algorithm. On the decompression side, when compressed values above 127 are encountered, they need to be converted from a 16-bit Unicode code point into a UTF-8 byte sequence. Doing this returns approximately 1.5kB of flash storage with the zh_Latn_pinyin translation. (292 -> 1768 bytes remaining in my build of trinket_m0) Other "more ASCII" translations benefit less, and in fact zh_Latn_pinyin is no longer the most constrained translation! (de_DE 1156 -> 1384 bytes free in flash, I didn't check others before pushing for CI) English is slightly pessimized, 2840 -> 2788 bytes, probably mostly because the "values" array was changed from uint8_t to uint16_t, which is strictly not required for an all-ASCII translation. This could probably be avoided in this case, but as English is not the most constrained translation it doesn't really matter. Testing performed: built for feather nRF52840 express and trinket m0 in English and zh_Latn_pinyin; ran and verified the localized messages such as Àn xià rènhé jiàn jìnrù REPL. Shǐyòng CTRL-D chóngxīn jiāzài. and Press any key to enter the REPL. Use CTRL-D to reload. were properly displayed. --- py/makeqstrdata.py | 36 ++++++++++++++++------------------- supervisor/shared/translate.c | 20 +++++++++++++++++-- 2 files changed, 34 insertions(+), 22 deletions(-) diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index 8e3835d861..b9c0ce3e11 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -103,14 +103,10 @@ def compute_huffman_coding(translations, qstrs, compression_filename): # go through each qstr and print it out for _, _, qstr in qstrs.values(): all_strings.append(qstr) - all_strings_concat = "".join(all_strings).encode("utf-8") + all_strings_concat = "".join(all_strings) counts = collections.Counter(all_strings_concat) - # add other values - for i in range(256): - if i not in counts: - counts[i] = 0 cb = huffman.codebook(counts.items()) - values = bytearray() + values = [] length_count = {} renumbered = 0 last_l = None @@ -124,26 +120,26 @@ def compute_huffman_coding(translations, qstrs, compression_filename): if last_l: renumbered <<= (l - last_l) canonical[ch] = '{0:0{width}b}'.format(renumbered, width=l) - if chr(ch) in C_ESCAPES: - s = C_ESCAPES[chr(ch)] - else: - s = chr(ch) - print("//", ch, s, counts[ch], canonical[ch], renumbered) + s = C_ESCAPES.get(ch, ch) + print("//", ord(ch), s, counts[ch], canonical[ch], renumbered) renumbered += 1 last_l = l lengths = bytearray() - for i in range(1, max(length_count) + 1): + print("// length count", length_count) + for i in range(1, max(length_count) + 2): lengths.append(length_count.get(i, 0)) + print("// values", values, "lengths", len(lengths), lengths) + print("// estimated total memory size", len(lengths) + 2*len(values) + sum(len(cb[u]) for u in all_strings_concat)) print("//", values, lengths) with open(compression_filename, "w") as f: f.write("const uint8_t lengths[] = {{ {} }};\n".format(", ".join(map(str, lengths)))) - f.write("const uint8_t values[256] = {{ {} }};\n".format(", ".join(map(str, values)))) + f.write("const uint16_t values[] = {{ {} }};\n".format(", ".join(str(ord(u)) for u in values))) return values, lengths def decompress(encoding_table, length, encoded): values, lengths = encoding_table #print(l, encoded) - dec = bytearray(length) + dec = [] this_byte = 0 this_bit = 7 b = encoded[this_byte] @@ -173,14 +169,14 @@ def decompress(encoding_table, length, encoded): searched_length += lengths[bit_length] v = values[searched_length + bits - max_code] - dec[i] = v - return dec + dec.append(v) + return ''.join(dec) def compress(encoding_table, decompressed): - if not isinstance(decompressed, bytes): + if not isinstance(decompressed, str): raise TypeError() values, lengths = encoding_table - enc = bytearray(len(decompressed) * 2) + enc = bytearray(len(decompressed) * 3) #print(decompressed) #print(lengths) current_bit = 7 @@ -347,9 +343,9 @@ def print_qstr_data(encoding_table, qcfgs, qstrs, i18ns): total_text_compressed_size = 0 for original, translation in i18ns: translation_encoded = translation.encode("utf-8") - compressed = compress(encoding_table, translation_encoded) + compressed = compress(encoding_table, translation) total_text_compressed_size += len(compressed) - decompressed = decompress(encoding_table, len(translation_encoded), compressed).decode("utf-8") + decompressed = decompress(encoding_table, len(translation_encoded), compressed) for c in C_ESCAPES: decompressed = decompressed.replace(c, C_ESCAPES[c]) print("TRANSLATION(\"{}\", {}, {{ {} }}) // {}".format(original, len(translation_encoded)+1, ", ".join(["0x{:02x}".format(x) for x in compressed]), decompressed)) diff --git a/supervisor/shared/translate.c b/supervisor/shared/translate.c index aa5e4517c2..187d5ff8a5 100644 --- a/supervisor/shared/translate.c +++ b/supervisor/shared/translate.c @@ -42,12 +42,28 @@ void serial_write_compressed(const compressed_string_t* compressed) { serial_write(decompressed); } +STATIC int put_utf8(char *buf, int u) { + if(u <= 0x7f) { + *buf = u; + return 1; + } else if(u <= 0x07ff) { + *buf++ = 0b11000000 | (u >> 6); + *buf = 0b10000000 | (u & 0b00111111); + return 2; + } else { // u <= 0xffff) + *buf++ = 0b11000000 | (u >> 12); + *buf = 0b10000000 | ((u >> 6) & 0b00111111); + *buf = 0b10000000 | (u & 0b00111111); + return 3; + } +} + char* decompress(const compressed_string_t* compressed, char* decompressed) { uint8_t this_byte = 0; uint8_t this_bit = 7; uint8_t b = compressed->data[this_byte]; // Stop one early because the last byte is always NULL. - for (uint16_t i = 0; i < compressed->length - 1; i++) { + for (uint16_t i = 0; i < compressed->length - 1;) { uint32_t bits = 0; uint8_t bit_length = 0; uint32_t max_code = lengths[0]; @@ -72,7 +88,7 @@ char* decompress(const compressed_string_t* compressed, char* decompressed) { max_code = (max_code << 1) + lengths[bit_length]; searched_length += lengths[bit_length]; } - decompressed[i] = values[searched_length + bits - max_code]; + i += put_utf8(decompressed + i, values[searched_length + bits - max_code]); } decompressed[compressed->length-1] = '\0'; From 879e1041c9bb0067bc06337870f2515922469cf0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 2 Dec 2019 10:18:48 -0600 Subject: [PATCH 132/189] makeqstrdata: fix printing of 'increased length' message --- py/makeqstrdata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index b9c0ce3e11..9df1a82b6b 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -224,7 +224,7 @@ def compress(encoding_table, decompressed): if current_bit != 7: current_byte += 1 if current_byte > len(decompressed): - print("Note: compression increased length", repr(decompressed.decode('utf-8')), len(decompressed), current_byte, file=sys.stderr) + print("Note: compression increased length", repr(decompressed), len(decompressed), current_byte, file=sys.stderr) return enc[:current_byte] def qstr_escape(qst): From 12737e282152d7bed7dac540029af9dd5b423ec6 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Mon, 2 Dec 2019 12:28:48 -0500 Subject: [PATCH 133/189] remove F401 additions to streamline --- ports/stm32f4/peripherals/stm32f4/periph.h | 6 - .../peripherals/stm32f4/stm32f401xe/clocks.c | 61 ------- .../peripherals/stm32f4/stm32f401xe/gpio.c | 54 ------ .../peripherals/stm32f4/stm32f401xe/periph.c | 172 ------------------ .../peripherals/stm32f4/stm32f401xe/periph.h | 57 ------ .../peripherals/stm32f4/stm32f401xe/pins.c | 123 ------------- .../peripherals/stm32f4/stm32f401xe/pins.h | 121 ------------ 7 files changed, 594 deletions(-) delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f401xe/clocks.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f401xe/gpio.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.h delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.h diff --git a/ports/stm32f4/peripherals/stm32f4/periph.h b/ports/stm32f4/peripherals/stm32f4/periph.h index ac98b89320..0d1374e850 100644 --- a/ports/stm32f4/peripherals/stm32f4/periph.h +++ b/ports/stm32f4/peripherals/stm32f4/periph.h @@ -140,12 +140,6 @@ typedef struct { //Starter Lines -#ifdef STM32F401xE -#define HAS_DAC 0 -#define HAS_TRNG 0 -#include "stm32f401xe/periph.h" -#endif - #ifdef STM32F411xE #define HAS_DAC 0 #define HAS_TRNG 0 diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/clocks.c b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/clocks.c deleted file mode 100644 index 883c252d51..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/clocks.c +++ /dev/null @@ -1,61 +0,0 @@ - -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland 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 "stm32f4xx_hal.h" - -void stm32f4_peripherals_clocks_init(void) { - //System clock init - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - - /* Enable Power Control clock */ - __HAL_RCC_PWR_CLK_ENABLE(); - - /* The voltage scaling allows optimizing the power consumption when the device is - clocked below the maximum system frequency, to update the voltage scaling value - regarding system frequency refer to product datasheet. */ - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2); - - /* Enable HSE Oscillator and activate PLL with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = 8; - RCC_OscInitStruct.PLL.PLLN = 336; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4; - RCC_OscInitStruct.PLL.PLLQ = 7; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 - clocks dividers */ - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3); -} diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/gpio.c b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/gpio.c deleted file mode 100644 index 45dc8fc6fa..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/gpio.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland 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 "stm32f4xx_hal.h" -#include "stm32f4/gpio.h" -#include "common-hal/microcontroller/Pin.h" - -void stm32f4_peripherals_gpio_init(void) { - //Enable all GPIO for now - GPIO_InitTypeDef GPIO_InitStruct = {0}; - /* GPIO Ports Clock Enable */ - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - __HAL_RCC_GPIOC_CLK_ENABLE(); - __HAL_RCC_GPIOD_CLK_ENABLE(); - __HAL_RCC_GPIOE_CLK_ENABLE(); - __HAL_RCC_GPIOH_CLK_ENABLE(); - - //Never reset pins - never_reset_pin_number(2,13); //PC13 anti tamp - never_reset_pin_number(2,14); //PC14 OSC32_IN - never_reset_pin_number(2,15); //PC15 OSC32_OUT - never_reset_pin_number(0,13); //PA13 SWDIO - never_reset_pin_number(0,14); //PA14 SWCLK -} - -//LEDs are inverted on F411 DISCO -void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { -} - - diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.c b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.c deleted file mode 100644 index 859e9a1adb..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.c +++ /dev/null @@ -1,172 +0,0 @@ - /* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland 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 "py/obj.h" -#include "py/mphal.h" -#include "stm32f4/pins.h" -#include "stm32f4/periph.h" - -// I2C - -I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, I2C2, I2C3}; - -const mcu_i2c_sda_obj_t mcu_i2c_sda_list[5] = { - I2C_SDA(1, 4, &pin_PB07), - I2C_SDA(1, 4, &pin_PB09), - I2C_SDA(2, 9, &pin_PB03), - I2C_SDA(3, 4, &pin_PC09), - I2C_SDA(3, 9, &pin_PB04), -}; - -const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4] = { - I2C_SCL(1, 4, &pin_PB06), - I2C_SCL(1, 4, &pin_PB08), - I2C_SCL(2, 4, &pin_PB10), - I2C_SCL(3, 4, &pin_PA08) -}; - -// SPI - -SPI_TypeDef * mcu_spi_banks[4] = {SPI1, SPI2, SPI3, SPI4}; - -const mcu_spi_sck_obj_t mcu_spi_sck_list[9] = { - SPI(1, 5, &pin_PA05), - SPI(1, 5, &pin_PB03), - SPI(2, 5, &pin_PB10), - SPI(2, 5, &pin_PB13), - SPI(2, 5, &pin_PD03), - SPI(3, 6, &pin_PB03), - SPI(3, 6, &pin_PC10), - SPI(4, 5, &pin_PE02), - SPI(4, 5, &pin_PE12), -}; - -const mcu_spi_mosi_obj_t mcu_spi_mosi_list[9] = { - SPI(1, 5, &pin_PA07), - SPI(1, 5, &pin_PB05), - SPI(2, 5, &pin_PB15), - SPI(2, 5, &pin_PC03), - SPI(3, 6, &pin_PB05), - SPI(3, 6, &pin_PC12), - SPI(3, 5, &pin_PD06), - SPI(4, 5, &pin_PE06), - SPI(4, 5, &pin_PE14), -}; - -const mcu_spi_miso_obj_t mcu_spi_miso_list[8] = { - SPI(1, 5, &pin_PA06), - SPI(1, 5, &pin_PB04), - SPI(2, 5, &pin_PB14), - SPI(2, 5, &pin_PC02), - SPI(3, 6, &pin_PB04), - SPI(3, 6, &pin_PC11), - SPI(4, 5, &pin_PE05), - SPI(4, 5, &pin_PE13), -}; - -const mcu_spi_nss_obj_t mcu_spi_nss_list[9] = { - SPI(1, 5, &pin_PA04), - SPI(1, 5, &pin_PA15), - SPI(2, 5, &pin_PB09), - SPI(2, 5, &pin_PB12), - SPI(3, 6, &pin_PA04), - SPI(3, 6, &pin_PA15), - SPI(4, 6, &pin_PB12), - SPI(4, 5, &pin_PE04), - SPI(4, 5, &pin_PE11), -}; - -USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, NULL, NULL, NULL, USART6}; -bool mcu_uart_has_usart[MAX_UART] = {true, true, false, false, false, true}; - -const mcu_uart_tx_obj_t mcu_uart_tx_list[6] = { - UART(2, 7, &pin_PA02), - UART(1, 7, &pin_PA09), - UART(6, 8, &pin_PA11), - UART(1, 7, &pin_PB06), - UART(6, 8, &pin_PC06), - UART(2, 7, &pin_PD05), -}; - -const mcu_uart_rx_obj_t mcu_uart_rx_list[6] = { - UART(2, 7, &pin_PA03), - UART(1, 7, &pin_PA10), - UART(6, 8, &pin_PA12), - UART(1, 7, &pin_PB07), - UART(6, 8, &pin_PC07), - UART(2, 7, &pin_PD06), -}; - -//Timers -//TIM6 and TIM7 are basic timers that are only used by DAC, and don't have pins -TIM_TypeDef * mcu_tim_banks[14] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, NULL, TIM9, TIM10, - TIM11, NULL, NULL, NULL}; - -const mcu_tim_pin_obj_t mcu_tim_pin_list[44] = { - TIM(2,1,1,&pin_PA00), - TIM(5,2,1,&pin_PA00), - TIM(2,1,2,&pin_PA01), - TIM(5,2,2,&pin_PA01), - TIM(2,1,3,&pin_PA02), - TIM(5,2,3,&pin_PA02), - TIM(2,1,4,&pin_PA03), - TIM(5,2,4,&pin_PA03), - TIM(9,3,1,&pin_PA02), - TIM(9,3,2,&pin_PA03), - TIM(3,2,1,&pin_PA06), - TIM(3,2,2,&pin_PA07), - TIM(1,1,1,&pin_PA08), - TIM(1,1,2,&pin_PA09), - TIM(1,1,3,&pin_PA10), - TIM(1,1,4,&pin_PA11), - TIM(2,1,1,&pin_PA15), - TIM(3,2,3,&pin_PB00), - TIM(3,2,4,&pin_PB01), - TIM(2,1,2,&pin_PB03), - TIM(3,2,1,&pin_PB04), - TIM(3,2,2,&pin_PB05), - TIM(4,2,1,&pin_PB06), - TIM(4,2,2,&pin_PB07), - TIM(4,2,3,&pin_PB08), - TIM(10,2,1,&pin_PB08), - TIM(4,2,4,&pin_PB09), - TIM(11,2,1,&pin_PB09), - TIM(2,1,3,&pin_PB10), - TIM(3,2,1,&pin_PC06), - TIM(3,2,2,&pin_PC07), - TIM(3,2,3,&pin_PC08), - TIM(3,2,4,&pin_PC09), - TIM(4,2,1,&pin_PD12), - TIM(4,2,2,&pin_PD13), - TIM(4,2,3,&pin_PD14), - TIM(4,2,4,&pin_PD15), - TIM(9,3,1,&pin_PE05), - TIM(9,3,2,&pin_PE06), - TIM(1,1,1,&pin_PE09), - TIM(1,1,2,&pin_PE11), - TIM(1,1,3,&pin_PE13), - TIM(1,1,4,&pin_PE14), -}; diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.h b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.h deleted file mode 100644 index 7d3f4dca22..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland 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_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H - -//I2C -extern I2C_TypeDef * mcu_i2c_banks[3]; - -extern const mcu_i2c_sda_obj_t mcu_i2c_sda_list[5]; -extern const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4]; - -//SPI -extern SPI_TypeDef * mcu_spi_banks[4]; - -extern const mcu_spi_sck_obj_t mcu_spi_sck_list[9]; -extern const mcu_spi_mosi_obj_t mcu_spi_mosi_list[9]; -extern const mcu_spi_miso_obj_t mcu_spi_miso_list[8]; -extern const mcu_spi_nss_obj_t mcu_spi_nss_list[9]; - -//UART -extern USART_TypeDef * mcu_uart_banks[MAX_UART]; -extern bool mcu_uart_has_usart[MAX_UART]; - -extern const mcu_uart_tx_obj_t mcu_uart_tx_list[6]; -extern const mcu_uart_rx_obj_t mcu_uart_rx_list[6]; - -//Timers -#define TIM_BANK_ARRAY_LEN 14 -#define TIM_PIN_ARRAY_LEN 44 -TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; -const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; - -#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H \ No newline at end of file diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.c b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.c deleted file mode 100644 index 7e88c3dcba..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.c +++ /dev/null @@ -1,123 +0,0 @@ - /* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland 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 "py/obj.h" -#include "py/mphal.h" -#include "stm32f4/pins.h" - -const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); -const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); -const mcu_pin_obj_t pin_PE04 = PIN(4, 4, NO_ADC); -const mcu_pin_obj_t pin_PE05 = PIN(4, 5, NO_ADC); -const mcu_pin_obj_t pin_PE06 = PIN(4, 6, NO_ADC); - -const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); //anti-tamp -const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); //OSC32_IN -const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); //OSC32_OUT - -const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_1,10)); -const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_1,11)); -const mcu_pin_obj_t pin_PC02 = PIN(2, 2, ADC_INPUT(ADC_1,12)); -const mcu_pin_obj_t pin_PC03 = PIN(2, 3, ADC_INPUT(ADC_1,13)); - -const mcu_pin_obj_t pin_PA00 = PIN(0, 0, ADC_INPUT(ADC_1,0)); -const mcu_pin_obj_t pin_PA01 = PIN(0, 1, ADC_INPUT(ADC_1,1)); -const mcu_pin_obj_t pin_PA02 = PIN(0, 2, ADC_INPUT(ADC_1,2)); -const mcu_pin_obj_t pin_PA03 = PIN(0, 3, ADC_INPUT(ADC_1,3)); -const mcu_pin_obj_t pin_PA04 = PIN(0, 4, ADC_INPUT(ADC_1,4)); -const mcu_pin_obj_t pin_PA05 = PIN(0, 5, ADC_INPUT(ADC_1,5)); -const mcu_pin_obj_t pin_PA06 = PIN(0, 6, ADC_INPUT(ADC_1,6)); -const mcu_pin_obj_t pin_PA07 = PIN(0, 7, ADC_INPUT(ADC_1,7)); - -const mcu_pin_obj_t pin_PC04 = PIN(2, 4, ADC_INPUT(ADC_1,14)); -const mcu_pin_obj_t pin_PC05 = PIN(2, 5, ADC_INPUT(ADC_1,15)); - -const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_1,8)); -const mcu_pin_obj_t pin_PB01 = PIN(1, 1, ADC_INPUT(ADC_1,9)); -const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); - -const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); -const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); -const mcu_pin_obj_t pin_PE09 = PIN(4, 9, NO_ADC); -const mcu_pin_obj_t pin_PE10 = PIN(4, 10, NO_ADC); -const mcu_pin_obj_t pin_PE11 = PIN(4, 11, NO_ADC); -const mcu_pin_obj_t pin_PE12 = PIN(4, 12, NO_ADC); -const mcu_pin_obj_t pin_PE13 = PIN(4, 13, NO_ADC); -const mcu_pin_obj_t pin_PE14 = PIN(4, 14, NO_ADC); -const mcu_pin_obj_t pin_PE15 = PIN(4, 15, NO_ADC); - -const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC); -const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC); -const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC); -const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC); -const mcu_pin_obj_t pin_PB15 = PIN(1, 15, NO_ADC); - -const mcu_pin_obj_t pin_PD08 = PIN(3, 8, NO_ADC); -const mcu_pin_obj_t pin_PD09 = PIN(3, 9, NO_ADC); -const mcu_pin_obj_t pin_PD10 = PIN(3, 10, NO_ADC); -const mcu_pin_obj_t pin_PD11 = PIN(3, 11, NO_ADC); -const mcu_pin_obj_t pin_PD12 = PIN(3, 12, NO_ADC); -const mcu_pin_obj_t pin_PD13 = PIN(3, 13, NO_ADC); -const mcu_pin_obj_t pin_PD14 = PIN(3, 14, NO_ADC); -const mcu_pin_obj_t pin_PD15 = PIN(3, 15, NO_ADC); - -const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC); -const mcu_pin_obj_t pin_PC07 = PIN(2, 7, NO_ADC); -const mcu_pin_obj_t pin_PC08 = PIN(2, 8, NO_ADC); -const mcu_pin_obj_t pin_PC09 = PIN(2, 9, NO_ADC); - -const mcu_pin_obj_t pin_PA08 = PIN(0, 8, NO_ADC); -const mcu_pin_obj_t pin_PA09 = PIN(0, 9, NO_ADC); -const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC); -const mcu_pin_obj_t pin_PA11 = PIN(0, 11, NO_ADC); -const mcu_pin_obj_t pin_PA12 = PIN(0, 12, NO_ADC); -const mcu_pin_obj_t pin_PA13 = PIN(0, 13, NO_ADC); //SWDIO -const mcu_pin_obj_t pin_PA14 = PIN(0, 14, NO_ADC); //SWCLK -const mcu_pin_obj_t pin_PA15 = PIN(0, 15, NO_ADC); //JTDI - -const mcu_pin_obj_t pin_PC10 = PIN(2, 10, NO_ADC); -const mcu_pin_obj_t pin_PC11 = PIN(2, 11, NO_ADC); -const mcu_pin_obj_t pin_PC12 = PIN(2, 12, NO_ADC); - -const mcu_pin_obj_t pin_PD00 = PIN(3, 0, NO_ADC); -const mcu_pin_obj_t pin_PD01 = PIN(3, 1, NO_ADC); -const mcu_pin_obj_t pin_PD02 = PIN(3, 2, NO_ADC); -const mcu_pin_obj_t pin_PD03 = PIN(3, 3, NO_ADC); -const mcu_pin_obj_t pin_PD04 = PIN(3, 4, NO_ADC); -const mcu_pin_obj_t pin_PD05 = PIN(3, 5, NO_ADC); -const mcu_pin_obj_t pin_PD06 = PIN(3, 6, NO_ADC); -const mcu_pin_obj_t pin_PD07 = PIN(3, 7, NO_ADC); - -const mcu_pin_obj_t pin_PB03 = PIN(1, 3, NO_ADC); -const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC); -const mcu_pin_obj_t pin_PB05 = PIN(1, 5, NO_ADC); -const mcu_pin_obj_t pin_PB06 = PIN(1, 6, NO_ADC); -const mcu_pin_obj_t pin_PB07 = PIN(1, 7, NO_ADC); -const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC); -const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC); - -const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC); -const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); \ No newline at end of file diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.h b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.h deleted file mode 100644 index 37d3a5cf11..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland 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_STM32F4_PERIPHERALS_STM32F411VE_PINS_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PINS_H - -//Pins in datasheet order: DocID026289 Rev 7 page 38. LQFP100 only -//pg 38 -extern const mcu_pin_obj_t pin_PE02; -extern const mcu_pin_obj_t pin_PE03; -extern const mcu_pin_obj_t pin_PE04; -extern const mcu_pin_obj_t pin_PE05; -//pg 39 -extern const mcu_pin_obj_t pin_PE06; -extern const mcu_pin_obj_t pin_PC13; -extern const mcu_pin_obj_t pin_PC14; -extern const mcu_pin_obj_t pin_PC15; -extern const mcu_pin_obj_t pin_PC00; -extern const mcu_pin_obj_t pin_PC01; -extern const mcu_pin_obj_t pin_PC02; -extern const mcu_pin_obj_t pin_PC03; -//pg 40 -extern const mcu_pin_obj_t pin_PA00; -extern const mcu_pin_obj_t pin_PA01; -extern const mcu_pin_obj_t pin_PA02; -extern const mcu_pin_obj_t pin_PA03; -extern const mcu_pin_obj_t pin_PA04; -extern const mcu_pin_obj_t pin_PA05; -extern const mcu_pin_obj_t pin_PA06; -extern const mcu_pin_obj_t pin_PA07; -//pg 41 -extern const mcu_pin_obj_t pin_PC04; -extern const mcu_pin_obj_t pin_PC05; -extern const mcu_pin_obj_t pin_PB00; -extern const mcu_pin_obj_t pin_PB01; -extern const mcu_pin_obj_t pin_PB02; -extern const mcu_pin_obj_t pin_PE07; -extern const mcu_pin_obj_t pin_PE08; -extern const mcu_pin_obj_t pin_PE09; -extern const mcu_pin_obj_t pin_PE10; -extern const mcu_pin_obj_t pin_PE11; -extern const mcu_pin_obj_t pin_PE12; -extern const mcu_pin_obj_t pin_PE13; -extern const mcu_pin_obj_t pin_PE14; -extern const mcu_pin_obj_t pin_PE15; -//pg 42 -extern const mcu_pin_obj_t pin_PB10; -extern const mcu_pin_obj_t pin_PB12; -extern const mcu_pin_obj_t pin_PB13; -extern const mcu_pin_obj_t pin_PB14; -extern const mcu_pin_obj_t pin_PB15; -extern const mcu_pin_obj_t pin_PD08; -extern const mcu_pin_obj_t pin_PD09; -extern const mcu_pin_obj_t pin_PD10; -extern const mcu_pin_obj_t pin_PD11; -extern const mcu_pin_obj_t pin_PD12; -//pg 43 -extern const mcu_pin_obj_t pin_PD13; -extern const mcu_pin_obj_t pin_PD14; -extern const mcu_pin_obj_t pin_PD15; -extern const mcu_pin_obj_t pin_PC06; -extern const mcu_pin_obj_t pin_PC07; -extern const mcu_pin_obj_t pin_PC08; -extern const mcu_pin_obj_t pin_PC09; -extern const mcu_pin_obj_t pin_PA08; -extern const mcu_pin_obj_t pin_PA09; -//pg 44 -extern const mcu_pin_obj_t pin_PA10; -extern const mcu_pin_obj_t pin_PA11; -extern const mcu_pin_obj_t pin_PA12; -extern const mcu_pin_obj_t pin_PA13; -extern const mcu_pin_obj_t pin_PA14; -extern const mcu_pin_obj_t pin_PA15; -extern const mcu_pin_obj_t pin_PC10; -extern const mcu_pin_obj_t pin_PC11; -extern const mcu_pin_obj_t pin_PC12; -//pg 45 -extern const mcu_pin_obj_t pin_PD00; -extern const mcu_pin_obj_t pin_PD01; -extern const mcu_pin_obj_t pin_PD02; -extern const mcu_pin_obj_t pin_PD03; -extern const mcu_pin_obj_t pin_PD04; -extern const mcu_pin_obj_t pin_PD05; -extern const mcu_pin_obj_t pin_PD06; -extern const mcu_pin_obj_t pin_PD07; -extern const mcu_pin_obj_t pin_PB03; -extern const mcu_pin_obj_t pin_PB04; -extern const mcu_pin_obj_t pin_PB05; -extern const mcu_pin_obj_t pin_PB06; -//pg 46 -extern const mcu_pin_obj_t pin_PB07; -extern const mcu_pin_obj_t pin_PB08; -extern const mcu_pin_obj_t pin_PB09; -extern const mcu_pin_obj_t pin_PE00; -extern const mcu_pin_obj_t pin_PE01; - - -#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PINS_H From 1a0dcb5caaaa2d9f0dc25d87735b76f1bf5f2c24 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 2 Dec 2019 14:49:23 -0600 Subject: [PATCH 134/189] makeqstrdata: reclaim some more bytes on some translations If a translation only has unicode code points 255 and below, the "values" array can be 8 bits instead of 16 bits. This reclaims some code size, e.g., in a local build, trinket_m0 / en_US reclaimed 112 bytes and de_DE reclaimed 104 bytes. However, languages like zh_Latn_pinyin, which use code points above 255, did not benefit. --- py/makeqstrdata.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index 9df1a82b6b..0d667959d9 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -131,9 +131,10 @@ def compute_huffman_coding(translations, qstrs, compression_filename): print("// values", values, "lengths", len(lengths), lengths) print("// estimated total memory size", len(lengths) + 2*len(values) + sum(len(cb[u]) for u in all_strings_concat)) print("//", values, lengths) + values_type = "uint16_t" if max(ord(u) for u in values) > 255 else "uint8_t" with open(compression_filename, "w") as f: f.write("const uint8_t lengths[] = {{ {} }};\n".format(", ".join(map(str, lengths)))) - f.write("const uint16_t values[] = {{ {} }};\n".format(", ".join(str(ord(u)) for u in values))) + f.write("const {} values[] = {{ {} }};\n".format(values_type, ", ".join(str(ord(u)) for u in values))) return values, lengths def decompress(encoding_table, length, encoded): From 45a6b03d404c7a43766e94661f43036d9528511d Mon Sep 17 00:00:00 2001 From: Hierophect Date: Tue, 3 Dec 2019 15:30:12 -0500 Subject: [PATCH 135/189] copy from busted branch --- .../common-hal/digitalio/DigitalInOut.c | 6 +++--- .../common-hal/neopixel_write/__init__.c | 20 ++++++++++++++----- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/ports/stm32f4/common-hal/digitalio/DigitalInOut.c b/ports/stm32f4/common-hal/digitalio/DigitalInOut.c index 51b1fde738..36c1075e23 100644 --- a/ports/stm32f4/common-hal/digitalio/DigitalInOut.c +++ b/ports/stm32f4/common-hal/digitalio/DigitalInOut.c @@ -47,7 +47,7 @@ digitalinout_result_t common_hal_digitalio_digitalinout_construct( GPIO_InitStruct.Pin = pin_mask(self->pin->number); GPIO_InitStruct.Mode = GPIO_MODE_INPUT; GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; HAL_GPIO_Init(pin_port(self->pin->port), &GPIO_InitStruct); return DIGITALINOUT_OK; @@ -73,7 +73,7 @@ void common_hal_digitalio_digitalinout_switch_to_input( GPIO_InitStruct.Pin = pin_mask(self->pin->number); GPIO_InitStruct.Mode = GPIO_MODE_INPUT; GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; HAL_GPIO_Init(pin_port(self->pin->port), &GPIO_InitStruct); common_hal_digitalio_digitalinout_set_pull(self, pull); @@ -114,7 +114,7 @@ void common_hal_digitalio_digitalinout_set_drive_mode( GPIO_InitStruct.Mode = (drive_mode == DRIVE_MODE_OPEN_DRAIN ? GPIO_MODE_OUTPUT_OD : GPIO_MODE_OUTPUT_PP); GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; HAL_GPIO_Init(pin_port(self->pin->port), &GPIO_InitStruct); } diff --git a/ports/stm32f4/common-hal/neopixel_write/__init__.c b/ports/stm32f4/common-hal/neopixel_write/__init__.c index fd46825d03..23fe7870f5 100644 --- a/ports/stm32f4/common-hal/neopixel_write/__init__.c +++ b/ports/stm32f4/common-hal/neopixel_write/__init__.c @@ -28,6 +28,8 @@ #include "shared-bindings/neopixel_write/__init__.h" #include "tick.h" +#include "py/mperrno.h" +#include "py/runtime.h" #include "common-hal/microcontroller/Pin.h" #include "stm32f4xx_hal.h" #include "stm32f4xx_ll_gpio.h" @@ -40,6 +42,9 @@ uint32_t next_start_tick_us = 1000; #define MAGIC_800_T0H 2800000 // ~0.36 us -> 0.44 field #define MAGIC_800_T1H 1350000 // ~0.74 us -> 0.84 field +#pragma GCC push_options +#pragma GCC optimize ("Os") + void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout, uint8_t *pixels, uint32_t numBytes) { uint8_t *p = pixels, *end = p + numBytes, pix = *p++, mask = 0x80; @@ -48,7 +53,7 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout //assumes 800_000Hz frequency //Theoretical values here are 800_000 -> 1.25us, 2500000->0.4us, 1250000->0.8us - //But they don't work, possibly due to bad optimization? Use tested magic values instead + //TODO: try to get dynamic weighting working again uint32_t sys_freq = HAL_RCC_GetSysClockFreq(); uint32_t interval = sys_freq/MAGIC_800_INT; uint32_t t0 = (sys_freq/MAGIC_800_T0H); @@ -63,23 +68,26 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout __disable_irq(); // Enable DWT in debug core. Useable when interrupts disabled, as opposed to Systick->VAL - //ITM->LAR = 0xC5ACCE55; //this should be required but isn't CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; DWT->CYCCNT = 0; for(;;) { + cyc = (pix & mask) ? t1 : t0; start = DWT->CYCCNT; LL_GPIO_SetOutputPin(p_port, p_mask); - cyc = (pix & mask) ? t1 : t0; - while(DWT->CYCCNT - start < cyc); + while((DWT->CYCCNT - start) < cyc) { + __asm__ __volatile__("nop"); + } LL_GPIO_ResetOutputPin(p_port, p_mask); + while((DWT->CYCCNT - start) < interval) { + __asm__ __volatile__("nop"); + } if(!(mask >>= 1)) { if(p >= end) break; pix = *p++; mask = 0x80; } - while(DWT->CYCCNT - start < interval); //wait for interval to finish } // Enable interrupts again @@ -94,3 +102,5 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout next_start_tick_us -= 100; } } + +#pragma GCC pop_options \ No newline at end of file From 012b3bdf1869114a383baeef29300b588c234d81 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Tue, 3 Dec 2019 16:18:49 -0500 Subject: [PATCH 136/189] Add I2C never reset, SPI bugfix --- ports/stm32f4/common-hal/busio/I2C.c | 25 +++++++++++++++++++++---- ports/stm32f4/common-hal/busio/SPI.c | 3 ++- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/ports/stm32f4/common-hal/busio/I2C.c b/ports/stm32f4/common-hal/busio/I2C.c index c2f5dbe0a2..d2292845ea 100644 --- a/ports/stm32f4/common-hal/busio/I2C.c +++ b/ports/stm32f4/common-hal/busio/I2C.c @@ -36,6 +36,7 @@ #include "common-hal/microcontroller/Pin.h" STATIC bool reserved_i2c[3]; +STATIC bool never_reset[3]; void i2c_reset(void) { //Note: I2Cs are also forcibly reset in construct, due to silicon error @@ -48,11 +49,24 @@ void i2c_reset(void) { __HAL_RCC_I2C2_CLK_DISABLE(); #endif #ifdef I2C3 - reserved_i2c[3] = false; + reserved_i2c[2] = false; __HAL_RCC_I2C3_CLK_DISABLE(); #endif } +void common_hal_busio_i2c_never_reset(busio_i2c_obj_t *self) { + for (size_t i = 0 ; i < MP_ARRAY_SIZE(mcu_i2c_banks); i++) { + if (self->handle.Instance == mcu_i2c_banks[i]) { + never_reset[i] = true; + + never_reset_pin_number(self->scl->pin->port, self->scl->pin->number); + never_reset_pin_number(self->sda->pin->port, self->scl->pin->number); + break; + } + } +} + + void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, const mcu_pin_obj_t* scl, const mcu_pin_obj_t* sda, uint32_t frequency, uint32_t timeout) { @@ -166,19 +180,22 @@ void common_hal_busio_i2c_deinit(busio_i2c_obj_t *self) { } #ifdef I2C1 if(self->handle.Instance==I2C1) { - reserved_i2c[0] = 0; + never_reset[0] = false; + reserved_i2c[0] = false; __HAL_RCC_I2C1_CLK_DISABLE(); } #endif #ifdef I2C2 if(self->handle.Instance==I2C2) { - reserved_i2c[1] = 0; + never_reset[1] = false; + reserved_i2c[1] = false; __HAL_RCC_I2C2_CLK_DISABLE(); } #endif #ifdef I2C3 if(self->handle.Instance==I2C3) { - reserved_i2c[3] = 0; + never_reset[2] = false; + reserved_i2c[2] = false; __HAL_RCC_I2C3_CLK_DISABLE(); } #endif diff --git a/ports/stm32f4/common-hal/busio/SPI.c b/ports/stm32f4/common-hal/busio/SPI.c index b5517f470f..1142657b7f 100644 --- a/ports/stm32f4/common-hal/busio/SPI.c +++ b/ports/stm32f4/common-hal/busio/SPI.c @@ -191,7 +191,8 @@ bool common_hal_busio_spi_deinited(busio_spi_obj_t *self) { void common_hal_busio_spi_deinit(busio_spi_obj_t *self) { spi_clock_disable(1<<(self->sck->spi_index - 1)); - reserved_spi[self->sck->spi_index - 1] = true; + reserved_spi[self->sck->spi_index - 1] = false; + never_reset_spi[self->sck->spi_index - 1] = false; reset_pin_number(self->sck->pin->port,self->sck->pin->number); reset_pin_number(self->mosi->pin->port,self->mosi->pin->number); From e6b45656f9ce93aee719542ff8aa3e966d6b1a67 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Tue, 3 Dec 2019 17:18:42 -0500 Subject: [PATCH 137/189] Add module and empty parallelbus --- .../common-hal/displayio/ParallelBus.c | 68 +++++++++++++++++++ .../common-hal/displayio/ParallelBus.h | 36 ++++++++++ ports/stm32f4/mpconfigport.mk | 3 + 3 files changed, 107 insertions(+) create mode 100644 ports/stm32f4/common-hal/displayio/ParallelBus.c create mode 100644 ports/stm32f4/common-hal/displayio/ParallelBus.h diff --git a/ports/stm32f4/common-hal/displayio/ParallelBus.c b/ports/stm32f4/common-hal/displayio/ParallelBus.c new file mode 100644 index 0000000000..1b808ec025 --- /dev/null +++ b/ports/stm32f4/common-hal/displayio/ParallelBus.c @@ -0,0 +1,68 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland 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/displayio/ParallelBus.h" + +#include + +#include "common-hal/microcontroller/Pin.h" +#include "py/runtime.h" +#include "shared-bindings/digitalio/DigitalInOut.h" +#include "shared-bindings/microcontroller/__init__.h" + +#include "tick.h" + +void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t* self, + const mcu_pin_obj_t* data0, const mcu_pin_obj_t* command, const mcu_pin_obj_t* chip_select, + const mcu_pin_obj_t* write, const mcu_pin_obj_t* read, const mcu_pin_obj_t* reset) { + + mp_raise_NotImplementedError(translate("ParallelBus not yet supported")); +} + +void common_hal_displayio_parallelbus_deinit(displayio_parallelbus_obj_t* self) { + +} + +bool common_hal_displayio_parallelbus_reset(mp_obj_t obj) { + return false; +} + +bool common_hal_displayio_parallelbus_bus_free(mp_obj_t obj) { + return false; +} + +bool common_hal_displayio_parallelbus_begin_transaction(mp_obj_t obj) { + + return false; +} + +void common_hal_displayio_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type, display_chip_select_behavior_t chip_select, uint8_t *data, uint32_t data_length) { + +} + +void common_hal_displayio_parallelbus_end_transaction(mp_obj_t obj) { + +} diff --git a/ports/stm32f4/common-hal/displayio/ParallelBus.h b/ports/stm32f4/common-hal/displayio/ParallelBus.h new file mode 100644 index 0000000000..85d100715e --- /dev/null +++ b/ports/stm32f4/common-hal/displayio/ParallelBus.h @@ -0,0 +1,36 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Lucian Copeland 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_STM32F4_COMMON_HAL_DISPLAYIO_PARALLELBUS_H +#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_DISPLAYIO_PARALLELBUS_H + +#include "common-hal/digitalio/DigitalInOut.h" + +typedef struct { + mp_obj_base_t base; +} displayio_parallelbus_obj_t; + +#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_DISPLAYIO_PARALLELBUS_H diff --git a/ports/stm32f4/mpconfigport.mk b/ports/stm32f4/mpconfigport.mk index 3ae0daaa08..88636a9d89 100644 --- a/ports/stm32f4/mpconfigport.mk +++ b/ports/stm32f4/mpconfigport.mk @@ -65,6 +65,9 @@ ifndef CIRCUITPY_NEOPIXEL_WRITE CIRCUITPY_NEOPIXEL_WRITE = 1 endif +ifndef +CIRCUITPY_DISPLAYIO = 1 +endif #ifeq ($(MCU_SUB_VARIANT), stm32f412zx) #endif From 238e12123690debaf2cf8488fb2a4d4003a06506 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 3 Dec 2019 14:50:37 -0600 Subject: [PATCH 138/189] protocols: Allow them to be (optionally) type-safe Protocols are nice, but there is no way for C code to verify whether a type's "protocol" structure actually implements some particular protocol. As a result, you can pass an object that implements the "vfs" protocol to one that expects the "stream" protocol, and the opposite of awesomeness ensues. This patch adds an OPTIONAL (but enabled by default) protocol identifier as the first member of any protocol structure. This identifier is simply a unique QSTR chosen by the protocol designer and used by each protocol implementer. When checking for protocol support, instead of just checking whether the object's type has a non-NULL protocol field, use `mp_proto_get` which implements the protocol check when possible. The existing protocols are now named: protocol_framebuf protocol_i2c protocol_pin protocol_stream protocol_spi protocol_vfs (most of these are unused in CP and are just inherited from MP; vfs and stream are definitely used though) I did not find any crashing examples, but here's one to give a flavor of what is improved, using `micropython_coverage`. Before the change, the vfs "ioctl" protocol is invoked, and the result is not intelligible as json (but it could have resulted in a hard fault, potentially): >>> import uos, ujson >>> u = uos.VfsPosix('/tmp') >>> ujson.load(u) Traceback (most recent call last): File "", line 1, in ValueError: syntax error in JSON After the change, the vfs object is correctly detected as not supporting the stream protocol: >>> ujson.load(p) Traceback (most recent call last): File "", line 1, in OSError: stream operation not supported --- extmod/machine_i2c.c | 21 ++++---- extmod/machine_i2c.h | 2 + extmod/machine_pinbase.c | 1 + extmod/machine_signal.c | 8 +-- extmod/machine_spi.c | 7 +-- extmod/machine_spi.h | 2 + extmod/modframebuf.c | 16 +++--- extmod/modlwip.c | 1 + extmod/modussl_axtls.c | 1 + extmod/modussl_mbedtls.c | 1 + extmod/moduzlib.c | 1 + extmod/modwebrepl.c | 1 + extmod/modwebsocket.c | 1 + extmod/vfs.c | 2 +- extmod/vfs.h | 2 + extmod/vfs_fat.c | 1 + extmod/vfs_fat_file.c | 2 + extmod/vfs_posix.c | 1 + extmod/vfs_posix_file.c | 2 + extmod/virtpin.c | 5 +- extmod/virtpin.h | 2 + lib/utils/sys_stdio_mphal.c | 2 + ports/unix/coverage.c | 2 + ports/unix/file.c | 2 + ports/unix/modusocket.c | 1 + py/modio.c | 2 + py/objstringio.c | 2 + py/proto.c | 50 +++++++++++++++++++ py/proto.h | 43 ++++++++++++++++ py/py.mk | 1 + py/stream.c | 11 ++-- py/stream.h | 4 +- shared-bindings/_bleio/CharacteristicBuffer.c | 1 + shared-bindings/busio/UART.c | 1 + shared-bindings/socket/__init__.c | 1 + shared-bindings/terminalio/Terminal.c | 1 + shared-bindings/usb_midi/PortIn.c | 1 + shared-bindings/usb_midi/PortOut.c | 1 + 38 files changed, 170 insertions(+), 36 deletions(-) create mode 100644 py/proto.c create mode 100644 py/proto.h diff --git a/extmod/machine_i2c.c b/extmod/machine_i2c.c index 85b46a9f6b..4129ace0a0 100644 --- a/extmod/machine_i2c.c +++ b/extmod/machine_i2c.c @@ -318,7 +318,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(machine_i2c_init_obj, 1, machine_i2c_obj_init); STATIC mp_obj_t machine_i2c_scan(mp_obj_t self_in) { mp_obj_base_t *self = MP_OBJ_TO_PTR(self_in); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)self->type->protocol; + mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); mp_obj_t list = mp_obj_new_list(0, NULL); // 7-bit addresses 0b0000xxx and 0b1111xxx are reserved for (int addr = 0x08; addr < 0x78; ++addr) { @@ -333,7 +333,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(machine_i2c_scan_obj, machine_i2c_scan); STATIC mp_obj_t machine_i2c_start(mp_obj_t self_in) { mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(self_in); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)self->type->protocol; + mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); if (i2c_p->start == NULL) { mp_raise_msg(&mp_type_OSError, translate("I2C operation not supported")); } @@ -347,7 +347,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(machine_i2c_start_obj, machine_i2c_start); STATIC mp_obj_t machine_i2c_stop(mp_obj_t self_in) { mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(self_in); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)self->type->protocol; + mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); if (i2c_p->stop == NULL) { mp_raise_msg(&mp_type_OSError, translate("I2C operation not supported")); } @@ -361,7 +361,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(machine_i2c_stop_obj, machine_i2c_stop); STATIC mp_obj_t machine_i2c_readinto(size_t n_args, const mp_obj_t *args) { mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(args[0]); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)self->type->protocol; + mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); if (i2c_p->read == NULL) { mp_raise_msg(&mp_type_OSError, translate("I2C operation not supported")); } @@ -385,7 +385,7 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_i2c_readinto_obj, 2, 3, machine_i2c_ STATIC mp_obj_t machine_i2c_write(mp_obj_t self_in, mp_obj_t buf_in) { mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(self_in); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)self->type->protocol; + mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); if (i2c_p->write == NULL) { mp_raise_msg(&mp_type_OSError, translate("I2C operation not supported")); } @@ -407,7 +407,7 @@ MP_DEFINE_CONST_FUN_OBJ_2(machine_i2c_write_obj, machine_i2c_write); STATIC mp_obj_t machine_i2c_readfrom(size_t n_args, const mp_obj_t *args) { mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(args[0]); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)self->type->protocol; + mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); mp_int_t addr = mp_obj_get_int(args[1]); vstr_t vstr; vstr_init_len(&vstr, mp_obj_get_int(args[2])); @@ -422,7 +422,7 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_i2c_readfrom_obj, 3, 4, machine_i2c_ STATIC mp_obj_t machine_i2c_readfrom_into(size_t n_args, const mp_obj_t *args) { mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(args[0]); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)self->type->protocol; + mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); mp_int_t addr = mp_obj_get_int(args[1]); mp_buffer_info_t bufinfo; mp_get_buffer_raise(args[2], &bufinfo, MP_BUFFER_WRITE); @@ -437,7 +437,7 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_i2c_readfrom_into_obj, 3, 4, machine STATIC mp_obj_t machine_i2c_writeto(size_t n_args, const mp_obj_t *args) { mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(args[0]); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)self->type->protocol; + mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); mp_int_t addr = mp_obj_get_int(args[1]); mp_buffer_info_t bufinfo; mp_get_buffer_raise(args[2], &bufinfo, MP_BUFFER_READ); @@ -453,7 +453,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_i2c_writeto_obj, 3, 4, machin STATIC int read_mem(mp_obj_t self_in, uint16_t addr, uint32_t memaddr, uint8_t addrsize, uint8_t *buf, size_t len) { mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(self_in); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)self->type->protocol; + mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); uint8_t memaddr_buf[4]; size_t memaddr_len = 0; for (int16_t i = addrsize - 8; i >= 0; i -= 8) { @@ -473,7 +473,7 @@ STATIC int read_mem(mp_obj_t self_in, uint16_t addr, uint32_t memaddr, uint8_t a STATIC int write_mem(mp_obj_t self_in, uint16_t addr, uint32_t memaddr, uint8_t addrsize, const uint8_t *buf, size_t len) { mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(self_in); - mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)self->type->protocol; + mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)mp_proto_get(self, QSTR_protocol_i2c); // need some memory to create the buffer to send; try to use stack if possible uint8_t buf2_stack[MAX_MEMADDR_SIZE + BUF_STACK_SIZE]; @@ -621,6 +621,7 @@ int mp_machine_soft_i2c_write(mp_obj_base_t *self_in, const uint8_t *src, size_t } STATIC const mp_machine_i2c_p_t mp_machine_soft_i2c_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_i2c) .start = (int(*)(mp_obj_base_t*))mp_hal_i2c_start, .stop = (int(*)(mp_obj_base_t*))mp_hal_i2c_stop, .read = mp_machine_soft_i2c_read, diff --git a/extmod/machine_i2c.h b/extmod/machine_i2c.h index f5af6656f5..7f5ee568e3 100644 --- a/extmod/machine_i2c.h +++ b/extmod/machine_i2c.h @@ -27,10 +27,12 @@ #define MICROPY_INCLUDED_EXTMOD_MACHINE_I2C_H #include "py/obj.h" +#include "py/proto.h" // I2C protocol // the first 4 methods can be NULL, meaning operation is not supported typedef struct _mp_machine_i2c_p_t { + MP_PROTOCOL_HEAD int (*start)(mp_obj_base_t *obj); int (*stop)(mp_obj_base_t *obj); int (*read)(mp_obj_base_t *obj, uint8_t *dest, size_t len, bool nack); diff --git a/extmod/machine_pinbase.c b/extmod/machine_pinbase.c index 997a6fd991..6cd14c187e 100644 --- a/extmod/machine_pinbase.c +++ b/extmod/machine_pinbase.c @@ -74,6 +74,7 @@ mp_uint_t pinbase_ioctl(mp_obj_t obj, mp_uint_t request, uintptr_t arg, int *err } STATIC const mp_pin_p_t pinbase_pin_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_pin) .ioctl = pinbase_ioctl, }; diff --git a/extmod/machine_signal.c b/extmod/machine_signal.c index 62658cbb17..50501e34fe 100644 --- a/extmod/machine_signal.c +++ b/extmod/machine_signal.c @@ -47,12 +47,7 @@ STATIC mp_obj_t signal_make_new(const mp_obj_type_t *type, size_t n_args, const bool invert = false; #if defined(MICROPY_PY_MACHINE_PIN_MAKE_NEW) - mp_pin_p_t *pin_p = NULL; - - if (MP_OBJ_IS_OBJ(pin)) { - mp_obj_base_t *pin_base = (mp_obj_base_t*)MP_OBJ_TO_PTR(args[0]); - pin_p = (mp_pin_p_t*)pin_base->type->protocol; - } + mp_pin_p_t *pin_p = (mp_pin_t*)mp_proto_get(QSTR_pin_protocol, pin); if (pin_p == NULL) { // If first argument isn't a Pin-like object, we filter out "invert" @@ -170,6 +165,7 @@ STATIC const mp_rom_map_elem_t signal_locals_dict_table[] = { STATIC MP_DEFINE_CONST_DICT(signal_locals_dict, signal_locals_dict_table); STATIC const mp_pin_p_t signal_pin_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_pin) .ioctl = signal_ioctl, }; diff --git a/extmod/machine_spi.c b/extmod/machine_spi.c index c5707a3d0b..4ead321d90 100644 --- a/extmod/machine_spi.c +++ b/extmod/machine_spi.c @@ -67,7 +67,7 @@ mp_obj_t mp_machine_spi_make_new(const mp_obj_type_t *type, size_t n_args, const STATIC mp_obj_t machine_spi_init(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { mp_obj_base_t *s = (mp_obj_base_t*)MP_OBJ_TO_PTR(args[0]); - mp_machine_spi_p_t *spi_p = (mp_machine_spi_p_t*)s->type->protocol; + mp_machine_spi_p_t *spi_p = (mp_machine_spi_p_t*)mp_proto_get(QSTR_protocol_spi, s); spi_p->init(s, n_args - 1, args + 1, kw_args); return mp_const_none; } @@ -75,7 +75,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(machine_spi_init_obj, 1, machine_spi_init); STATIC mp_obj_t machine_spi_deinit(mp_obj_t self) { mp_obj_base_t *s = (mp_obj_base_t*)MP_OBJ_TO_PTR(self); - mp_machine_spi_p_t *spi_p = (mp_machine_spi_p_t*)s->type->protocol; + mp_machine_spi_p_t *spi_p = (mp_machine_spi_p_t*)mp_proto_get(QSTR_protocol_spi, s); if (spi_p->deinit != NULL) { spi_p->deinit(s); } @@ -85,7 +85,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(machine_spi_deinit_obj, machine_spi_deinit); STATIC void mp_machine_spi_transfer(mp_obj_t self, size_t len, const void *src, void *dest) { mp_obj_base_t *s = (mp_obj_base_t*)MP_OBJ_TO_PTR(self); - mp_machine_spi_p_t *spi_p = (mp_machine_spi_p_t*)s->type->protocol; + mp_machine_spi_p_t *spi_p = (mp_machine_spi_p_t*)mp_proto_get(QSTR_protocol_spi, s); spi_p->transfer(s, len, src, dest); } @@ -268,6 +268,7 @@ STATIC void mp_machine_soft_spi_transfer(mp_obj_base_t *self_in, size_t len, con } const mp_machine_spi_p_t mp_machine_soft_spi_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_spi) .init = mp_machine_soft_spi_init, .deinit = NULL, .transfer = mp_machine_soft_spi_transfer, diff --git a/extmod/machine_spi.h b/extmod/machine_spi.h index db21e1cd31..365b44d6e8 100644 --- a/extmod/machine_spi.h +++ b/extmod/machine_spi.h @@ -27,11 +27,13 @@ #define MICROPY_INCLUDED_EXTMOD_MACHINE_SPI_H #include "py/obj.h" +#include "py/proto.h" #include "py/mphal.h" #include "drivers/bus/spi.h" // SPI protocol typedef struct _mp_machine_spi_p_t { + MP_PROTOCOL_HEAD void (*init)(mp_obj_base_t *obj, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args); void (*deinit)(mp_obj_base_t *obj); // can be NULL void (*transfer)(mp_obj_base_t *obj, size_t len, const uint8_t *src, uint8_t *dest); diff --git a/extmod/modframebuf.c b/extmod/modframebuf.c index 561b842bcc..a51d1c3804 100644 --- a/extmod/modframebuf.c +++ b/extmod/modframebuf.c @@ -28,6 +28,7 @@ #include #include "py/runtime.h" +#include "py/proto.h" #if MICROPY_PY_FRAMEBUF @@ -46,6 +47,7 @@ typedef uint32_t (*getpixel_t)(const mp_obj_framebuf_t*, int, int); typedef void (*fill_rect_t)(const mp_obj_framebuf_t *, int, int, int, int, uint32_t); typedef struct _mp_framebuf_p_t { + MP_PROTOCOL_HEAD setpixel_t setpixel; getpixel_t getpixel; fill_rect_t fill_rect; @@ -227,13 +229,13 @@ STATIC void gs8_fill_rect(const mp_obj_framebuf_t *fb, int x, int y, int w, int } STATIC mp_framebuf_p_t formats[] = { - [FRAMEBUF_MVLSB] = {mvlsb_setpixel, mvlsb_getpixel, mvlsb_fill_rect}, - [FRAMEBUF_RGB565] = {rgb565_setpixel, rgb565_getpixel, rgb565_fill_rect}, - [FRAMEBUF_GS2_HMSB] = {gs2_hmsb_setpixel, gs2_hmsb_getpixel, gs2_hmsb_fill_rect}, - [FRAMEBUF_GS4_HMSB] = {gs4_hmsb_setpixel, gs4_hmsb_getpixel, gs4_hmsb_fill_rect}, - [FRAMEBUF_GS8] = {gs8_setpixel, gs8_getpixel, gs8_fill_rect}, - [FRAMEBUF_MHLSB] = {mono_horiz_setpixel, mono_horiz_getpixel, mono_horiz_fill_rect}, - [FRAMEBUF_MHMSB] = {mono_horiz_setpixel, mono_horiz_getpixel, mono_horiz_fill_rect}, + [FRAMEBUF_MVLSB] = {MP_PROTO_IMPLEMENT(MP_QSTR_protocol_framebuf) mvlsb_setpixel, mvlsb_getpixel, mvlsb_fill_rect}, + [FRAMEBUF_RGB565] = {MP_PROTO_IMPLEMENT(MP_QSTR_protocol_framebuf) rgb565_setpixel, rgb565_getpixel, rgb565_fill_rect}, + [FRAMEBUF_GS2_HMSB] = {MP_PROTO_IMPLEMENT(MP_QSTR_protocol_framebuf) gs2_hmsb_setpixel, gs2_hmsb_getpixel, gs2_hmsb_fill_rect}, + [FRAMEBUF_GS4_HMSB] = {MP_PROTO_IMPLEMENT(MP_QSTR_protocol_framebuf) gs4_hmsb_setpixel, gs4_hmsb_getpixel, gs4_hmsb_fill_rect}, + [FRAMEBUF_GS8] = {MP_PROTO_IMPLEMENT(MP_QSTR_protocol_framebuf) gs8_setpixel, gs8_getpixel, gs8_fill_rect}, + [FRAMEBUF_MHLSB] = {MP_PROTO_IMPLEMENT(MP_QSTR_protocol_framebuf) mono_horiz_setpixel, mono_horiz_getpixel, mono_horiz_fill_rect}, + [FRAMEBUF_MHMSB] = {MP_PROTO_IMPLEMENT(MP_QSTR_protocol_framebuf) mono_horiz_setpixel, mono_horiz_getpixel, mono_horiz_fill_rect}, }; static inline void setpixel(const mp_obj_framebuf_t *fb, int x, int y, uint32_t col) { diff --git a/extmod/modlwip.c b/extmod/modlwip.c index e5e92c42b5..776b81ee51 100644 --- a/extmod/modlwip.c +++ b/extmod/modlwip.c @@ -1261,6 +1261,7 @@ STATIC const mp_rom_map_elem_t lwip_socket_locals_dict_table[] = { STATIC MP_DEFINE_CONST_DICT(lwip_socket_locals_dict, lwip_socket_locals_dict_table); STATIC const mp_stream_p_t lwip_socket_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = lwip_socket_read, .write = lwip_socket_write, .ioctl = lwip_socket_ioctl, diff --git a/extmod/modussl_axtls.c b/extmod/modussl_axtls.c index cfa6525853..032dea09fd 100644 --- a/extmod/modussl_axtls.c +++ b/extmod/modussl_axtls.c @@ -221,6 +221,7 @@ STATIC const mp_rom_map_elem_t ussl_socket_locals_dict_table[] = { STATIC MP_DEFINE_CONST_DICT(ussl_socket_locals_dict, ussl_socket_locals_dict_table); STATIC const mp_stream_p_t ussl_socket_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = socket_read, .write = socket_write, .ioctl = socket_ioctl, diff --git a/extmod/modussl_mbedtls.c b/extmod/modussl_mbedtls.c index 08807d20ba..9abdeb966e 100644 --- a/extmod/modussl_mbedtls.c +++ b/extmod/modussl_mbedtls.c @@ -305,6 +305,7 @@ STATIC const mp_rom_map_elem_t ussl_socket_locals_dict_table[] = { STATIC MP_DEFINE_CONST_DICT(ussl_socket_locals_dict, ussl_socket_locals_dict_table); STATIC const mp_stream_p_t ussl_socket_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = socket_read, .write = socket_write, .ioctl = socket_ioctl, diff --git a/extmod/moduzlib.c b/extmod/moduzlib.c index 7f15d02a8e..3a081bc452 100644 --- a/extmod/moduzlib.c +++ b/extmod/moduzlib.c @@ -134,6 +134,7 @@ STATIC const mp_rom_map_elem_t decompio_locals_dict_table[] = { STATIC MP_DEFINE_CONST_DICT(decompio_locals_dict, decompio_locals_dict_table); STATIC const mp_stream_p_t decompio_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = decompio_read, }; diff --git a/extmod/modwebrepl.c b/extmod/modwebrepl.c index 06da210d15..fb4d97358d 100644 --- a/extmod/modwebrepl.c +++ b/extmod/modwebrepl.c @@ -331,6 +331,7 @@ STATIC const mp_rom_map_elem_t webrepl_locals_dict_table[] = { STATIC MP_DEFINE_CONST_DICT(webrepl_locals_dict, webrepl_locals_dict_table); STATIC const mp_stream_p_t webrepl_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = webrepl_read, .write = webrepl_write, .ioctl = webrepl_ioctl, diff --git a/extmod/modwebsocket.c b/extmod/modwebsocket.c index 997c7e2625..496e4b5bb3 100644 --- a/extmod/modwebsocket.c +++ b/extmod/modwebsocket.c @@ -286,6 +286,7 @@ STATIC const mp_rom_map_elem_t websocket_locals_dict_table[] = { STATIC MP_DEFINE_CONST_DICT(websocket_locals_dict, websocket_locals_dict_table); STATIC const mp_stream_p_t websocket_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = websocket_read, .write = websocket_write, .ioctl = websocket_ioctl, diff --git a/extmod/vfs.c b/extmod/vfs.c index 7d6e6999bd..2bb4057e7e 100644 --- a/extmod/vfs.c +++ b/extmod/vfs.c @@ -126,7 +126,7 @@ mp_import_stat_t mp_vfs_import_stat(const char *path) { } // If the mounted object has the VFS protocol, call its import_stat helper - const mp_vfs_proto_t *proto = mp_obj_get_type(vfs->obj)->protocol; + const mp_vfs_proto_t *proto = (mp_vfs_proto_t*)mp_proto_get(MP_QSTR_protocol_vfs, vfs->obj); if (proto != NULL) { return proto->import_stat(MP_OBJ_TO_PTR(vfs->obj), path_out); } diff --git a/extmod/vfs.h b/extmod/vfs.h index 38c77943c7..6c0692365f 100644 --- a/extmod/vfs.h +++ b/extmod/vfs.h @@ -28,6 +28,7 @@ #include "py/lexer.h" #include "py/obj.h" +#include "py/proto.h" // return values of mp_vfs_lookup_path // ROOT is 0 so that the default current directory is the root directory @@ -47,6 +48,7 @@ // At the moment the VFS protocol just has import_stat, but could be extended to other methods typedef struct _mp_vfs_proto_t { + MP_PROTOCOL_HEAD mp_import_stat_t (*import_stat)(void *self, const char *path); } mp_vfs_proto_t; diff --git a/extmod/vfs_fat.c b/extmod/vfs_fat.c index 20d3e3e5ce..60f4393f43 100644 --- a/extmod/vfs_fat.c +++ b/extmod/vfs_fat.c @@ -488,6 +488,7 @@ STATIC const mp_rom_map_elem_t fat_vfs_locals_dict_table[] = { STATIC MP_DEFINE_CONST_DICT(fat_vfs_locals_dict, fat_vfs_locals_dict_table); STATIC const mp_vfs_proto_t fat_vfs_proto = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_vfs) .import_stat = fat_vfs_import_stat, }; diff --git a/extmod/vfs_fat_file.c b/extmod/vfs_fat_file.c index 6aad1884cb..3ea9cee529 100644 --- a/extmod/vfs_fat_file.c +++ b/extmod/vfs_fat_file.c @@ -254,6 +254,7 @@ STATIC MP_DEFINE_CONST_DICT(rawfile_locals_dict, rawfile_locals_dict_table); #if MICROPY_PY_IO_FILEIO STATIC const mp_stream_p_t fileio_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = file_obj_read, .write = file_obj_write, .ioctl = file_obj_ioctl, @@ -272,6 +273,7 @@ const mp_obj_type_t mp_type_vfs_fat_fileio = { #endif STATIC const mp_stream_p_t textio_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = file_obj_read, .write = file_obj_write, .ioctl = file_obj_ioctl, diff --git a/extmod/vfs_posix.c b/extmod/vfs_posix.c index d28dfe4516..56a5de303d 100644 --- a/extmod/vfs_posix.c +++ b/extmod/vfs_posix.c @@ -350,6 +350,7 @@ STATIC const mp_rom_map_elem_t vfs_posix_locals_dict_table[] = { STATIC MP_DEFINE_CONST_DICT(vfs_posix_locals_dict, vfs_posix_locals_dict_table); STATIC const mp_vfs_proto_t vfs_posix_proto = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_vfs) .import_stat = mp_vfs_posix_import_stat, }; diff --git a/extmod/vfs_posix_file.c b/extmod/vfs_posix_file.c index b760b38474..be455fa281 100644 --- a/extmod/vfs_posix_file.c +++ b/extmod/vfs_posix_file.c @@ -220,6 +220,7 @@ STATIC MP_DEFINE_CONST_DICT(rawfile_locals_dict, rawfile_locals_dict_table); #if MICROPY_PY_IO_FILEIO STATIC const mp_stream_p_t fileio_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = vfs_posix_file_read, .write = vfs_posix_file_write, .ioctl = vfs_posix_file_ioctl, @@ -238,6 +239,7 @@ const mp_obj_type_t mp_type_vfs_posix_fileio = { #endif STATIC const mp_stream_p_t textio_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = vfs_posix_file_read, .write = vfs_posix_file_write, .ioctl = vfs_posix_file_ioctl, diff --git a/extmod/virtpin.c b/extmod/virtpin.c index dbfa21d669..559f992650 100644 --- a/extmod/virtpin.c +++ b/extmod/virtpin.c @@ -25,15 +25,16 @@ */ #include "extmod/virtpin.h" +#include "py/proto.h" int mp_virtual_pin_read(mp_obj_t pin) { mp_obj_base_t* s = (mp_obj_base_t*)MP_OBJ_TO_PTR(pin); - mp_pin_p_t *pin_p = (mp_pin_p_t*)s->type->protocol; + const mp_pin_p_t *pin_p = mp_proto_get(MP_QSTR_protocol_pin, s); return pin_p->ioctl(pin, MP_PIN_READ, 0, NULL); } void mp_virtual_pin_write(mp_obj_t pin, int value) { mp_obj_base_t* s = (mp_obj_base_t*)MP_OBJ_TO_PTR(pin); - mp_pin_p_t *pin_p = (mp_pin_p_t*)s->type->protocol; + const mp_pin_p_t *pin_p = mp_proto_get(MP_QSTR_protocol_pin, s); pin_p->ioctl(pin, MP_PIN_WRITE, value, NULL); } diff --git a/extmod/virtpin.h b/extmod/virtpin.h index 706affc192..591249e48d 100644 --- a/extmod/virtpin.h +++ b/extmod/virtpin.h @@ -27,6 +27,7 @@ #define MICROPY_INCLUDED_EXTMOD_VIRTPIN_H #include "py/obj.h" +#include "py/proto.h" #define MP_PIN_READ (1) #define MP_PIN_WRITE (2) @@ -35,6 +36,7 @@ // Pin protocol typedef struct _mp_pin_p_t { + MP_PROTOCOL_HEAD mp_uint_t (*ioctl)(mp_obj_t obj, mp_uint_t request, uintptr_t arg, int *errcode); } mp_pin_p_t; diff --git a/lib/utils/sys_stdio_mphal.c b/lib/utils/sys_stdio_mphal.c index 266783f376..c1607dfe8c 100644 --- a/lib/utils/sys_stdio_mphal.c +++ b/lib/utils/sys_stdio_mphal.c @@ -123,6 +123,7 @@ STATIC const mp_rom_map_elem_t stdio_locals_dict_table[] = { STATIC MP_DEFINE_CONST_DICT(stdio_locals_dict, stdio_locals_dict_table); STATIC const mp_stream_p_t stdio_obj_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = stdio_read, .write = stdio_write, .ioctl = stdio_ioctl, @@ -158,6 +159,7 @@ STATIC mp_uint_t stdio_buffer_write(mp_obj_t self_in, const void *buf, mp_uint_t } STATIC const mp_stream_p_t stdio_buffer_obj_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = stdio_buffer_read, .write = stdio_buffer_write, .is_text = false, diff --git a/ports/unix/coverage.c b/ports/unix/coverage.c index 841924c58d..849820fffd 100644 --- a/ports/unix/coverage.c +++ b/ports/unix/coverage.c @@ -96,6 +96,7 @@ STATIC const mp_rom_map_elem_t rawfile_locals_dict_table[] = { STATIC MP_DEFINE_CONST_DICT(rawfile_locals_dict, rawfile_locals_dict_table); STATIC const mp_stream_p_t fileio_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = stest_read, .write = stest_write, .ioctl = stest_ioctl, @@ -123,6 +124,7 @@ STATIC const mp_rom_map_elem_t rawfile_locals_dict_table2[] = { STATIC MP_DEFINE_CONST_DICT(rawfile_locals_dict2, rawfile_locals_dict_table2); STATIC const mp_stream_p_t textio_stream_p2 = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = stest_read2, .write = NULL, .is_text = true, diff --git a/ports/unix/file.c b/ports/unix/file.c index c0cf6dcc43..e5c73d26c2 100644 --- a/ports/unix/file.c +++ b/ports/unix/file.c @@ -230,6 +230,7 @@ STATIC MP_DEFINE_CONST_DICT(rawfile_locals_dict, rawfile_locals_dict_table); #if MICROPY_PY_IO_FILEIO STATIC const mp_stream_p_t fileio_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = fdfile_read, .write = fdfile_write, .ioctl = fdfile_ioctl, @@ -248,6 +249,7 @@ const mp_obj_type_t mp_type_fileio = { #endif STATIC const mp_stream_p_t textio_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = fdfile_read, .write = fdfile_write, .ioctl = fdfile_ioctl, diff --git a/ports/unix/modusocket.c b/ports/unix/modusocket.c index 84e9298fd3..95da276ed9 100644 --- a/ports/unix/modusocket.c +++ b/ports/unix/modusocket.c @@ -374,6 +374,7 @@ STATIC const mp_rom_map_elem_t usocket_locals_dict_table[] = { STATIC MP_DEFINE_CONST_DICT(usocket_locals_dict, usocket_locals_dict_table); STATIC const mp_stream_p_t usocket_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = socket_read, .write = socket_write, .ioctl = socket_ioctl, diff --git a/py/modio.c b/py/modio.c index d7c1a58a8c..17840a6d87 100644 --- a/py/modio.c +++ b/py/modio.c @@ -90,6 +90,7 @@ STATIC mp_uint_t iobase_ioctl(mp_obj_t obj, mp_uint_t request, uintptr_t arg, in } STATIC const mp_stream_p_t iobase_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = iobase_read, .write = iobase_write, .ioctl = iobase_ioctl, @@ -185,6 +186,7 @@ STATIC const mp_rom_map_elem_t bufwriter_locals_dict_table[] = { STATIC MP_DEFINE_CONST_DICT(bufwriter_locals_dict, bufwriter_locals_dict_table); STATIC const mp_stream_p_t bufwriter_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .write = bufwriter_write, }; diff --git a/py/objstringio.c b/py/objstringio.c index d2ca6decdb..178e6446cc 100644 --- a/py/objstringio.c +++ b/py/objstringio.c @@ -240,6 +240,7 @@ STATIC const mp_rom_map_elem_t stringio_locals_dict_table[] = { STATIC MP_DEFINE_CONST_DICT(stringio_locals_dict, stringio_locals_dict_table); STATIC const mp_stream_p_t stringio_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = stringio_read, .write = stringio_write, .ioctl = stringio_ioctl, @@ -247,6 +248,7 @@ STATIC const mp_stream_p_t stringio_stream_p = { }; STATIC const mp_stream_p_t bytesio_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = stringio_read, .write = stringio_write, .ioctl = stringio_ioctl, diff --git a/py/proto.c b/py/proto.c new file mode 100644 index 0000000000..030b62674e --- /dev/null +++ b/py/proto.c @@ -0,0 +1,50 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 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 + * 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/proto.h" +#include "py/runtime.h" + +#ifndef MICROPY_UNSAFE_PROTO +const void *mp_proto_get(uint16_t name, mp_const_obj_t obj) { + mp_obj_type_t *type = mp_obj_get_type(obj); + if (!type->protocol) return NULL; + uint16_t proto_name = *(const uint16_t*) type->protocol; + if (proto_name == name) { + return type->protocol; + } + return NULL; +} +#endif + +const void *mp_proto_get_or_throw(uint16_t name, mp_const_obj_t obj) { + const void *proto = mp_proto_get(name, obj); + if (proto) { + return proto; + } + mp_raise_TypeError_varg(translate("'%s' object does not support '%s'"), + mp_obj_get_type_str(obj), qstr_str(name)); +} diff --git a/py/proto.h b/py/proto.h new file mode 100644 index 0000000000..2d4f805659 --- /dev/null +++ b/py/proto.h @@ -0,0 +1,43 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 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 + * 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_PY_PROTO_H +#define MICROPY_INCLUDED_PY_PROTO_H + +#ifdef MICROPY_UNSAFE_PROTO +#define MP_PROTOCOL_HEAD /* NOTHING */ +#define MP_PROTO_IMPLEMENT(name) /* NOTHING */ +static inline void *mp_proto_get(uint16_t name, mp_const_obj_type_t obj) { return mp_obj_get_type(obj)->protocol; } +#else +#define MP_PROTOCOL_HEAD \ + uint16_t name; // The name of this protocol, a qstr +#define MP_PROTO_IMPLEMENT(n) .name = n, +const void *mp_proto_get(uint16_t name, mp_const_obj_t obj); +const void *mp_proto_get_or_throw(uint16_t name, mp_const_obj_t obj); +#endif + +#endif + diff --git a/py/py.mk b/py/py.mk index 17cb792646..ae9b005b6c 100644 --- a/py/py.mk +++ b/py/py.mk @@ -214,6 +214,7 @@ PY_CORE_O_BASENAME = $(addprefix py/,\ objtype.o \ objzip.o \ opmethods.o \ + proto.o \ reload.o \ sequence.o \ stream.o \ diff --git a/py/stream.c b/py/stream.c index 1d25f64706..2ff2b76a61 100644 --- a/py/stream.c +++ b/py/stream.c @@ -86,8 +86,7 @@ mp_uint_t mp_stream_rw(mp_obj_t stream, void *buf_, mp_uint_t size, int *errcode } const mp_stream_p_t *mp_get_stream_raise(mp_obj_t self_in, int flags) { - mp_obj_type_t *type = mp_obj_get_type(self_in); - const mp_stream_p_t *stream_p = type->protocol; + const mp_stream_p_t *stream_p = mp_proto_get(MP_QSTR_protocol_stream, self_in); if (stream_p == NULL || ((flags & MP_STREAM_OP_READ) && stream_p->read == NULL) || ((flags & MP_STREAM_OP_WRITE) && stream_p->write == NULL) @@ -522,7 +521,7 @@ int mp_stream_errno; ssize_t mp_stream_posix_write(mp_obj_t stream, const void *buf, size_t len) { mp_obj_base_t* o = (mp_obj_base_t*)MP_OBJ_TO_PTR(stream); - const mp_stream_p_t *stream_p = o->type->protocol; + const mp_stream_p_t *stream_p = mp_get_stream(o); mp_uint_t out_sz = stream_p->write(stream, buf, len, &mp_stream_errno); if (out_sz == MP_STREAM_ERROR) { return -1; @@ -533,7 +532,7 @@ ssize_t mp_stream_posix_write(mp_obj_t stream, const void *buf, size_t len) { ssize_t mp_stream_posix_read(mp_obj_t stream, void *buf, size_t len) { mp_obj_base_t* o = (mp_obj_base_t*)MP_OBJ_TO_PTR(stream); - const mp_stream_p_t *stream_p = o->type->protocol; + const mp_stream_p_t *stream_p = mp_get_stream(o); mp_uint_t out_sz = stream_p->read(stream, buf, len, &mp_stream_errno); if (out_sz == MP_STREAM_ERROR) { return -1; @@ -544,7 +543,7 @@ ssize_t mp_stream_posix_read(mp_obj_t stream, void *buf, size_t len) { off_t mp_stream_posix_lseek(mp_obj_t stream, off_t offset, int whence) { const mp_obj_base_t* o = (mp_obj_base_t*)MP_OBJ_TO_PTR(stream); - const mp_stream_p_t *stream_p = o->type->protocol; + const mp_stream_p_t *stream_p = mp_get_stream(o); struct mp_stream_seek_t seek_s; seek_s.offset = offset; seek_s.whence = whence; @@ -557,7 +556,7 @@ off_t mp_stream_posix_lseek(mp_obj_t stream, off_t offset, int whence) { int mp_stream_posix_fsync(mp_obj_t stream) { mp_obj_base_t* o = (mp_obj_base_t*)MP_OBJ_TO_PTR(stream); - const mp_stream_p_t *stream_p = o->type->protocol; + const mp_stream_p_t *stream_p = mp_get_stream(o); mp_uint_t res = stream_p->ioctl(stream, MP_STREAM_FLUSH, 0, &mp_stream_errno); if (res == MP_STREAM_ERROR) { return -1; diff --git a/py/stream.h b/py/stream.h index 03e24c7469..543fe8c82a 100644 --- a/py/stream.h +++ b/py/stream.h @@ -27,6 +27,7 @@ #define MICROPY_INCLUDED_PY_STREAM_H #include "py/obj.h" +#include "py/proto.h" #include "py/mperrno.h" #define MP_STREAM_ERROR ((mp_uint_t)-1) @@ -64,6 +65,7 @@ struct mp_stream_seek_t { // Stream protocol typedef struct _mp_stream_p_t { + MP_PROTOCOL_HEAD // On error, functions should return MP_STREAM_ERROR and fill in *errcode (values // are implementation-dependent, but will be exposed to user, e.g. via exception). mp_uint_t (*read)(mp_obj_t obj, void *buf, mp_uint_t size, int *errcode); @@ -93,7 +95,7 @@ MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_stream_ioctl_obj); // Object is assumed to have a non-NULL stream protocol with valid r/w/ioctl methods static inline const mp_stream_p_t *mp_get_stream(mp_const_obj_t self) { - return (const mp_stream_p_t*)((const mp_obj_base_t*)MP_OBJ_TO_PTR(self))->type->protocol; + return mp_proto_get(MP_QSTR_protocol_stream, self); } const mp_stream_p_t *mp_get_stream_raise(mp_obj_t self_in, int flags); diff --git a/shared-bindings/_bleio/CharacteristicBuffer.c b/shared-bindings/_bleio/CharacteristicBuffer.c index e7524da2d5..fc95d0d503 100644 --- a/shared-bindings/_bleio/CharacteristicBuffer.c +++ b/shared-bindings/_bleio/CharacteristicBuffer.c @@ -230,6 +230,7 @@ STATIC const mp_rom_map_elem_t bleio_characteristic_buffer_locals_dict_table[] = STATIC MP_DEFINE_CONST_DICT(bleio_characteristic_buffer_locals_dict, bleio_characteristic_buffer_locals_dict_table); STATIC const mp_stream_p_t characteristic_buffer_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = bleio_characteristic_buffer_read, .write = bleio_characteristic_buffer_write, .ioctl = bleio_characteristic_buffer_ioctl, diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 7a3b48e895..1fc81e78e2 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -398,6 +398,7 @@ STATIC const mp_rom_map_elem_t busio_uart_locals_dict_table[] = { STATIC MP_DEFINE_CONST_DICT(busio_uart_locals_dict, busio_uart_locals_dict_table); STATIC const mp_stream_p_t uart_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = busio_uart_read, .write = busio_uart_write, .ioctl = busio_uart_ioctl, diff --git a/shared-bindings/socket/__init__.c b/shared-bindings/socket/__init__.c index 6d04a98936..2d6c16e90f 100644 --- a/shared-bindings/socket/__init__.c +++ b/shared-bindings/socket/__init__.c @@ -500,6 +500,7 @@ mp_uint_t socket_ioctl(mp_obj_t self_in, mp_uint_t request, uintptr_t arg, int * } STATIC const mp_stream_p_t socket_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .ioctl = socket_ioctl, .is_text = false, }; diff --git a/shared-bindings/terminalio/Terminal.c b/shared-bindings/terminalio/Terminal.c index cdde672d3a..9c01fba20b 100644 --- a/shared-bindings/terminalio/Terminal.c +++ b/shared-bindings/terminalio/Terminal.c @@ -112,6 +112,7 @@ STATIC const mp_rom_map_elem_t terminalio_terminal_locals_dict_table[] = { STATIC MP_DEFINE_CONST_DICT(terminalio_terminal_locals_dict, terminalio_terminal_locals_dict_table); STATIC const mp_stream_p_t terminalio_terminal_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = NULL, .write = terminalio_terminal_write, .ioctl = terminalio_terminal_ioctl, diff --git a/shared-bindings/usb_midi/PortIn.c b/shared-bindings/usb_midi/PortIn.c index 356a81d52c..e2df56e954 100644 --- a/shared-bindings/usb_midi/PortIn.c +++ b/shared-bindings/usb_midi/PortIn.c @@ -107,6 +107,7 @@ STATIC const mp_rom_map_elem_t usb_midi_portin_locals_dict_table[] = { STATIC MP_DEFINE_CONST_DICT(usb_midi_portin_locals_dict, usb_midi_portin_locals_dict_table); STATIC const mp_stream_p_t usb_midi_portin_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = usb_midi_portin_read, .write = NULL, .ioctl = usb_midi_portin_ioctl, diff --git a/shared-bindings/usb_midi/PortOut.c b/shared-bindings/usb_midi/PortOut.c index 6f4ce67165..e3eddfaf57 100644 --- a/shared-bindings/usb_midi/PortOut.c +++ b/shared-bindings/usb_midi/PortOut.c @@ -89,6 +89,7 @@ STATIC const mp_rom_map_elem_t usb_midi_portout_locals_dict_table[] = { STATIC MP_DEFINE_CONST_DICT(usb_midi_portout_locals_dict, usb_midi_portout_locals_dict_table); STATIC const mp_stream_p_t usb_midi_portout_stream_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = NULL, .write = usb_midi_portout_write, .ioctl = usb_midi_portout_ioctl, From feb8eb935bd69ce855533bf9a4316e3025602c1a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 4 Dec 2019 09:31:52 -0600 Subject: [PATCH 139/189] audiosample: convert to use a protocol This eases addition of new sample sources, since the manual virtual function dispatch functions are just calls via a protocol --- shared-bindings/audiocore/RawSample.c | 11 ++++ shared-bindings/audiocore/RawSample.h | 2 + shared-bindings/audiocore/WaveFile.c | 12 ++++ shared-bindings/audiomixer/Mixer.c | 11 ++++ shared-bindings/audiomixer/Mixer.h | 2 + shared-module/audiocore/RawSample.c | 6 ++ shared-module/audiocore/__init__.c | 92 ++++----------------------- shared-module/audiocore/__init__.h | 35 ++++++++-- shared-module/audiomixer/Mixer.c | 8 +++ 9 files changed, 94 insertions(+), 85 deletions(-) diff --git a/shared-bindings/audiocore/RawSample.c b/shared-bindings/audiocore/RawSample.c index 07f8c683f2..87d410ea1a 100644 --- a/shared-bindings/audiocore/RawSample.c +++ b/shared-bindings/audiocore/RawSample.c @@ -180,9 +180,20 @@ STATIC const mp_rom_map_elem_t audioio_rawsample_locals_dict_table[] = { }; STATIC MP_DEFINE_CONST_DICT(audioio_rawsample_locals_dict, audioio_rawsample_locals_dict_table); +STATIC const audiosample_p_t audioio_rawsample_proto = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_audiosample) + .sample_rate = (audiosample_sample_rate_fun)common_hal_audioio_rawsample_get_sample_rate, + .bits_per_sample = (audiosample_bits_per_sample_fun)common_hal_audioio_rawsample_get_bits_per_sample, + .channel_count = (audiosample_channel_count_fun)common_hal_audioio_rawsample_get_channel_count, + .reset_buffer = (audiosample_reset_buffer_fun)audioio_rawsample_reset_buffer, + .get_buffer = (audiosample_get_buffer_fun)audioio_rawsample_get_buffer, + .get_buffer_structure = (audiosample_get_buffer_structure_fun)audioio_rawsample_get_buffer_structure, +}; + const mp_obj_type_t audioio_rawsample_type = { { &mp_type_type }, .name = MP_QSTR_RawSample, .make_new = audioio_rawsample_make_new, .locals_dict = (mp_obj_dict_t*)&audioio_rawsample_locals_dict, + .protocol = &audioio_rawsample_proto, }; diff --git a/shared-bindings/audiocore/RawSample.h b/shared-bindings/audiocore/RawSample.h index b02778cad3..61f61a0662 100644 --- a/shared-bindings/audiocore/RawSample.h +++ b/shared-bindings/audiocore/RawSample.h @@ -39,6 +39,8 @@ void common_hal_audioio_rawsample_construct(audioio_rawsample_obj_t* self, void common_hal_audioio_rawsample_deinit(audioio_rawsample_obj_t* self); bool common_hal_audioio_rawsample_deinited(audioio_rawsample_obj_t* self); uint32_t common_hal_audioio_rawsample_get_sample_rate(audioio_rawsample_obj_t* self); +uint8_t common_hal_audioio_rawsample_get_bits_per_sample(audioio_rawsample_obj_t* self); +uint8_t common_hal_audioio_rawsample_get_channel_count(audioio_rawsample_obj_t* self); void common_hal_audioio_rawsample_set_sample_rate(audioio_rawsample_obj_t* self, uint32_t sample_rate); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_AUDIOIO_RAWSAMPLE_H diff --git a/shared-bindings/audiocore/WaveFile.c b/shared-bindings/audiocore/WaveFile.c index 1b3a94ff37..178d2a1393 100644 --- a/shared-bindings/audiocore/WaveFile.c +++ b/shared-bindings/audiocore/WaveFile.c @@ -206,9 +206,21 @@ STATIC const mp_rom_map_elem_t audioio_wavefile_locals_dict_table[] = { }; STATIC MP_DEFINE_CONST_DICT(audioio_wavefile_locals_dict, audioio_wavefile_locals_dict_table); +STATIC const audiosample_p_t audioio_wavefile_proto = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_audiosample) + .sample_rate = (audiosample_sample_rate_fun)common_hal_audioio_wavefile_get_sample_rate, + .bits_per_sample = (audiosample_bits_per_sample_fun)common_hal_audioio_wavefile_get_bits_per_sample, + .channel_count = (audiosample_channel_count_fun)common_hal_audioio_wavefile_get_channel_count, + .reset_buffer = (audiosample_reset_buffer_fun)audioio_wavefile_reset_buffer, + .get_buffer = (audiosample_get_buffer_fun)audioio_wavefile_get_buffer, + .get_buffer_structure = (audiosample_get_buffer_structure_fun)audioio_wavefile_get_buffer_structure, +}; + + const mp_obj_type_t audioio_wavefile_type = { { &mp_type_type }, .name = MP_QSTR_WaveFile, .make_new = audioio_wavefile_make_new, .locals_dict = (mp_obj_dict_t*)&audioio_wavefile_locals_dict, + .protocol = &audioio_wavefile_proto, }; diff --git a/shared-bindings/audiomixer/Mixer.c b/shared-bindings/audiomixer/Mixer.c index ed7b95d9e0..03ffb9373b 100644 --- a/shared-bindings/audiomixer/Mixer.c +++ b/shared-bindings/audiomixer/Mixer.c @@ -291,9 +291,20 @@ STATIC const mp_rom_map_elem_t audiomixer_mixer_locals_dict_table[] = { }; STATIC MP_DEFINE_CONST_DICT(audiomixer_mixer_locals_dict, audiomixer_mixer_locals_dict_table); +STATIC const audiosample_p_t audiomixer_mixer_proto = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_audiosample) + .sample_rate = (audiosample_sample_rate_fun)common_hal_audiomixer_mixer_get_sample_rate, + .bits_per_sample = (audiosample_bits_per_sample_fun)common_hal_audiomixer_mixer_get_bits_per_sample, + .channel_count = (audiosample_channel_count_fun)common_hal_audiomixer_mixer_get_channel_count, + .reset_buffer = (audiosample_reset_buffer_fun)audiomixer_mixer_reset_buffer, + .get_buffer = (audiosample_get_buffer_fun)audiomixer_mixer_get_buffer, + .get_buffer_structure = (audiosample_get_buffer_structure_fun)audiomixer_mixer_get_buffer_structure, +}; + const mp_obj_type_t audiomixer_mixer_type = { { &mp_type_type }, .name = MP_QSTR_Mixer, .make_new = audiomixer_mixer_make_new, .locals_dict = (mp_obj_dict_t*)&audiomixer_mixer_locals_dict, + .protocol = &audiomixer_mixer_proto, }; diff --git a/shared-bindings/audiomixer/Mixer.h b/shared-bindings/audiomixer/Mixer.h index 9eabbf61df..a99e1bf62a 100644 --- a/shared-bindings/audiomixer/Mixer.h +++ b/shared-bindings/audiomixer/Mixer.h @@ -47,5 +47,7 @@ bool common_hal_audiomixer_mixer_deinited(audiomixer_mixer_obj_t* self); bool common_hal_audiomixer_mixer_get_playing(audiomixer_mixer_obj_t* self); uint32_t common_hal_audiomixer_mixer_get_sample_rate(audiomixer_mixer_obj_t* self); +uint8_t common_hal_audiomixer_mixer_get_channel_count(audiomixer_mixer_obj_t* self); +uint8_t common_hal_audiomixer_mixer_get_bits_per_sample(audiomixer_mixer_obj_t* self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_AUDIOMIXER_MIXER_H diff --git a/shared-module/audiocore/RawSample.c b/shared-module/audiocore/RawSample.c index d6bf3a567a..a69ddeb650 100644 --- a/shared-module/audiocore/RawSample.c +++ b/shared-module/audiocore/RawSample.c @@ -60,6 +60,12 @@ void common_hal_audioio_rawsample_set_sample_rate(audioio_rawsample_obj_t* self, uint32_t sample_rate) { self->sample_rate = sample_rate; } +uint8_t common_hal_audioio_rawsample_get_bits_per_sample(audioio_rawsample_obj_t* self) { + return self->bits_per_sample; +} +uint8_t common_hal_audioio_rawsample_get_channel_count(audioio_rawsample_obj_t* self) { + return self->channel_count; +} void audioio_rawsample_reset_buffer(audioio_rawsample_obj_t* self, bool single_channel, diff --git a/shared-module/audiocore/__init__.c b/shared-module/audiocore/__init__.c index f9762676fd..1553dbe961 100644 --- a/shared-module/audiocore/__init__.c +++ b/shared-module/audiocore/__init__.c @@ -36,103 +36,37 @@ #include "shared-module/audiomixer/Mixer.h" uint32_t audiosample_sample_rate(mp_obj_t sample_obj) { - if (MP_OBJ_IS_TYPE(sample_obj, &audioio_rawsample_type)) { - audioio_rawsample_obj_t* sample = MP_OBJ_TO_PTR(sample_obj); - return sample->sample_rate; - } else if (MP_OBJ_IS_TYPE(sample_obj, &audioio_wavefile_type)) { - audioio_wavefile_obj_t* file = MP_OBJ_TO_PTR(sample_obj); - return file->sample_rate; - #if CIRCUITPY_AUDIOMIXER - } else if (MP_OBJ_IS_TYPE(sample_obj, &audiomixer_mixer_type)) { - audiomixer_mixer_obj_t* mixer = MP_OBJ_TO_PTR(sample_obj); - return mixer->sample_rate; - #endif - } - return 16000; + const audiosample_p_t *proto = mp_proto_get_or_throw(MP_QSTR_protocol_audiosample, sample_obj); + return proto->sample_rate(MP_OBJ_TO_PTR(sample_obj)); } uint8_t audiosample_bits_per_sample(mp_obj_t sample_obj) { - if (MP_OBJ_IS_TYPE(sample_obj, &audioio_rawsample_type)) { - audioio_rawsample_obj_t* sample = MP_OBJ_TO_PTR(sample_obj); - return sample->bits_per_sample; - } else if (MP_OBJ_IS_TYPE(sample_obj, &audioio_wavefile_type)) { - audioio_wavefile_obj_t* file = MP_OBJ_TO_PTR(sample_obj); - return file->bits_per_sample; - #if CIRCUITPY_AUDIOMIXER - } else if (MP_OBJ_IS_TYPE(sample_obj, &audiomixer_mixer_type)) { - audiomixer_mixer_obj_t* mixer = MP_OBJ_TO_PTR(sample_obj); - return mixer->bits_per_sample; - #endif - } - return 8; + const audiosample_p_t *proto = mp_proto_get_or_throw(MP_QSTR_protocol_audiosample, sample_obj); + return proto->bits_per_sample(MP_OBJ_TO_PTR(sample_obj)); } uint8_t audiosample_channel_count(mp_obj_t sample_obj) { - if (MP_OBJ_IS_TYPE(sample_obj, &audioio_rawsample_type)) { - audioio_rawsample_obj_t* sample = MP_OBJ_TO_PTR(sample_obj); - return sample->channel_count; - } else if (MP_OBJ_IS_TYPE(sample_obj, &audioio_wavefile_type)) { - audioio_wavefile_obj_t* file = MP_OBJ_TO_PTR(sample_obj); - return file->channel_count; - #if CIRCUITPY_AUDIOMIXER - } else if (MP_OBJ_IS_TYPE(sample_obj, &audiomixer_mixer_type)) { - audiomixer_mixer_obj_t* mixer = MP_OBJ_TO_PTR(sample_obj); - return mixer->channel_count; - #endif - } - return 1; + const audiosample_p_t *proto = mp_proto_get_or_throw(MP_QSTR_protocol_audiosample, sample_obj); + return proto->channel_count(MP_OBJ_TO_PTR(sample_obj)); } void audiosample_reset_buffer(mp_obj_t sample_obj, bool single_channel, uint8_t audio_channel) { - if (MP_OBJ_IS_TYPE(sample_obj, &audioio_rawsample_type)) { - audioio_rawsample_obj_t* sample = MP_OBJ_TO_PTR(sample_obj); - audioio_rawsample_reset_buffer(sample, single_channel, audio_channel); - } else if (MP_OBJ_IS_TYPE(sample_obj, &audioio_wavefile_type)) { - audioio_wavefile_obj_t* file = MP_OBJ_TO_PTR(sample_obj); - audioio_wavefile_reset_buffer(file, single_channel, audio_channel); - #if CIRCUITPY_AUDIOMIXER - } else if (MP_OBJ_IS_TYPE(sample_obj, &audiomixer_mixer_type)) { - audiomixer_mixer_obj_t* file = MP_OBJ_TO_PTR(sample_obj); - audiomixer_mixer_reset_buffer(file, single_channel, audio_channel); - #endif - } + const audiosample_p_t *proto = mp_proto_get_or_throw(MP_QSTR_protocol_audiosample, sample_obj); + proto->reset_buffer(MP_OBJ_TO_PTR(sample_obj)); } audioio_get_buffer_result_t audiosample_get_buffer(mp_obj_t sample_obj, bool single_channel, uint8_t channel, uint8_t** buffer, uint32_t* buffer_length) { - if (MP_OBJ_IS_TYPE(sample_obj, &audioio_rawsample_type)) { - audioio_rawsample_obj_t* sample = MP_OBJ_TO_PTR(sample_obj); - return audioio_rawsample_get_buffer(sample, single_channel, channel, buffer, buffer_length); - } else if (MP_OBJ_IS_TYPE(sample_obj, &audioio_wavefile_type)) { - audioio_wavefile_obj_t* file = MP_OBJ_TO_PTR(sample_obj); - return audioio_wavefile_get_buffer(file, single_channel, channel, buffer, buffer_length); - #if CIRCUITPY_AUDIOMIXER - } else if (MP_OBJ_IS_TYPE(sample_obj, &audiomixer_mixer_type)) { - audiomixer_mixer_obj_t* file = MP_OBJ_TO_PTR(sample_obj); - return audiomixer_mixer_get_buffer(file, single_channel, channel, buffer, buffer_length); - #endif - } - return GET_BUFFER_DONE; + const audiosample_p_t *proto = mp_proto_get_or_throw(MP_QSTR_protocol_audiosample, sample_obj); + return proto->get_buffer(MP_OBJ_TO_PTR(sample_obj), single_channel, channel, buffer, buffer_length); } void audiosample_get_buffer_structure(mp_obj_t sample_obj, bool single_channel, bool* single_buffer, bool* samples_signed, uint32_t* max_buffer_length, uint8_t* spacing) { - if (MP_OBJ_IS_TYPE(sample_obj, &audioio_rawsample_type)) { - audioio_rawsample_obj_t* sample = MP_OBJ_TO_PTR(sample_obj); - audioio_rawsample_get_buffer_structure(sample, single_channel, single_buffer, - samples_signed, max_buffer_length, spacing); - } else if (MP_OBJ_IS_TYPE(sample_obj, &audioio_wavefile_type)) { - audioio_wavefile_obj_t* file = MP_OBJ_TO_PTR(sample_obj); - audioio_wavefile_get_buffer_structure(file, single_channel, single_buffer, samples_signed, - max_buffer_length, spacing); - #if CIRCUITPY_AUDIOMIXER - } else if (MP_OBJ_IS_TYPE(sample_obj, &audiomixer_mixer_type)) { - audiomixer_mixer_obj_t* file = MP_OBJ_TO_PTR(sample_obj); - audiomixer_mixer_get_buffer_structure(file, single_channel, single_buffer, samples_signed, - max_buffer_length, spacing); - #endif - } + const audiosample_p_t *proto = mp_proto_get_or_throw(MP_QSTR_protocol_audiosample, sample_obj); + proto->get_buffer_structure(MP_OBJ_TO_PTR(sample_obj), single_channel, single_buffer, + samples_signed, max_buffer_length, spacing); } diff --git a/shared-module/audiocore/__init__.h b/shared-module/audiocore/__init__.h index 7aa0c1824a..4b306f8ba0 100644 --- a/shared-module/audiocore/__init__.h +++ b/shared-module/audiocore/__init__.h @@ -31,6 +31,7 @@ #include #include "py/obj.h" +#include "py/proto.h" typedef enum { GET_BUFFER_DONE, // No more data to read @@ -38,15 +39,37 @@ typedef enum { GET_BUFFER_ERROR, // Error while reading data. } audioio_get_buffer_result_t; -uint32_t audiosample_sample_rate(mp_obj_t sample_obj); -uint8_t audiosample_bits_per_sample(mp_obj_t sample_obj); -uint8_t audiosample_channel_count(mp_obj_t sample_obj); -void audiosample_reset_buffer(mp_obj_t sample_obj, bool single_channel, uint8_t audio_channel); -audioio_get_buffer_result_t audiosample_get_buffer(mp_obj_t sample_obj, +typedef uint32_t (*audiosample_sample_rate_fun)(void* sample_obj); +typedef uint8_t (*audiosample_bits_per_sample_fun)(void* sample_obj); +typedef uint8_t (*audiosample_channel_count_fun)(void* sample_obj); +typedef void (*audiosample_reset_buffer_fun)(void* sample_obj); +typedef audioio_get_buffer_result_t (*audiosample_get_buffer_fun)(void* sample_obj, + bool single_channel, uint8_t channel, uint8_t** buffer, + uint32_t* buffer_length); +typedef void (*audiosample_get_buffer_structure_fun)(void* sample_obj, + bool single_channel, bool* single_buffer, + bool* samples_signed, uint32_t *max_buffer_length, + uint8_t* spacing); + +typedef struct _audiosample_p_t { + MP_PROTOCOL_HEAD // MP_QSTR_protocol_audiosample + audiosample_sample_rate_fun sample_rate; + audiosample_bits_per_sample_fun bits_per_sample; + audiosample_channel_count_fun channel_count; + audiosample_reset_buffer_fun reset_buffer; + audiosample_get_buffer_fun get_buffer; + audiosample_get_buffer_structure_fun get_buffer_structure; +} audiosample_p_t; + +uint32_t audiosample_sample_rate(void* sample_obj); +uint8_t audiosample_bits_per_sample(void* sample_obj); +uint8_t audiosample_channel_count(void* sample_obj); +void audiosample_reset_buffer(void* sample_obj, bool single_channel, uint8_t audio_channel); +audioio_get_buffer_result_t audiosample_get_buffer(void* sample_obj, bool single_channel, uint8_t channel, uint8_t** buffer, uint32_t* buffer_length); -void audiosample_get_buffer_structure(mp_obj_t sample_obj, bool single_channel, +void audiosample_get_buffer_structure(void* sample_obj, bool single_channel, bool* single_buffer, bool* samples_signed, uint32_t* max_buffer_length, uint8_t* spacing); diff --git a/shared-module/audiomixer/Mixer.c b/shared-module/audiomixer/Mixer.c index a52489f856..afa3a06323 100644 --- a/shared-module/audiomixer/Mixer.c +++ b/shared-module/audiomixer/Mixer.c @@ -76,6 +76,14 @@ uint32_t common_hal_audiomixer_mixer_get_sample_rate(audiomixer_mixer_obj_t* sel return self->sample_rate; } +uint8_t common_hal_audiomixer_mixer_get_channel_count(audiomixer_mixer_obj_t* self) { + return self->channel_count; +} + +uint8_t common_hal_audiomixer_mixer_get_bits_per_sample(audiomixer_mixer_obj_t* self) { + return self->bits_per_sample; +} + bool common_hal_audiomixer_mixer_get_playing(audiomixer_mixer_obj_t* self) { for (uint8_t v = 0; v < self->voice_count; v++) { if (common_hal_audiomixer_mixervoice_get_playing(MP_OBJ_TO_PTR(self->voice[v]))) { From e2f319fc6b110dcc22e2f07ededfe58a2e94bd44 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 4 Dec 2019 09:59:00 -0600 Subject: [PATCH 140/189] Update translations --- locale/ID.po | 7 ++++++- locale/circuitpython.pot | 7 ++++++- locale/de_DE.po | 7 ++++++- locale/en_US.po | 7 ++++++- locale/en_x_pirate.po | 7 ++++++- locale/es.po | 7 ++++++- locale/fil.po | 7 ++++++- locale/fr.po | 7 ++++++- locale/it_IT.po | 7 ++++++- locale/ko.po | 7 ++++++- locale/pl.po | 7 ++++++- locale/pt_BR.po | 7 ++++++- locale/zh_Latn_pinyin.po | 7 ++++++- 13 files changed, 78 insertions(+), 13 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 6a0b73b6f7..d3d025379c 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 14:54-0500\n" +"POT-Creation-Date: 2019-12-04 09:44-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -120,6 +120,11 @@ msgstr "" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' integer 0x%x tidak cukup didalam mask 0x%x" +#: py/proto.c +#, c-format +msgid "'%s' object does not support '%s'" +msgstr "" + #: py/obj.c #, c-format msgid "'%s' object does not support item assignment" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index a24ab186a4..f9edf50af3 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 14:54-0500\n" +"POT-Creation-Date: 2019-12-04 09:58-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -119,6 +119,11 @@ msgstr "" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "" +#: py/proto.c +#, c-format +msgid "'%s' object does not support '%s'" +msgstr "" + #: py/obj.c #, c-format msgid "'%s' object does not support item assignment" diff --git a/locale/de_DE.po b/locale/de_DE.po index 37937b94f7..d6c3fc359c 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 14:54-0500\n" +"POT-Creation-Date: 2019-12-04 09:44-0600\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -121,6 +121,11 @@ msgstr "'%s' integer %d ist nicht im Bereich %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' Integer 0x%x passt nicht in Maske 0x%x" +#: py/proto.c +#, c-format +msgid "'%s' object does not support '%s'" +msgstr "" + #: py/obj.c #, c-format msgid "'%s' object does not support item assignment" diff --git a/locale/en_US.po b/locale/en_US.po index e0e63e4fd4..a2e18f8ad2 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 14:54-0500\n" +"POT-Creation-Date: 2019-12-04 09:44-0600\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -119,6 +119,11 @@ msgstr "" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "" +#: py/proto.c +#, c-format +msgid "'%s' object does not support '%s'" +msgstr "" + #: py/obj.c #, c-format msgid "'%s' object does not support item assignment" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index b22687469c..32772646c9 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 14:54-0500\n" +"POT-Creation-Date: 2019-12-04 09:44-0600\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -121,6 +121,11 @@ msgstr "" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "" +#: py/proto.c +#, c-format +msgid "'%s' object does not support '%s'" +msgstr "" + #: py/obj.c #, c-format msgid "'%s' object does not support item assignment" diff --git a/locale/es.po b/locale/es.po index 4e8df4195b..6ff7e8e174 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 14:54-0500\n" +"POT-Creation-Date: 2019-12-04 09:44-0600\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -121,6 +121,11 @@ msgstr "'%s' entero %d no esta dentro del rango %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' entero 0x%x no cabe en la máscara 0x%x" +#: py/proto.c +#, c-format +msgid "'%s' object does not support '%s'" +msgstr "" + #: py/obj.c #, c-format msgid "'%s' object does not support item assignment" diff --git a/locale/fil.po b/locale/fil.po index f3f2b7e3b0..1e14df3ed1 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 14:54-0500\n" +"POT-Creation-Date: 2019-12-04 09:44-0600\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -122,6 +122,11 @@ msgstr "'%s' integer %d ay wala sa sakop ng %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' integer 0x%x ay wala sa mask na sakop ng 0x%x" +#: py/proto.c +#, c-format +msgid "'%s' object does not support '%s'" +msgstr "" + #: py/obj.c #, c-format msgid "'%s' object does not support item assignment" diff --git a/locale/fr.po b/locale/fr.po index 098bd8d1fc..ff513edbf4 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 14:54-0500\n" +"POT-Creation-Date: 2019-12-04 09:44-0600\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -123,6 +123,11 @@ msgstr "'%s' l'entier %d n'est pas dans la gamme %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' l'entier 0x%x ne correspond pas au masque 0x%x" +#: py/proto.c +#, c-format +msgid "'%s' object does not support '%s'" +msgstr "" + #: py/obj.c #, c-format msgid "'%s' object does not support item assignment" diff --git a/locale/it_IT.po b/locale/it_IT.po index 154dda932e..7037ad15e0 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 14:54-0500\n" +"POT-Creation-Date: 2019-12-04 09:44-0600\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -121,6 +121,11 @@ msgstr "intero '%s' non è nell'intervallo %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "intero '%s' non è nell'intervallo %d..%d" +#: py/proto.c +#, c-format +msgid "'%s' object does not support '%s'" +msgstr "" + #: py/obj.c #, c-format msgid "'%s' object does not support item assignment" diff --git a/locale/ko.po b/locale/ko.po index 5fc91553b2..7d58863229 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 14:54-0500\n" +"POT-Creation-Date: 2019-12-04 09:44-0600\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -121,6 +121,11 @@ msgstr "" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "" +#: py/proto.c +#, c-format +msgid "'%s' object does not support '%s'" +msgstr "" + #: py/obj.c #, c-format msgid "'%s' object does not support item assignment" diff --git a/locale/pl.po b/locale/pl.po index edfce95c62..37395aecd2 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 14:54-0500\n" +"POT-Creation-Date: 2019-12-04 09:44-0600\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -120,6 +120,11 @@ msgstr "'%s' liczba %d poza zakresem %d..%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' liczba 0x%x nie pasuje do maski 0x%x" +#: py/proto.c +#, c-format +msgid "'%s' object does not support '%s'" +msgstr "" + #: py/obj.c #, c-format msgid "'%s' object does not support item assignment" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index a2b259fc46..f2fa266154 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 14:54-0500\n" +"POT-Creation-Date: 2019-12-04 09:44-0600\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -121,6 +121,11 @@ msgstr "" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "" +#: py/proto.c +#, c-format +msgid "'%s' object does not support '%s'" +msgstr "" + #: py/obj.c #, c-format msgid "'%s' object does not support item assignment" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index de78d35b5f..2e91bcafa4 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-11-27 14:54-0500\n" +"POT-Creation-Date: 2019-12-04 09:44-0600\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -121,6 +121,11 @@ msgstr "'%s' zhěngshù %d bùzài fànwéi nèi %d.%d" msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' zhěngshù 0x%x bù shìyòng yú yǎn mǎ 0x%x" +#: py/proto.c +#, c-format +msgid "'%s' object does not support '%s'" +msgstr "" + #: py/obj.c #, c-format msgid "'%s' object does not support item assignment" From 17c8356b8c06ac160bf9fad6b6b4b8b1095d8dcd Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 22 Nov 2019 16:33:48 -0800 Subject: [PATCH 141/189] Add connection interval and debugging This also sets TinyUSB to master and to not include its submodules. It also fixes an old displayio example comment and retries gattc reads. --- .gitmodules | 3 +- ports/nrf/bluetooth/ble_drv.c | 14 +++- ports/nrf/common-hal/_bleio/Adapter.c | 9 +++ ports/nrf/common-hal/_bleio/Connection.c | 82 ++++++++++++++++++++---- ports/nrf/common-hal/_bleio/Connection.h | 2 + ports/nrf/common-hal/_bleio/Service.c | 7 ++ ports/nrf/common-hal/_bleio/__init__.c | 6 +- py/circuitpy_mpconfig.h | 2 + shared-bindings/_bleio/Connection.c | 46 ++++++++++++- shared-bindings/_bleio/Connection.h | 3 + shared-bindings/displayio/OnDiskBitmap.c | 2 +- supervisor/shared/bluetooth.c | 8 +-- 12 files changed, 160 insertions(+), 24 deletions(-) diff --git a/.gitmodules b/.gitmodules index bb62a5c39d..764456cd65 100644 --- a/.gitmodules +++ b/.gitmodules @@ -76,7 +76,8 @@ [submodule "lib/tinyusb"] path = lib/tinyusb url = https://github.com/hathach/tinyusb.git - branch = develop + branch = master + fetchRecurseSubmodules = false [submodule "tools/huffman"] path = tools/huffman url = https://github.com/tannewt/huffman.git diff --git a/ports/nrf/bluetooth/ble_drv.c b/ports/nrf/bluetooth/ble_drv.c index 16475e4b3b..896fa0fb09 100644 --- a/ports/nrf/bluetooth/ble_drv.c +++ b/ports/nrf/bluetooth/ble_drv.c @@ -134,6 +134,9 @@ void SD_EVT_IRQHandler(void) { } ble_evt_t* event = (ble_evt_t *)m_ble_evt_buf; + #if CIRCUITPY_VERBOSE_BLE + mp_printf(&mp_plat_print, "BLE event: 0x%04x\n", event->header.evt_id); + #endif if (supervisor_bluetooth_hook(event)) { continue; @@ -145,8 +148,15 @@ void SD_EVT_IRQHandler(void) { done = it->func(event, it->param) || done; it = it->next; } - if (!done) { - //mp_printf(&mp_plat_print, "Unhandled ble event: 0x%04x\n", event->header.evt_id); + #if CIRCUITPY_VERBOSE_BLE + if (event->header.evt_id == BLE_GATTS_EVT_WRITE) { + ble_gatts_evt_write_t* write_evt = &event->evt.gatts_evt.params.write; + mp_printf(&mp_plat_print, "Write to: UUID(0x%04x) handle %x of length %d auth %x\n", write_evt->uuid.uuid, write_evt->handle, write_evt->len, write_evt->auth_required); } + if (!done) { + mp_printf(&mp_plat_print, "Unhandled ble event: 0x%04x\n", event->header.evt_id); + + } + #endif } } diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index 85c159c6d5..00541c679a 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -180,9 +180,18 @@ STATIC bool adapter_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { connection->conn_handle = ble_evt->evt.gap_evt.conn_handle; connection->connection_obj = mp_const_none; connection->pair_status = PAIR_NOT_PAIRED; + ble_drv_add_event_handler_entry(&connection->handler_entry, connection_on_ble_evt, connection); self->connection_objs = NULL; + // Save the current connection parameters. + memcpy(&connection->conn_params, &connected->conn_params, sizeof(ble_gap_conn_params_t)); + + #if CIRCUITPY_VERBOSE_BLE + ble_gap_conn_params_t *cp = &connected->conn_params; + mp_printf(&mp_plat_print, "conn params: min_ci %d max_ci %d s_l %d sup_timeout %d\n", cp->min_conn_interval, cp->max_conn_interval, cp->slave_latency, cp->conn_sup_timeout); + #endif + // See if connection interval set by Central is out of range. // If so, negotiate our preferred range. ble_gap_conn_params_t conn_params; diff --git a/ports/nrf/common-hal/_bleio/Connection.c b/ports/nrf/common-hal/_bleio/Connection.c index 0e1e187c2d..0720d5c472 100644 --- a/ports/nrf/common-hal/_bleio/Connection.c +++ b/ports/nrf/common-hal/_bleio/Connection.c @@ -70,8 +70,6 @@ static volatile bool m_discovery_successful; static bleio_service_obj_t *m_char_discovery_service; static bleio_characteristic_obj_t *m_desc_discovery_characteristic; -bool dump_events = false; - bool connection_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { bleio_connection_internal_t *self = (bleio_connection_internal_t*)self_in; @@ -84,16 +82,9 @@ bool connection_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { return false; } - // For debugging. - if (dump_events) { - mp_printf(&mp_plat_print, "Connection event: 0x%04x\n", ble_evt->header.evt_id); - } - switch (ble_evt->header.evt_id) { case BLE_GAP_EVT_DISCONNECTED: break; - case BLE_GAP_EVT_CONN_PARAM_UPDATE: // 0x12 - break; case BLE_GAP_EVT_PHY_UPDATE_REQUEST: { ble_gap_phys_t const phys = { .rx_phys = BLE_GAP_PHY_AUTO, @@ -124,15 +115,61 @@ bool connection_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { sd_ble_gatts_sys_attr_set(self->conn_handle, NULL, 0, 0); break; + #if CIRCUITPY_VERBOSE_BLE + // Use read authorization to snoop on all reads when doing verbose debugging. + case BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST: { + + ble_gatts_evt_rw_authorize_request_t *request = + &ble_evt->evt.gatts_evt.params.authorize_request; + + mp_printf(&mp_plat_print, "Read %x offset %d ", request->request.read.handle, request->request.read.offset); + uint8_t value_bytes[22]; + ble_gatts_value_t value; + value.offset = request->request.read.offset; + value.len = 22; + value.p_value = value_bytes; + + sd_ble_gatts_value_get(self->conn_handle, request->request.read.handle, &value); + size_t len = value.len; + if (len > 22) { + len = 22; + } + for (uint8_t i = 0; i < len; i++) { + mp_printf(&mp_plat_print, " %02x", value_bytes[i]); + } + mp_printf(&mp_plat_print, "\n"); + ble_gatts_rw_authorize_reply_params_t reply; + reply.type = request->type; + reply.params.read.gatt_status = BLE_GATT_STATUS_SUCCESS; + reply.params.read.update = false; + reply.params.read.offset = request->request.read.offset; + sd_ble_gatts_rw_authorize_reply(self->conn_handle, &reply); + break; + } + #endif + case BLE_GATTS_EVT_HVN_TX_COMPLETE: // Capture this for now. 0x55 break; - case BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST: { + self->conn_params_updating = true; ble_gap_evt_conn_param_update_request_t *request = &ble_evt->evt.gap_evt.params.conn_param_update_request; sd_ble_gap_conn_param_update(self->conn_handle, &request->conn_params); break; } + case BLE_GAP_EVT_CONN_PARAM_UPDATE: { // 0x12 + ble_gap_evt_conn_param_update_t *result = + &ble_evt->evt.gap_evt.params.conn_param_update; + + #if CIRCUITPY_VERBOSE_BLE + ble_gap_conn_params_t *cp = &ble_evt->evt.gap_evt.params.conn_param_update.conn_params; + mp_printf(&mp_plat_print, "conn params updated: min_ci %d max_ci %d s_l %d sup_timeout %d\n", cp->min_conn_interval, cp->max_conn_interval, cp->slave_latency, cp->conn_sup_timeout); + #endif + + memcpy(&self->conn_params, &result->conn_params, sizeof(ble_gap_conn_params_t)); + self->conn_params_updating = false; + break; + } case BLE_GAP_EVT_SEC_PARAMS_REQUEST: { ble_gap_sec_keyset_t keyset = { .keys_own = { @@ -212,9 +249,9 @@ bool connection_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { default: // For debugging. - if (dump_events) { + #if CIRCUITPY_VERBOSE_BLE mp_printf(&mp_plat_print, "Unhandled connection event: 0x%04x\n", ble_evt->header.evt_id); - } + #endif return false; } @@ -262,6 +299,25 @@ void common_hal_bleio_connection_pair(bleio_connection_internal_t *self, bool bo check_sec_status(self->sec_status); } +mp_float_t common_hal_bleio_connection_get_connection_interval(bleio_connection_internal_t *self) { + while (self->conn_params_updating && !mp_hal_is_interrupted()) { + RUN_BACKGROUND_TASKS; + } + return 1.25f * self->conn_params.min_conn_interval; +} + +void common_hal_bleio_connection_set_connection_interval(bleio_connection_internal_t *self, mp_float_t new_interval) { + self->conn_params_updating = true; + uint16_t interval = new_interval / 1.25f; + self->conn_params.min_conn_interval = interval; + self->conn_params.max_conn_interval = interval; + uint32_t status = NRF_ERROR_BUSY; + while (status == NRF_ERROR_BUSY) { + status = sd_ble_gap_conn_param_update(self->conn_handle, &self->conn_params); + RUN_BACKGROUND_TASKS; + } + check_nrf_error(status); +} // service_uuid may be NULL, to discover all services. STATIC bool discover_next_services(bleio_connection_internal_t* connection, uint16_t start_handle, ble_uuid_t *service_uuid) { @@ -600,6 +656,7 @@ STATIC void discover_remote_services(bleio_connection_internal_t *self, mp_obj_t ble_drv_remove_event_handler(discovery_on_ble_evt, self); } + mp_obj_tuple_t *common_hal_bleio_connection_discover_remote_services(bleio_connection_obj_t *self, mp_obj_t service_uuids_whitelist) { discover_remote_services(self->connection, service_uuids_whitelist); // Convert to a tuple and then clear the list so the callee will take ownership. @@ -609,7 +666,6 @@ mp_obj_tuple_t *common_hal_bleio_connection_discover_remote_services(bleio_conne return services_tuple; } - uint16_t bleio_connection_get_conn_handle(bleio_connection_obj_t *self) { if (self == NULL || self->connection == NULL) { return BLE_CONN_HANDLE_INVALID; diff --git a/ports/nrf/common-hal/_bleio/Connection.h b/ports/nrf/common-hal/_bleio/Connection.h index d5548de453..1474a0a6c0 100644 --- a/ports/nrf/common-hal/_bleio/Connection.h +++ b/ports/nrf/common-hal/_bleio/Connection.h @@ -63,6 +63,8 @@ typedef struct { uint8_t sec_status; // Internal security status. mp_obj_t connection_obj; ble_drv_evt_handler_entry_t handler_entry; + ble_gap_conn_params_t conn_params; + volatile bool conn_params_updating; } bleio_connection_internal_t; typedef struct { diff --git a/ports/nrf/common-hal/_bleio/Service.c b/ports/nrf/common-hal/_bleio/Service.c index 5918327c14..19288f7479 100644 --- a/ports/nrf/common-hal/_bleio/Service.c +++ b/ports/nrf/common-hal/_bleio/Service.c @@ -119,6 +119,10 @@ void common_hal_bleio_service_add_characteristic(bleio_service_obj_t *self, bleio_attribute_gatts_set_security_mode(&char_attr_md.read_perm, characteristic->read_perm); bleio_attribute_gatts_set_security_mode(&char_attr_md.write_perm, characteristic->write_perm); + #if CIRCUITPY_VERBOSE_BLE + // Turn on read authorization so that we receive an event to print on every read. + char_attr_md.rd_auth = true; + #endif ble_gatts_attr_t char_attr = { .p_uuid = &char_uuid, @@ -137,6 +141,9 @@ void common_hal_bleio_service_add_characteristic(bleio_service_obj_t *self, characteristic->cccd_handle = char_handles.cccd_handle; characteristic->sccd_handle = char_handles.sccd_handle; characteristic->handle = char_handles.value_handle; + #if CIRCUITPY_VERBOSE_BLE + mp_printf(&mp_plat_print, "Char handle %x user %x cccd %x sccd %x\n", characteristic->handle, characteristic->user_desc_handle, characteristic->cccd_handle, characteristic->sccd_handle); + #endif mp_obj_list_append(self->characteristic_list, MP_OBJ_FROM_PTR(characteristic)); } diff --git a/ports/nrf/common-hal/_bleio/__init__.c b/ports/nrf/common-hal/_bleio/__init__.c index 7ba3dc8c1f..4b2780dedc 100644 --- a/ports/nrf/common-hal/_bleio/__init__.c +++ b/ports/nrf/common-hal/_bleio/__init__.c @@ -187,7 +187,11 @@ size_t common_hal_bleio_gattc_read(uint16_t handle, uint16_t conn_handle, uint8_ read_info.done = false; ble_drv_add_event_handler(_on_gattc_read_rsp_evt, &read_info); - check_nrf_error(sd_ble_gattc_read(conn_handle, handle, 0)); + uint32_t nrf_error = NRF_ERROR_BUSY; + while (nrf_error == NRF_ERROR_BUSY) { + nrf_error = sd_ble_gattc_read(conn_handle, handle, 0); + } + check_nrf_error(nrf_error); while (!read_info.done) { RUN_BACKGROUND_TASKS; diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 3e83d0c510..000674c4f4 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -666,4 +666,6 @@ void supervisor_run_background_tasks_if_tick(void); #define CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS 1000 #define CIRCUITPY_BOOT_OUTPUT_FILE "/boot_out.txt" +#define CIRCUITPY_VERBOSE_BLE 0 + #endif // __INCLUDED_MPCONFIG_CIRCUITPY_H diff --git a/shared-bindings/_bleio/Connection.c b/shared-bindings/_bleio/Connection.c index da2fbff287..568a4ea214 100644 --- a/shared-bindings/_bleio/Connection.c +++ b/shared-bindings/_bleio/Connection.c @@ -195,6 +195,46 @@ const mp_obj_property_t bleio_connection_paired_obj = { (mp_obj_t)&mp_const_none_obj }, }; + +//| .. attribute:: connection_interval +//| +//| Time between transmissions in milliseconds. Will be multiple of 1.25ms. Lower numbers +//| increase speed and decrease latency but increase power consumption. +//| +//| When setting connection_interval, the peer may reject the new interval and +//| `connection_interval` will then remain the same. +//| +//| Apple has additional guidelines that dictate should be a multiple of 15ms except if HID is +//| available. When HID is available Apple devices may accept 11.25ms intervals. +//| +//| +STATIC mp_obj_t bleio_connection_get_connection_interval(mp_obj_t self_in) { + bleio_connection_obj_t *self = MP_OBJ_TO_PTR(self_in); + + ensure_connected(self); + return mp_obj_new_float(common_hal_bleio_connection_get_connection_interval(self->connection)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_connection_get_connection_interval_obj, bleio_connection_get_connection_interval); + +STATIC mp_obj_t bleio_connection_set_connection_interval(mp_obj_t self_in, mp_obj_t interval_in) { + bleio_connection_obj_t *self = MP_OBJ_TO_PTR(self_in); + + mp_float_t interval = mp_obj_get_float(interval_in); + + ensure_connected(self); + common_hal_bleio_connection_set_connection_interval(self->connection, interval); + + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(bleio_connection_set_connection_interval_obj, bleio_connection_set_connection_interval); + +const mp_obj_property_t bleio_connection_connection_interval_obj = { + .base.type = &mp_type_property, + .proxy = { (mp_obj_t)&bleio_connection_get_connection_interval_obj, + (mp_obj_t)&bleio_connection_set_connection_interval_obj, + (mp_obj_t)&mp_const_none_obj }, +}; + STATIC const mp_rom_map_elem_t bleio_connection_locals_dict_table[] = { // Methods { MP_ROM_QSTR(MP_QSTR_pair), MP_ROM_PTR(&bleio_connection_pair_obj) }, @@ -202,8 +242,10 @@ STATIC const mp_rom_map_elem_t bleio_connection_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_discover_remote_services), MP_ROM_PTR(&bleio_connection_discover_remote_services_obj) }, // Properties - { MP_ROM_QSTR(MP_QSTR_connected), MP_ROM_PTR(&bleio_connection_connected_obj) }, - { MP_ROM_QSTR(MP_QSTR_paired), MP_ROM_PTR(&bleio_connection_paired_obj) }, + { MP_ROM_QSTR(MP_QSTR_connected), MP_ROM_PTR(&bleio_connection_connected_obj) }, + { MP_ROM_QSTR(MP_QSTR_paired), MP_ROM_PTR(&bleio_connection_paired_obj) }, + { MP_ROM_QSTR(MP_QSTR_connection_interval), MP_ROM_PTR(&bleio_connection_connection_interval_obj) }, + }; STATIC MP_DEFINE_CONST_DICT(bleio_connection_locals_dict, bleio_connection_locals_dict_table); diff --git a/shared-bindings/_bleio/Connection.h b/shared-bindings/_bleio/Connection.h index f7eee180f7..b0e26da5c8 100644 --- a/shared-bindings/_bleio/Connection.h +++ b/shared-bindings/_bleio/Connection.h @@ -40,4 +40,7 @@ extern bool common_hal_bleio_connection_get_connected(bleio_connection_obj_t *se extern bool common_hal_bleio_connection_get_paired(bleio_connection_obj_t *self); extern mp_obj_tuple_t *common_hal_bleio_connection_discover_remote_services(bleio_connection_obj_t *self, mp_obj_t service_uuids_whitelist); +mp_float_t common_hal_bleio_connection_get_connection_interval(bleio_connection_internal_t *self); +void common_hal_bleio_connection_set_connection_interval(bleio_connection_internal_t *self, mp_float_t new_interval); + #endif // MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_CONNECTION_H diff --git a/shared-bindings/displayio/OnDiskBitmap.c b/shared-bindings/displayio/OnDiskBitmap.c index bf00ef855e..f7e2bf693f 100644 --- a/shared-bindings/displayio/OnDiskBitmap.c +++ b/shared-bindings/displayio/OnDiskBitmap.c @@ -59,7 +59,7 @@ //| //| with open("/sample.bmp", "rb") as f: //| odb = displayio.OnDiskBitmap(f) -//| face = displayio.TileGrid(odb, pixel_shader=displayio.ColorConverter(), position=(0,0)) +//| face = displayio.TileGrid(odb, pixel_shader=displayio.ColorConverter()) //| splash.append(face) //| # Wait for the image to load. //| board.DISPLAY.wait_for_frame() diff --git a/supervisor/shared/bluetooth.c b/supervisor/shared/bluetooth.c index 02258de742..cf41b3fd3c 100644 --- a/supervisor/shared/bluetooth.c +++ b/supervisor/shared/bluetooth.c @@ -52,7 +52,7 @@ bleio_uuid_obj_t supervisor_ble_length_uuid; bleio_characteristic_obj_t supervisor_ble_contents_characteristic; bleio_uuid_obj_t supervisor_ble_contents_uuid; const uint8_t circuitpython_base_uuid[16] = {0x6e, 0x68, 0x74, 0x79, 0x50, 0x74, 0x69, 0x75, 0x63, 0x72, 0x69, 0x43, 0x00, 0x00, 0xaf, 0xad }; -uint8_t circuitpython_advertising_data[] = { 0x02, 0x01, 0x06, 0x02, 0x0a, 0x00, 0x11, 0x07, 0x6e, 0x68, 0x74, 0x79, 0x50, 0x74, 0x69, 0x75, 0x63, 0x72, 0x69, 0x43, 0x00, 0x01, 0xaf, 0xad, 0x06, 0x08, 0x43, 0x49, 0x52, 0x43, 0x55 }; +uint8_t circuitpython_advertising_data[] = { 0x02, 0x01, 0x06, 0x02, 0x0a, 0x00, 0x11, 0x07, 0x6e, 0x68, 0x74, 0x79, 0x50, 0x74, 0x69, 0x75, 0x63, 0x72, 0x69, 0x43, 0x00, 0x01, 0xaf, 0xad, 0x06, 0x08, 0x43, 0x49, 0x52, 0x43, 0x55 }; uint8_t circuitpython_scan_response_data[15] = {0x0e, 0x09, 0x43, 0x49, 0x52, 0x43, 0x55, 0x49, 0x54, 0x50, 0x59, 0x00, 0x00, 0x00, 0x00}; mp_obj_list_t service_list; mp_obj_t service_list_items[1]; @@ -86,7 +86,7 @@ void supervisor_start_bluetooth(void) { characteristic_list.len = 0; characteristic_list.items = characteristic_list_items; mp_seq_clear(characteristic_list.items, 0, characteristic_list.alloc, sizeof(*characteristic_list.items)); - + _common_hal_bleio_service_construct(&supervisor_ble_service, &supervisor_ble_service_uuid, false /* is secondary */, &characteristic_list); // File length @@ -225,7 +225,7 @@ void supervisor_bluetooth_background(void) { uint16_t current_length = ((uint16_t*) current_command)[0]; if (current_length > 0 && current_length == current_offset) { uint16_t command = ((uint16_t *) current_command)[1]; - + if (command == 1) { uint16_t max_len = 20; //supervisor_ble_contents_characteristic.max_length; uint8_t buf[max_len]; @@ -274,7 +274,7 @@ void supervisor_bluetooth_background(void) { f_write(&active_file, &data, 1, &actual); } } - + f_lseek(&active_file, offset); uint8_t* data = (uint8_t *) (current_command + 4); UINT written; From e30dde0afc71bbd0e01bfa9454589ef2b553d75a Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 5 Dec 2019 08:35:02 -0500 Subject: [PATCH 142/189] Make _bleio.Connection.disconnect() idempotent --- shared-bindings/_bleio/Connection.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/shared-bindings/_bleio/Connection.c b/shared-bindings/_bleio/Connection.c index da2fbff287..e1e458c226 100644 --- a/shared-bindings/_bleio/Connection.c +++ b/shared-bindings/_bleio/Connection.c @@ -80,14 +80,12 @@ STATIC void ensure_connected(bleio_connection_obj_t *self) { //| //| .. method:: disconnect() //| -//| Disconnects from the remote peripheral. +//| Disconnects from the remote peripheral. Does nothing if already disconnected. //| STATIC mp_obj_t bleio_connection_disconnect(mp_obj_t self_in) { bleio_connection_obj_t *self = MP_OBJ_TO_PTR(self_in); - ensure_connected(self); - + // common_hal_bleio_connection_disconnect() does nothing if already disconnected. common_hal_bleio_connection_disconnect(self->connection); - return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_connection_disconnect_obj, bleio_connection_disconnect); From f3f2c7f5dea80b827242988f031baf249b9df302 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Thu, 5 Dec 2019 11:38:20 -0500 Subject: [PATCH 143/189] change default phase for SPI --- ports/stm32f4/common-hal/busio/SPI.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/stm32f4/common-hal/busio/SPI.c b/ports/stm32f4/common-hal/busio/SPI.c index 1142657b7f..32089887f9 100644 --- a/ports/stm32f4/common-hal/busio/SPI.c +++ b/ports/stm32f4/common-hal/busio/SPI.c @@ -165,7 +165,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, self->baudrate = (get_busclock(SPIx)/16); self->prescaler = 16; self->polarity = 0; - self->phase = 1; + self->phase = 0; self->bits = 8; claim_pin(sck); From ab74f45bfbed78fd752e3ed3a12c01fa910ad672 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Thu, 5 Dec 2019 11:44:21 -0500 Subject: [PATCH 144/189] Define polarity and phase in Fourwire --- shared-module/displayio/FourWire.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-module/displayio/FourWire.c b/shared-module/displayio/FourWire.c index 92d4507dde..256c29642d 100644 --- a/shared-module/displayio/FourWire.c +++ b/shared-module/displayio/FourWire.c @@ -49,8 +49,8 @@ void common_hal_displayio_fourwire_construct(displayio_fourwire_obj_t* self, gc_never_free(self->bus); self->frequency = baudrate; - self->polarity = common_hal_busio_spi_get_polarity(spi); - self->phase = common_hal_busio_spi_get_phase(spi); + self->polarity = 0; + self->phase = 0; common_hal_digitalio_digitalinout_construct(&self->command, command); common_hal_digitalio_digitalinout_switch_to_output(&self->command, true, DRIVE_MODE_PUSH_PULL); From c53496a55eccb1c7382c41817504ce8f949a9b77 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Thu, 5 Dec 2019 12:45:09 -0500 Subject: [PATCH 145/189] remove redundant NOPs --- ports/stm32f4/common-hal/neopixel_write/__init__.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ports/stm32f4/common-hal/neopixel_write/__init__.c b/ports/stm32f4/common-hal/neopixel_write/__init__.c index 23fe7870f5..6740a0d348 100644 --- a/ports/stm32f4/common-hal/neopixel_write/__init__.c +++ b/ports/stm32f4/common-hal/neopixel_write/__init__.c @@ -76,13 +76,9 @@ void common_hal_neopixel_write (const digitalio_digitalinout_obj_t* digitalinout cyc = (pix & mask) ? t1 : t0; start = DWT->CYCCNT; LL_GPIO_SetOutputPin(p_port, p_mask); - while((DWT->CYCCNT - start) < cyc) { - __asm__ __volatile__("nop"); - } + while((DWT->CYCCNT - start) < cyc); LL_GPIO_ResetOutputPin(p_port, p_mask); - while((DWT->CYCCNT - start) < interval) { - __asm__ __volatile__("nop"); - } + while((DWT->CYCCNT - start) < interval); if(!(mask >>= 1)) { if(p >= end) break; pix = *p++; From 49a547eed881408d77f750c5f0328e2d93770369 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 5 Dec 2019 13:06:06 -0600 Subject: [PATCH 146/189] proto: Use %q format-string shortcut --- py/proto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py/proto.c b/py/proto.c index 030b62674e..e5053130b8 100644 --- a/py/proto.c +++ b/py/proto.c @@ -45,6 +45,6 @@ const void *mp_proto_get_or_throw(uint16_t name, mp_const_obj_t obj) { if (proto) { return proto; } - mp_raise_TypeError_varg(translate("'%s' object does not support '%s'"), - mp_obj_get_type_str(obj), qstr_str(name)); + mp_raise_TypeError_varg(translate("'%s' object does not support '%q'"), + mp_obj_get_type_str(obj), name); } From 60f489d36a364dfc4feb55af4d139987302c0242 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 5 Dec 2019 13:08:32 -0600 Subject: [PATCH 147/189] audiocore: restore the prototypes of audiosample_xxx functions --- shared-module/audiocore/__init__.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/shared-module/audiocore/__init__.h b/shared-module/audiocore/__init__.h index 4b306f8ba0..9012c0d8b9 100644 --- a/shared-module/audiocore/__init__.h +++ b/shared-module/audiocore/__init__.h @@ -61,15 +61,15 @@ typedef struct _audiosample_p_t { audiosample_get_buffer_structure_fun get_buffer_structure; } audiosample_p_t; -uint32_t audiosample_sample_rate(void* sample_obj); -uint8_t audiosample_bits_per_sample(void* sample_obj); -uint8_t audiosample_channel_count(void* sample_obj); -void audiosample_reset_buffer(void* sample_obj, bool single_channel, uint8_t audio_channel); -audioio_get_buffer_result_t audiosample_get_buffer(void* sample_obj, +uint32_t audiosample_sample_rate(mp_obj_t sample_obj); +uint8_t audiosample_bits_per_sample(mp_obj_t sample_obj); +uint8_t audiosample_channel_count(mp_obj_t sample_obj); +void audiosample_reset_buffer(mp_obj_t sample_obj, bool single_channel, uint8_t audio_channel); +audioio_get_buffer_result_t audiosample_get_buffer(mp_obj_t sample_obj, bool single_channel, uint8_t channel, uint8_t** buffer, uint32_t* buffer_length); -void audiosample_get_buffer_structure(void* sample_obj, bool single_channel, +void audiosample_get_buffer_structure(mp_obj_t sample_obj, bool single_channel, bool* single_buffer, bool* samples_signed, uint32_t* max_buffer_length, uint8_t* spacing); From 2dcfc9d411fe06f190c6af59c44be3a2b29a63eb Mon Sep 17 00:00:00 2001 From: Hierophect Date: Fri, 6 Dec 2019 11:41:38 -0500 Subject: [PATCH 148/189] USB fixes and cleanup --- .../boards/stm32f411ce_blackpill/mpconfigboard.h | 7 +++++++ .../boards/stm32f411ce_blackpill/mpconfigboard.mk | 9 +++++++-- ports/stm32f4/boards/stm32f411ce_blackpill/pins.c | 12 +++++++----- ports/stm32f4/peripherals/stm32f4/stm32f411xe/gpio.c | 1 - ports/stm32f4/supervisor/usb.c | 7 ++++++- 5 files changed, 27 insertions(+), 9 deletions(-) diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h index 8a482ce7dc..4b46b1056b 100644 --- a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h +++ b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h @@ -33,6 +33,13 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV 25 +#define BOARD_USB_VBUS_BOOST + +// On-board flash +// #define SPI_FLASH_MOSI_PIN (&pin_PA07) +// #define SPI_FLASH_MISO_PIN (&pin_PA06) +// #define SPI_FLASH_SCK_PIN (&pin_PA05) +// #define SPI_FLASH_CS_PIN (&pin_PA04) #define CIRCUITPY_AUTORELOAD_DELAY_MS 500 diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk index 41c283a780..a9f12cbc95 100644 --- a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk +++ b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk @@ -1,8 +1,13 @@ USB_VID = 0x239A USB_PID = 0x806A -USB_PRODUCT = "stm32f411ce-blackpill" +USB_PRODUCT = "stm32f411ce blackpill" USB_MANUFACTURER = "Unknown" -USB_DEVICES = "CDC" +USB_DEVICES = "CDC,MSC" + +# SPI_FLASH_FILESYSTEM = 1 +# EXTERNAL_FLASH_DEVICE_COUNT = 1 +# EXTERNAL_FLASH_DEVICES = xxxxxx #See supervisor/shared/external_flash/devices.h for options +# LONGINT_IMPL = MPZ INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/pins.c b/ports/stm32f4/boards/stm32f411ce_blackpill/pins.c index 0846cee673..5797a9762b 100644 --- a/ports/stm32f4/boards/stm32f411ce_blackpill/pins.c +++ b/ports/stm32f4/boards/stm32f411ce_blackpill/pins.c @@ -6,10 +6,10 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_B14), MP_ROM_PTR(&pin_PB14) }, { MP_ROM_QSTR(MP_QSTR_B15), MP_ROM_PTR(&pin_PB15) }, { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_PA11) }, - { MP_ROM_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_PA09) }, //USB (shouldn't be used) + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PA10) }, //USB (shouldn't be used) + { MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_PA11) }, //USB (shouldn't be used) + { MP_ROM_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_PA12) }, //USB (shouldn't be used) { MP_ROM_QSTR(MP_QSTR_A15), MP_ROM_PTR(&pin_PA15) }, { MP_ROM_QSTR(MP_QSTR_B3), MP_ROM_PTR(&pin_PB03) }, { MP_ROM_QSTR(MP_QSTR_B4), MP_ROM_PTR(&pin_PB04) }, @@ -26,7 +26,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA04) }, { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA03) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA02) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA01) }, @@ -34,5 +34,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_C15), MP_ROM_PTR(&pin_PC15) }, { MP_ROM_QSTR(MP_QSTR_C14), MP_ROM_PTR(&pin_PC14) }, { MP_ROM_QSTR(MP_QSTR_C13), MP_ROM_PTR(&pin_PC13) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PC13) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/gpio.c b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/gpio.c index 2b0e2b2888..651aea2691 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/gpio.c +++ b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/gpio.c @@ -38,7 +38,6 @@ void stm32f4_peripherals_gpio_init(void) { __HAL_RCC_GPIOD_CLK_ENABLE(); //Never reset pins - never_reset_pin_number(2,13); //PC13 anti tamp never_reset_pin_number(2,14); //PC14 OSC32_IN never_reset_pin_number(2,15); //PC15 OSC32_OUT never_reset_pin_number(0,13); //PA13 SWDIO diff --git a/ports/stm32f4/supervisor/usb.c b/ports/stm32f4/supervisor/usb.c index f327050f58..39538daabf 100644 --- a/ports/stm32f4/supervisor/usb.c +++ b/ports/stm32f4/supervisor/usb.c @@ -31,6 +31,7 @@ #include "lib/utils/interrupt_char.h" #include "lib/mp-readline/readline.h" #include "stm32f4xx_hal.h" +#include "py/mpconfig.h" #include "common-hal/microcontroller/Pin.h" @@ -58,7 +59,11 @@ void init_usb_hardware(void) { /* Configure VBUS Pin */ GPIO_InitStruct.Pin = GPIO_PIN_9; GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_NOPULL; +#ifdef BOARD_USB_VBUS_BOOST + GPIO_InitStruct.Pull = GPIO_PULLUP; //GPIO_NOPULL; +#else + GPIO_InitStruct.Pull = GPIO_NOPULL; //GPIO_NOPULL; +#endif HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); never_reset_pin_number(0, 9); From f6d0e912c94e11f43f5c9f37c8dddbda824a20f8 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Fri, 6 Dec 2019 11:52:40 -0500 Subject: [PATCH 149/189] remove old 401 files --- .../peripherals/stm32f4/stm32f401xe/clocks.c | 61 ------- .../peripherals/stm32f4/stm32f401xe/gpio.c | 54 ------ .../peripherals/stm32f4/stm32f401xe/periph.c | 172 ------------------ .../peripherals/stm32f4/stm32f401xe/periph.h | 57 ------ .../peripherals/stm32f4/stm32f401xe/pins.c | 123 ------------- .../peripherals/stm32f4/stm32f401xe/pins.h | 121 ------------ 6 files changed, 588 deletions(-) delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f401xe/clocks.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f401xe/gpio.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.h delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.c delete mode 100644 ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.h diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/clocks.c b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/clocks.c deleted file mode 100644 index 883c252d51..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/clocks.c +++ /dev/null @@ -1,61 +0,0 @@ - -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland 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 "stm32f4xx_hal.h" - -void stm32f4_peripherals_clocks_init(void) { - //System clock init - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - - /* Enable Power Control clock */ - __HAL_RCC_PWR_CLK_ENABLE(); - - /* The voltage scaling allows optimizing the power consumption when the device is - clocked below the maximum system frequency, to update the voltage scaling value - regarding system frequency refer to product datasheet. */ - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2); - - /* Enable HSE Oscillator and activate PLL with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_ON; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = 8; - RCC_OscInitStruct.PLL.PLLN = 336; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4; - RCC_OscInitStruct.PLL.PLLQ = 7; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 - clocks dividers */ - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2); - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3); -} diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/gpio.c b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/gpio.c deleted file mode 100644 index 45dc8fc6fa..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/gpio.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland 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 "stm32f4xx_hal.h" -#include "stm32f4/gpio.h" -#include "common-hal/microcontroller/Pin.h" - -void stm32f4_peripherals_gpio_init(void) { - //Enable all GPIO for now - GPIO_InitTypeDef GPIO_InitStruct = {0}; - /* GPIO Ports Clock Enable */ - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - __HAL_RCC_GPIOC_CLK_ENABLE(); - __HAL_RCC_GPIOD_CLK_ENABLE(); - __HAL_RCC_GPIOE_CLK_ENABLE(); - __HAL_RCC_GPIOH_CLK_ENABLE(); - - //Never reset pins - never_reset_pin_number(2,13); //PC13 anti tamp - never_reset_pin_number(2,14); //PC14 OSC32_IN - never_reset_pin_number(2,15); //PC15 OSC32_OUT - never_reset_pin_number(0,13); //PA13 SWDIO - never_reset_pin_number(0,14); //PA14 SWCLK -} - -//LEDs are inverted on F411 DISCO -void stm32f4_peripherals_status_led(uint8_t led, uint8_t state) { -} - - diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.c b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.c deleted file mode 100644 index 859e9a1adb..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.c +++ /dev/null @@ -1,172 +0,0 @@ - /* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland 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 "py/obj.h" -#include "py/mphal.h" -#include "stm32f4/pins.h" -#include "stm32f4/periph.h" - -// I2C - -I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, I2C2, I2C3}; - -const mcu_i2c_sda_obj_t mcu_i2c_sda_list[5] = { - I2C_SDA(1, 4, &pin_PB07), - I2C_SDA(1, 4, &pin_PB09), - I2C_SDA(2, 9, &pin_PB03), - I2C_SDA(3, 4, &pin_PC09), - I2C_SDA(3, 9, &pin_PB04), -}; - -const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4] = { - I2C_SCL(1, 4, &pin_PB06), - I2C_SCL(1, 4, &pin_PB08), - I2C_SCL(2, 4, &pin_PB10), - I2C_SCL(3, 4, &pin_PA08) -}; - -// SPI - -SPI_TypeDef * mcu_spi_banks[4] = {SPI1, SPI2, SPI3, SPI4}; - -const mcu_spi_sck_obj_t mcu_spi_sck_list[9] = { - SPI(1, 5, &pin_PA05), - SPI(1, 5, &pin_PB03), - SPI(2, 5, &pin_PB10), - SPI(2, 5, &pin_PB13), - SPI(2, 5, &pin_PD03), - SPI(3, 6, &pin_PB03), - SPI(3, 6, &pin_PC10), - SPI(4, 5, &pin_PE02), - SPI(4, 5, &pin_PE12), -}; - -const mcu_spi_mosi_obj_t mcu_spi_mosi_list[9] = { - SPI(1, 5, &pin_PA07), - SPI(1, 5, &pin_PB05), - SPI(2, 5, &pin_PB15), - SPI(2, 5, &pin_PC03), - SPI(3, 6, &pin_PB05), - SPI(3, 6, &pin_PC12), - SPI(3, 5, &pin_PD06), - SPI(4, 5, &pin_PE06), - SPI(4, 5, &pin_PE14), -}; - -const mcu_spi_miso_obj_t mcu_spi_miso_list[8] = { - SPI(1, 5, &pin_PA06), - SPI(1, 5, &pin_PB04), - SPI(2, 5, &pin_PB14), - SPI(2, 5, &pin_PC02), - SPI(3, 6, &pin_PB04), - SPI(3, 6, &pin_PC11), - SPI(4, 5, &pin_PE05), - SPI(4, 5, &pin_PE13), -}; - -const mcu_spi_nss_obj_t mcu_spi_nss_list[9] = { - SPI(1, 5, &pin_PA04), - SPI(1, 5, &pin_PA15), - SPI(2, 5, &pin_PB09), - SPI(2, 5, &pin_PB12), - SPI(3, 6, &pin_PA04), - SPI(3, 6, &pin_PA15), - SPI(4, 6, &pin_PB12), - SPI(4, 5, &pin_PE04), - SPI(4, 5, &pin_PE11), -}; - -USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, NULL, NULL, NULL, USART6}; -bool mcu_uart_has_usart[MAX_UART] = {true, true, false, false, false, true}; - -const mcu_uart_tx_obj_t mcu_uart_tx_list[6] = { - UART(2, 7, &pin_PA02), - UART(1, 7, &pin_PA09), - UART(6, 8, &pin_PA11), - UART(1, 7, &pin_PB06), - UART(6, 8, &pin_PC06), - UART(2, 7, &pin_PD05), -}; - -const mcu_uart_rx_obj_t mcu_uart_rx_list[6] = { - UART(2, 7, &pin_PA03), - UART(1, 7, &pin_PA10), - UART(6, 8, &pin_PA12), - UART(1, 7, &pin_PB07), - UART(6, 8, &pin_PC07), - UART(2, 7, &pin_PD06), -}; - -//Timers -//TIM6 and TIM7 are basic timers that are only used by DAC, and don't have pins -TIM_TypeDef * mcu_tim_banks[14] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, NULL, TIM9, TIM10, - TIM11, NULL, NULL, NULL}; - -const mcu_tim_pin_obj_t mcu_tim_pin_list[44] = { - TIM(2,1,1,&pin_PA00), - TIM(5,2,1,&pin_PA00), - TIM(2,1,2,&pin_PA01), - TIM(5,2,2,&pin_PA01), - TIM(2,1,3,&pin_PA02), - TIM(5,2,3,&pin_PA02), - TIM(2,1,4,&pin_PA03), - TIM(5,2,4,&pin_PA03), - TIM(9,3,1,&pin_PA02), - TIM(9,3,2,&pin_PA03), - TIM(3,2,1,&pin_PA06), - TIM(3,2,2,&pin_PA07), - TIM(1,1,1,&pin_PA08), - TIM(1,1,2,&pin_PA09), - TIM(1,1,3,&pin_PA10), - TIM(1,1,4,&pin_PA11), - TIM(2,1,1,&pin_PA15), - TIM(3,2,3,&pin_PB00), - TIM(3,2,4,&pin_PB01), - TIM(2,1,2,&pin_PB03), - TIM(3,2,1,&pin_PB04), - TIM(3,2,2,&pin_PB05), - TIM(4,2,1,&pin_PB06), - TIM(4,2,2,&pin_PB07), - TIM(4,2,3,&pin_PB08), - TIM(10,2,1,&pin_PB08), - TIM(4,2,4,&pin_PB09), - TIM(11,2,1,&pin_PB09), - TIM(2,1,3,&pin_PB10), - TIM(3,2,1,&pin_PC06), - TIM(3,2,2,&pin_PC07), - TIM(3,2,3,&pin_PC08), - TIM(3,2,4,&pin_PC09), - TIM(4,2,1,&pin_PD12), - TIM(4,2,2,&pin_PD13), - TIM(4,2,3,&pin_PD14), - TIM(4,2,4,&pin_PD15), - TIM(9,3,1,&pin_PE05), - TIM(9,3,2,&pin_PE06), - TIM(1,1,1,&pin_PE09), - TIM(1,1,2,&pin_PE11), - TIM(1,1,3,&pin_PE13), - TIM(1,1,4,&pin_PE14), -}; diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.h b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.h deleted file mode 100644 index 7d3f4dca22..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/periph.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland 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_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H - -//I2C -extern I2C_TypeDef * mcu_i2c_banks[3]; - -extern const mcu_i2c_sda_obj_t mcu_i2c_sda_list[5]; -extern const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4]; - -//SPI -extern SPI_TypeDef * mcu_spi_banks[4]; - -extern const mcu_spi_sck_obj_t mcu_spi_sck_list[9]; -extern const mcu_spi_mosi_obj_t mcu_spi_mosi_list[9]; -extern const mcu_spi_miso_obj_t mcu_spi_miso_list[8]; -extern const mcu_spi_nss_obj_t mcu_spi_nss_list[9]; - -//UART -extern USART_TypeDef * mcu_uart_banks[MAX_UART]; -extern bool mcu_uart_has_usart[MAX_UART]; - -extern const mcu_uart_tx_obj_t mcu_uart_tx_list[6]; -extern const mcu_uart_rx_obj_t mcu_uart_rx_list[6]; - -//Timers -#define TIM_BANK_ARRAY_LEN 14 -#define TIM_PIN_ARRAY_LEN 44 -TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN]; -const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN]; - -#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PERIPH_H \ No newline at end of file diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.c b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.c deleted file mode 100644 index 7e88c3dcba..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.c +++ /dev/null @@ -1,123 +0,0 @@ - /* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland 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 "py/obj.h" -#include "py/mphal.h" -#include "stm32f4/pins.h" - -const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC); -const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC); -const mcu_pin_obj_t pin_PE04 = PIN(4, 4, NO_ADC); -const mcu_pin_obj_t pin_PE05 = PIN(4, 5, NO_ADC); -const mcu_pin_obj_t pin_PE06 = PIN(4, 6, NO_ADC); - -const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC); //anti-tamp -const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); //OSC32_IN -const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); //OSC32_OUT - -const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_1,10)); -const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_1,11)); -const mcu_pin_obj_t pin_PC02 = PIN(2, 2, ADC_INPUT(ADC_1,12)); -const mcu_pin_obj_t pin_PC03 = PIN(2, 3, ADC_INPUT(ADC_1,13)); - -const mcu_pin_obj_t pin_PA00 = PIN(0, 0, ADC_INPUT(ADC_1,0)); -const mcu_pin_obj_t pin_PA01 = PIN(0, 1, ADC_INPUT(ADC_1,1)); -const mcu_pin_obj_t pin_PA02 = PIN(0, 2, ADC_INPUT(ADC_1,2)); -const mcu_pin_obj_t pin_PA03 = PIN(0, 3, ADC_INPUT(ADC_1,3)); -const mcu_pin_obj_t pin_PA04 = PIN(0, 4, ADC_INPUT(ADC_1,4)); -const mcu_pin_obj_t pin_PA05 = PIN(0, 5, ADC_INPUT(ADC_1,5)); -const mcu_pin_obj_t pin_PA06 = PIN(0, 6, ADC_INPUT(ADC_1,6)); -const mcu_pin_obj_t pin_PA07 = PIN(0, 7, ADC_INPUT(ADC_1,7)); - -const mcu_pin_obj_t pin_PC04 = PIN(2, 4, ADC_INPUT(ADC_1,14)); -const mcu_pin_obj_t pin_PC05 = PIN(2, 5, ADC_INPUT(ADC_1,15)); - -const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_1,8)); -const mcu_pin_obj_t pin_PB01 = PIN(1, 1, ADC_INPUT(ADC_1,9)); -const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); - -const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); -const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC); -const mcu_pin_obj_t pin_PE09 = PIN(4, 9, NO_ADC); -const mcu_pin_obj_t pin_PE10 = PIN(4, 10, NO_ADC); -const mcu_pin_obj_t pin_PE11 = PIN(4, 11, NO_ADC); -const mcu_pin_obj_t pin_PE12 = PIN(4, 12, NO_ADC); -const mcu_pin_obj_t pin_PE13 = PIN(4, 13, NO_ADC); -const mcu_pin_obj_t pin_PE14 = PIN(4, 14, NO_ADC); -const mcu_pin_obj_t pin_PE15 = PIN(4, 15, NO_ADC); - -const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC); -const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC); -const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC); -const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC); -const mcu_pin_obj_t pin_PB15 = PIN(1, 15, NO_ADC); - -const mcu_pin_obj_t pin_PD08 = PIN(3, 8, NO_ADC); -const mcu_pin_obj_t pin_PD09 = PIN(3, 9, NO_ADC); -const mcu_pin_obj_t pin_PD10 = PIN(3, 10, NO_ADC); -const mcu_pin_obj_t pin_PD11 = PIN(3, 11, NO_ADC); -const mcu_pin_obj_t pin_PD12 = PIN(3, 12, NO_ADC); -const mcu_pin_obj_t pin_PD13 = PIN(3, 13, NO_ADC); -const mcu_pin_obj_t pin_PD14 = PIN(3, 14, NO_ADC); -const mcu_pin_obj_t pin_PD15 = PIN(3, 15, NO_ADC); - -const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC); -const mcu_pin_obj_t pin_PC07 = PIN(2, 7, NO_ADC); -const mcu_pin_obj_t pin_PC08 = PIN(2, 8, NO_ADC); -const mcu_pin_obj_t pin_PC09 = PIN(2, 9, NO_ADC); - -const mcu_pin_obj_t pin_PA08 = PIN(0, 8, NO_ADC); -const mcu_pin_obj_t pin_PA09 = PIN(0, 9, NO_ADC); -const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC); -const mcu_pin_obj_t pin_PA11 = PIN(0, 11, NO_ADC); -const mcu_pin_obj_t pin_PA12 = PIN(0, 12, NO_ADC); -const mcu_pin_obj_t pin_PA13 = PIN(0, 13, NO_ADC); //SWDIO -const mcu_pin_obj_t pin_PA14 = PIN(0, 14, NO_ADC); //SWCLK -const mcu_pin_obj_t pin_PA15 = PIN(0, 15, NO_ADC); //JTDI - -const mcu_pin_obj_t pin_PC10 = PIN(2, 10, NO_ADC); -const mcu_pin_obj_t pin_PC11 = PIN(2, 11, NO_ADC); -const mcu_pin_obj_t pin_PC12 = PIN(2, 12, NO_ADC); - -const mcu_pin_obj_t pin_PD00 = PIN(3, 0, NO_ADC); -const mcu_pin_obj_t pin_PD01 = PIN(3, 1, NO_ADC); -const mcu_pin_obj_t pin_PD02 = PIN(3, 2, NO_ADC); -const mcu_pin_obj_t pin_PD03 = PIN(3, 3, NO_ADC); -const mcu_pin_obj_t pin_PD04 = PIN(3, 4, NO_ADC); -const mcu_pin_obj_t pin_PD05 = PIN(3, 5, NO_ADC); -const mcu_pin_obj_t pin_PD06 = PIN(3, 6, NO_ADC); -const mcu_pin_obj_t pin_PD07 = PIN(3, 7, NO_ADC); - -const mcu_pin_obj_t pin_PB03 = PIN(1, 3, NO_ADC); -const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC); -const mcu_pin_obj_t pin_PB05 = PIN(1, 5, NO_ADC); -const mcu_pin_obj_t pin_PB06 = PIN(1, 6, NO_ADC); -const mcu_pin_obj_t pin_PB07 = PIN(1, 7, NO_ADC); -const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC); -const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC); - -const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC); -const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC); \ No newline at end of file diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.h b/ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.h deleted file mode 100644 index 37d3a5cf11..0000000000 --- a/ports/stm32f4/peripherals/stm32f4/stm32f401xe/pins.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland 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_STM32F4_PERIPHERALS_STM32F411VE_PINS_H -#define MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PINS_H - -//Pins in datasheet order: DocID026289 Rev 7 page 38. LQFP100 only -//pg 38 -extern const mcu_pin_obj_t pin_PE02; -extern const mcu_pin_obj_t pin_PE03; -extern const mcu_pin_obj_t pin_PE04; -extern const mcu_pin_obj_t pin_PE05; -//pg 39 -extern const mcu_pin_obj_t pin_PE06; -extern const mcu_pin_obj_t pin_PC13; -extern const mcu_pin_obj_t pin_PC14; -extern const mcu_pin_obj_t pin_PC15; -extern const mcu_pin_obj_t pin_PC00; -extern const mcu_pin_obj_t pin_PC01; -extern const mcu_pin_obj_t pin_PC02; -extern const mcu_pin_obj_t pin_PC03; -//pg 40 -extern const mcu_pin_obj_t pin_PA00; -extern const mcu_pin_obj_t pin_PA01; -extern const mcu_pin_obj_t pin_PA02; -extern const mcu_pin_obj_t pin_PA03; -extern const mcu_pin_obj_t pin_PA04; -extern const mcu_pin_obj_t pin_PA05; -extern const mcu_pin_obj_t pin_PA06; -extern const mcu_pin_obj_t pin_PA07; -//pg 41 -extern const mcu_pin_obj_t pin_PC04; -extern const mcu_pin_obj_t pin_PC05; -extern const mcu_pin_obj_t pin_PB00; -extern const mcu_pin_obj_t pin_PB01; -extern const mcu_pin_obj_t pin_PB02; -extern const mcu_pin_obj_t pin_PE07; -extern const mcu_pin_obj_t pin_PE08; -extern const mcu_pin_obj_t pin_PE09; -extern const mcu_pin_obj_t pin_PE10; -extern const mcu_pin_obj_t pin_PE11; -extern const mcu_pin_obj_t pin_PE12; -extern const mcu_pin_obj_t pin_PE13; -extern const mcu_pin_obj_t pin_PE14; -extern const mcu_pin_obj_t pin_PE15; -//pg 42 -extern const mcu_pin_obj_t pin_PB10; -extern const mcu_pin_obj_t pin_PB12; -extern const mcu_pin_obj_t pin_PB13; -extern const mcu_pin_obj_t pin_PB14; -extern const mcu_pin_obj_t pin_PB15; -extern const mcu_pin_obj_t pin_PD08; -extern const mcu_pin_obj_t pin_PD09; -extern const mcu_pin_obj_t pin_PD10; -extern const mcu_pin_obj_t pin_PD11; -extern const mcu_pin_obj_t pin_PD12; -//pg 43 -extern const mcu_pin_obj_t pin_PD13; -extern const mcu_pin_obj_t pin_PD14; -extern const mcu_pin_obj_t pin_PD15; -extern const mcu_pin_obj_t pin_PC06; -extern const mcu_pin_obj_t pin_PC07; -extern const mcu_pin_obj_t pin_PC08; -extern const mcu_pin_obj_t pin_PC09; -extern const mcu_pin_obj_t pin_PA08; -extern const mcu_pin_obj_t pin_PA09; -//pg 44 -extern const mcu_pin_obj_t pin_PA10; -extern const mcu_pin_obj_t pin_PA11; -extern const mcu_pin_obj_t pin_PA12; -extern const mcu_pin_obj_t pin_PA13; -extern const mcu_pin_obj_t pin_PA14; -extern const mcu_pin_obj_t pin_PA15; -extern const mcu_pin_obj_t pin_PC10; -extern const mcu_pin_obj_t pin_PC11; -extern const mcu_pin_obj_t pin_PC12; -//pg 45 -extern const mcu_pin_obj_t pin_PD00; -extern const mcu_pin_obj_t pin_PD01; -extern const mcu_pin_obj_t pin_PD02; -extern const mcu_pin_obj_t pin_PD03; -extern const mcu_pin_obj_t pin_PD04; -extern const mcu_pin_obj_t pin_PD05; -extern const mcu_pin_obj_t pin_PD06; -extern const mcu_pin_obj_t pin_PD07; -extern const mcu_pin_obj_t pin_PB03; -extern const mcu_pin_obj_t pin_PB04; -extern const mcu_pin_obj_t pin_PB05; -extern const mcu_pin_obj_t pin_PB06; -//pg 46 -extern const mcu_pin_obj_t pin_PB07; -extern const mcu_pin_obj_t pin_PB08; -extern const mcu_pin_obj_t pin_PB09; -extern const mcu_pin_obj_t pin_PE00; -extern const mcu_pin_obj_t pin_PE01; - - -#endif // MICROPY_INCLUDED_STM32F4_PERIPHERALS_STM32F411VE_PINS_H From 0ae08e275d4ba0388a3fb8145e4858c637d58a31 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Fri, 6 Dec 2019 11:54:01 -0500 Subject: [PATCH 150/189] remove pyb nano folder --- .github/workflows/build.yml | 1 - ports/stm32f4/boards/pyb_nano_v2/board.c | 39 -- .../boards/pyb_nano_v2/mpconfigboard.h | 47 -- .../boards/pyb_nano_v2/mpconfigboard.mk | 19 - ports/stm32f4/boards/pyb_nano_v2/pins.c | 59 --- .../boards/pyb_nano_v2/stm32f4xx_hal_conf.h | 440 ------------------ 6 files changed, 605 deletions(-) delete mode 100644 ports/stm32f4/boards/pyb_nano_v2/board.c delete mode 100644 ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.h delete mode 100644 ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.mk delete mode 100644 ports/stm32f4/boards/pyb_nano_v2/pins.c delete mode 100644 ports/stm32f4/boards/pyb_nano_v2/stm32f4xx_hal_conf.h diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4d7db57d0e..a395d07e0f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -129,7 +129,6 @@ jobs: - "pewpew10" - "pewpew_m4" - "pirkey_m0" - - "pyb_nano_v2" - "pybadge" - "pybadge_airlift" - "pyboard_v11" diff --git a/ports/stm32f4/boards/pyb_nano_v2/board.c b/ports/stm32f4/boards/pyb_nano_v2/board.c deleted file mode 100644 index 82b0c506ed..0000000000 --- a/ports/stm32f4/boards/pyb_nano_v2/board.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 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 "boards/board.h" -#include "mpconfigboard.h" - -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} diff --git a/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.h b/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.h deleted file mode 100644 index 7980ca93d6..0000000000 --- a/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland 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 "PYB LR Nano V2" -#define MICROPY_HW_MCU_NAME "STM32F411CE" - -#define FLASH_SIZE (0x80000) -#define FLASH_PAGE_SIZE (0x4000) - -#define BOARD_OSC_DIV 8 - -// On-board flash -#define SPI_FLASH_MOSI_PIN (&pin_PB15) -#define SPI_FLASH_MISO_PIN (&pin_PB14) -#define SPI_FLASH_SCK_PIN (&pin_PB13) -#define SPI_FLASH_CS_PIN (&pin_PB12) - -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x2000 - 0xC000) - -#define AUTORESET_DELAY_MS 500 diff --git a/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.mk b/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.mk deleted file mode 100644 index d46ee0b08a..0000000000 --- a/ports/stm32f4/boards/pyb_nano_v2/mpconfigboard.mk +++ /dev/null @@ -1,19 +0,0 @@ -USB_VID = 0x239A -USB_PID = 0x8068 -USB_PRODUCT = "PYB LR Nano V2" -USB_MANUFACTURER = "MicroPython Chinese Community" -USB_DEVICES = "CDC,MSC" - -SPI_FLASH_FILESYSTEM = 1 -EXTERNAL_FLASH_DEVICE_COUNT = 1 -EXTERNAL_FLASH_DEVICES = W25Q64JV_IQ -LONGINT_IMPL = MPZ - -MCU_SERIES = m4 -MCU_VARIANT = stm32f4 -MCU_SUB_VARIANT = stm32f411xe -MCU_PACKAGE = 48 -CMSIS_MCU = STM32F411xE -LD_FILE = boards/STM32F411VETx_FLASH.ld -TEXT0_ADDR = 0x08000000 -TEXT1_ADDR = 0x08020000 \ No newline at end of file diff --git a/ports/stm32f4/boards/pyb_nano_v2/pins.c b/ports/stm32f4/boards/pyb_nano_v2/pins.c deleted file mode 100644 index e10124f6af..0000000000 --- a/ports/stm32f4/boards/pyb_nano_v2/pins.c +++ /dev/null @@ -1,59 +0,0 @@ -#include "shared-bindings/board/__init__.h" - -STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR_Y10), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_Y9), MP_ROM_PTR(&pin_PA13) }, - { MP_ROM_QSTR(MP_QSTR_Y8), MP_ROM_PTR(&pin_PA14) }, - { MP_ROM_QSTR(MP_QSTR_Y7), MP_ROM_PTR(&pin_PA15) }, - { MP_ROM_QSTR(MP_QSTR_Y6), MP_ROM_PTR(&pin_PB03) }, - { MP_ROM_QSTR(MP_QSTR_Y5), MP_ROM_PTR(&pin_PB04) }, - { MP_ROM_QSTR(MP_QSTR_Y4), MP_ROM_PTR(&pin_PB05) }, - { MP_ROM_QSTR(MP_QSTR_Y3), MP_ROM_PTR(&pin_PB06) }, - { MP_ROM_QSTR(MP_QSTR_Y2), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_Y1), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_Y0), MP_ROM_PTR(&pin_PB09) }, - - { MP_ROM_QSTR(MP_QSTR_X15), MP_ROM_PTR(&pin_PA08) }, - { MP_ROM_QSTR(MP_QSTR_X14), MP_ROM_PTR(&pin_PB15) }, - { MP_ROM_QSTR(MP_QSTR_X13), MP_ROM_PTR(&pin_PB14) }, - { MP_ROM_QSTR(MP_QSTR_X12), MP_ROM_PTR(&pin_PB13) }, - { MP_ROM_QSTR(MP_QSTR_X11), MP_ROM_PTR(&pin_PB12) }, - { MP_ROM_QSTR(MP_QSTR_X10), MP_ROM_PTR(&pin_PB10) }, - { MP_ROM_QSTR(MP_QSTR_X9), MP_ROM_PTR(&pin_PB01) }, - { MP_ROM_QSTR(MP_QSTR_X8), MP_ROM_PTR(&pin_PB00) }, - { MP_ROM_QSTR(MP_QSTR_X7), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_X6), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_X5), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_X4), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_X3), MP_ROM_PTR(&pin_PA03) }, - { MP_ROM_QSTR(MP_QSTR_X2), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_X1), MP_ROM_PTR(&pin_PA01) }, - { MP_ROM_QSTR(MP_QSTR_X0), MP_ROM_PTR(&pin_PA00) }, - - { MP_ROM_QSTR(MP_QSTR_SDA1), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_SCL1), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_SDA2), MP_ROM_PTR(&pin_PB03) }, - { MP_ROM_QSTR(MP_QSTR_SCL2), MP_ROM_PTR(&pin_PB10) }, - { MP_ROM_QSTR(MP_QSTR_SDA3), MP_ROM_PTR(&pin_PB04) }, - { MP_ROM_QSTR(MP_QSTR_SCL3), MP_ROM_PTR(&pin_PA08) }, - - { MP_ROM_QSTR(MP_QSTR_SCK1), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_MISO1), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_MOSI1), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_SCK2), MP_ROM_PTR(&pin_PB13) }, - { MP_ROM_QSTR(MP_QSTR_MISO2), MP_ROM_PTR(&pin_PB14) }, - { MP_ROM_QSTR(MP_QSTR_MOSI2), MP_ROM_PTR(&pin_PB15) }, - - { MP_ROM_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_PB06) }, - { MP_ROM_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_PA03) }, - - { MP_ROM_QSTR(MP_QSTR_LED_RED), MP_ROM_PTR(&pin_PA00) }, - { MP_ROM_QSTR(MP_QSTR_LED_GREEN), MP_ROM_PTR(&pin_PA01) }, - { MP_ROM_QSTR(MP_QSTR_LED_YELLOW), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_LED_BLUE), MP_ROM_PTR(&pin_PA03) }, - - { MP_ROM_QSTR(MP_QSTR_SW), MP_ROM_PTR(&pin_PC13) }, -}; -MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm32f4/boards/pyb_nano_v2/stm32f4xx_hal_conf.h b/ports/stm32f4/boards/pyb_nano_v2/stm32f4xx_hal_conf.h deleted file mode 100644 index ab04df3182..0000000000 --- a/ports/stm32f4/boards/pyb_nano_v2/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,440 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -#define HAL_DAC_MODULE_ENABLED -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -#define HAL_I2C_MODULE_ENABLED -#define HAL_I2S_MODULE_ENABLED -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -#define HAL_PCD_MODULE_ENABLED -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - -/* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - -/* ################## SPI peripheral configuration ########################## */ - -/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED - #include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED - #include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED - #include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED - #include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED - #include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t* file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ From 2a01f0806ec6e67d6b35f162031464f69108f2ed Mon Sep 17 00:00:00 2001 From: Hierophect Date: Fri, 6 Dec 2019 11:58:26 -0500 Subject: [PATCH 151/189] text fixes --- ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk | 2 +- ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h | 1 - ports/stm32f4/peripherals/stm32f4/periph.h | 6 ------ 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk index a9f12cbc95..d4f0f9577f 100644 --- a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk +++ b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.mk @@ -19,4 +19,4 @@ MCU_PACKAGE = 48 CMSIS_MCU = STM32F411xE LD_FILE = boards/STM32F411VETx_FLASH.ld TEXT0_ADDR = 0x08000000 -TEXT1_ADDR = 0x08020000 \ No newline at end of file +TEXT1_ADDR = 0x08020000 diff --git a/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h b/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h index 0c6f537f87..130e6a1db0 100644 --- a/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h +++ b/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h @@ -33,7 +33,6 @@ #define FLASH_PAGE_SIZE (0x4000) //16K #define BOARD_OSC_DIV 8 - #define CIRCUITPY_AUTORELOAD_DELAY_MS 500 #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x2000 - 0xC000) diff --git a/ports/stm32f4/peripherals/stm32f4/periph.h b/ports/stm32f4/peripherals/stm32f4/periph.h index ac98b89320..0d1374e850 100644 --- a/ports/stm32f4/peripherals/stm32f4/periph.h +++ b/ports/stm32f4/peripherals/stm32f4/periph.h @@ -140,12 +140,6 @@ typedef struct { //Starter Lines -#ifdef STM32F401xE -#define HAS_DAC 0 -#define HAS_TRNG 0 -#include "stm32f401xe/periph.h" -#endif - #ifdef STM32F411xE #define HAS_DAC 0 #define HAS_TRNG 0 From 6c8503b3c6665e2504d336e1c89fdf9a0d6fe92c Mon Sep 17 00:00:00 2001 From: Hierophect Date: Fri, 6 Dec 2019 12:17:38 -0500 Subject: [PATCH 152/189] VBUS fix actually doesn't work --- ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h | 1 - ports/stm32f4/supervisor/usb.c | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h index 4b46b1056b..a438b5baa6 100644 --- a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h +++ b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h @@ -33,7 +33,6 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV 25 -#define BOARD_USB_VBUS_BOOST // On-board flash // #define SPI_FLASH_MOSI_PIN (&pin_PA07) diff --git a/ports/stm32f4/supervisor/usb.c b/ports/stm32f4/supervisor/usb.c index 39538daabf..95db0aafc2 100644 --- a/ports/stm32f4/supervisor/usb.c +++ b/ports/stm32f4/supervisor/usb.c @@ -31,7 +31,6 @@ #include "lib/utils/interrupt_char.h" #include "lib/mp-readline/readline.h" #include "stm32f4xx_hal.h" -#include "py/mpconfig.h" #include "common-hal/microcontroller/Pin.h" @@ -59,11 +58,7 @@ void init_usb_hardware(void) { /* Configure VBUS Pin */ GPIO_InitStruct.Pin = GPIO_PIN_9; GPIO_InitStruct.Mode = GPIO_MODE_INPUT; -#ifdef BOARD_USB_VBUS_BOOST - GPIO_InitStruct.Pull = GPIO_PULLUP; //GPIO_NOPULL; -#else - GPIO_InitStruct.Pull = GPIO_NOPULL; //GPIO_NOPULL; -#endif + GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); never_reset_pin_number(0, 9); From e8a54eacaabb0bf16be79c3f993b660a6c069122 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 6 Dec 2019 11:13:22 -0800 Subject: [PATCH 153/189] Comment supervisor ble data arrays. --- supervisor/shared/bluetooth.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/supervisor/shared/bluetooth.c b/supervisor/shared/bluetooth.c index cf41b3fd3c..18caa2eb4a 100644 --- a/supervisor/shared/bluetooth.c +++ b/supervisor/shared/bluetooth.c @@ -51,8 +51,12 @@ bleio_characteristic_obj_t supervisor_ble_length_characteristic; bleio_uuid_obj_t supervisor_ble_length_uuid; bleio_characteristic_obj_t supervisor_ble_contents_characteristic; bleio_uuid_obj_t supervisor_ble_contents_uuid; + +// This is the base UUID for CircuitPython services and characteristics. const uint8_t circuitpython_base_uuid[16] = {0x6e, 0x68, 0x74, 0x79, 0x50, 0x74, 0x69, 0x75, 0x63, 0x72, 0x69, 0x43, 0x00, 0x00, 0xaf, 0xad }; +// This standard advertisement advertises the CircuitPython editing service and a CIRCUITPY short name. uint8_t circuitpython_advertising_data[] = { 0x02, 0x01, 0x06, 0x02, 0x0a, 0x00, 0x11, 0x07, 0x6e, 0x68, 0x74, 0x79, 0x50, 0x74, 0x69, 0x75, 0x63, 0x72, 0x69, 0x43, 0x00, 0x01, 0xaf, 0xad, 0x06, 0x08, 0x43, 0x49, 0x52, 0x43, 0x55 }; +// This scan response advertises the full CIRCUITPYXXXX device name. uint8_t circuitpython_scan_response_data[15] = {0x0e, 0x09, 0x43, 0x49, 0x52, 0x43, 0x55, 0x49, 0x54, 0x50, 0x59, 0x00, 0x00, 0x00, 0x00}; mp_obj_list_t service_list; mp_obj_t service_list_items[1]; From c38a2ac3346f68ef83dc6ec9b4fe1cef34fdcb5d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 6 Dec 2019 13:25:28 -0600 Subject: [PATCH 154/189] make translate --- locale/ID.po | 5 ++--- locale/circuitpython.pot | 5 ++--- locale/de_DE.po | 5 ++--- locale/en_US.po | 5 ++--- locale/en_x_pirate.po | 5 ++--- locale/es.po | 5 ++--- locale/fil.po | 5 ++--- locale/fr.po | 5 ++--- locale/it_IT.po | 5 ++--- locale/ko.po | 5 ++--- locale/pl.po | 5 ++--- locale/pt_BR.po | 5 ++--- locale/zh_Latn_pinyin.po | 5 ++--- 13 files changed, 26 insertions(+), 39 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index d3d025379c..472c042c60 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-04 09:44-0600\n" +"POT-Creation-Date: 2019-12-06 13:25-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -121,8 +121,7 @@ msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' integer 0x%x tidak cukup didalam mask 0x%x" #: py/proto.c -#, c-format -msgid "'%s' object does not support '%s'" +msgid "'%s' object does not support '%q'" msgstr "" #: py/obj.c diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index f9edf50af3..1541b1f74d 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-04 09:58-0600\n" +"POT-Creation-Date: 2019-12-06 13:25-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -120,8 +120,7 @@ msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "" #: py/proto.c -#, c-format -msgid "'%s' object does not support '%s'" +msgid "'%s' object does not support '%q'" msgstr "" #: py/obj.c diff --git a/locale/de_DE.po b/locale/de_DE.po index d6c3fc359c..b34626ea1a 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-04 09:44-0600\n" +"POT-Creation-Date: 2019-12-06 13:25-0600\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -122,8 +122,7 @@ msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' Integer 0x%x passt nicht in Maske 0x%x" #: py/proto.c -#, c-format -msgid "'%s' object does not support '%s'" +msgid "'%s' object does not support '%q'" msgstr "" #: py/obj.c diff --git a/locale/en_US.po b/locale/en_US.po index a2e18f8ad2..95884c7b25 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-04 09:44-0600\n" +"POT-Creation-Date: 2019-12-06 13:25-0600\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -120,8 +120,7 @@ msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "" #: py/proto.c -#, c-format -msgid "'%s' object does not support '%s'" +msgid "'%s' object does not support '%q'" msgstr "" #: py/obj.c diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index 32772646c9..ed7d2cec72 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-04 09:44-0600\n" +"POT-Creation-Date: 2019-12-06 13:25-0600\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -122,8 +122,7 @@ msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "" #: py/proto.c -#, c-format -msgid "'%s' object does not support '%s'" +msgid "'%s' object does not support '%q'" msgstr "" #: py/obj.c diff --git a/locale/es.po b/locale/es.po index 6ff7e8e174..fac38c0817 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-04 09:44-0600\n" +"POT-Creation-Date: 2019-12-06 13:25-0600\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -122,8 +122,7 @@ msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' entero 0x%x no cabe en la máscara 0x%x" #: py/proto.c -#, c-format -msgid "'%s' object does not support '%s'" +msgid "'%s' object does not support '%q'" msgstr "" #: py/obj.c diff --git a/locale/fil.po b/locale/fil.po index 1e14df3ed1..776002768d 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-04 09:44-0600\n" +"POT-Creation-Date: 2019-12-06 13:25-0600\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -123,8 +123,7 @@ msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' integer 0x%x ay wala sa mask na sakop ng 0x%x" #: py/proto.c -#, c-format -msgid "'%s' object does not support '%s'" +msgid "'%s' object does not support '%q'" msgstr "" #: py/obj.c diff --git a/locale/fr.po b/locale/fr.po index ff513edbf4..78d079bf12 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-04 09:44-0600\n" +"POT-Creation-Date: 2019-12-06 13:25-0600\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -124,8 +124,7 @@ msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' l'entier 0x%x ne correspond pas au masque 0x%x" #: py/proto.c -#, c-format -msgid "'%s' object does not support '%s'" +msgid "'%s' object does not support '%q'" msgstr "" #: py/obj.c diff --git a/locale/it_IT.po b/locale/it_IT.po index 7037ad15e0..67585fe2fb 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-04 09:44-0600\n" +"POT-Creation-Date: 2019-12-06 13:25-0600\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -122,8 +122,7 @@ msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "intero '%s' non è nell'intervallo %d..%d" #: py/proto.c -#, c-format -msgid "'%s' object does not support '%s'" +msgid "'%s' object does not support '%q'" msgstr "" #: py/obj.c diff --git a/locale/ko.po b/locale/ko.po index 7d58863229..0cf6747370 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-04 09:44-0600\n" +"POT-Creation-Date: 2019-12-06 13:25-0600\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -122,8 +122,7 @@ msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "" #: py/proto.c -#, c-format -msgid "'%s' object does not support '%s'" +msgid "'%s' object does not support '%q'" msgstr "" #: py/obj.c diff --git a/locale/pl.po b/locale/pl.po index 37395aecd2..0e33f3022c 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-04 09:44-0600\n" +"POT-Creation-Date: 2019-12-06 13:25-0600\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -121,8 +121,7 @@ msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' liczba 0x%x nie pasuje do maski 0x%x" #: py/proto.c -#, c-format -msgid "'%s' object does not support '%s'" +msgid "'%s' object does not support '%q'" msgstr "" #: py/obj.c diff --git a/locale/pt_BR.po b/locale/pt_BR.po index f2fa266154..f1f707f63d 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-04 09:44-0600\n" +"POT-Creation-Date: 2019-12-06 13:25-0600\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -122,8 +122,7 @@ msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "" #: py/proto.c -#, c-format -msgid "'%s' object does not support '%s'" +msgid "'%s' object does not support '%q'" msgstr "" #: py/obj.c diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 2e91bcafa4..6e49774b56 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-04 09:44-0600\n" +"POT-Creation-Date: 2019-12-06 13:25-0600\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -122,8 +122,7 @@ msgid "'%s' integer 0x%x does not fit in mask 0x%x" msgstr "'%s' zhěngshù 0x%x bù shìyòng yú yǎn mǎ 0x%x" #: py/proto.c -#, c-format -msgid "'%s' object does not support '%s'" +msgid "'%s' object does not support '%q'" msgstr "" #: py/obj.c From d5eca87ca23e9288b31c51f3d841fd2bb37c631b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 6 Dec 2019 13:25:40 -0600 Subject: [PATCH 155/189] audiocore: use mp_obj_t in prototypes --- shared-module/audiocore/__init__.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/shared-module/audiocore/__init__.h b/shared-module/audiocore/__init__.h index 9012c0d8b9..38c1f5aeb1 100644 --- a/shared-module/audiocore/__init__.h +++ b/shared-module/audiocore/__init__.h @@ -39,14 +39,14 @@ typedef enum { GET_BUFFER_ERROR, // Error while reading data. } audioio_get_buffer_result_t; -typedef uint32_t (*audiosample_sample_rate_fun)(void* sample_obj); -typedef uint8_t (*audiosample_bits_per_sample_fun)(void* sample_obj); -typedef uint8_t (*audiosample_channel_count_fun)(void* sample_obj); -typedef void (*audiosample_reset_buffer_fun)(void* sample_obj); -typedef audioio_get_buffer_result_t (*audiosample_get_buffer_fun)(void* sample_obj, +typedef uint32_t (*audiosample_sample_rate_fun)(mp_obj_t); +typedef uint8_t (*audiosample_bits_per_sample_fun)(mp_obj_t); +typedef uint8_t (*audiosample_channel_count_fun)(mp_obj_t); +typedef void (*audiosample_reset_buffer_fun)(mp_obj_t); +typedef audioio_get_buffer_result_t (*audiosample_get_buffer_fun)(mp_obj_t, bool single_channel, uint8_t channel, uint8_t** buffer, uint32_t* buffer_length); -typedef void (*audiosample_get_buffer_structure_fun)(void* sample_obj, +typedef void (*audiosample_get_buffer_structure_fun)(mp_obj_t, bool single_channel, bool* single_buffer, bool* samples_signed, uint32_t *max_buffer_length, uint8_t* spacing); From d628d2a261bb28b84c6b257a990bd9a30cbe369c Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 6 Dec 2019 15:18:20 -0500 Subject: [PATCH 156/189] atmel-samd working --- ports/atmel-samd/bindings/samd/Clock.c | 260 ++++++++++++++++++ .../common-hal/frequencyio/FrequencyIn.c | 2 +- ports/atmel-samd/mpconfigport.h | 48 ++-- ports/atmel-samd/peripherals | 2 +- ports/atmel-samd/supervisor/port.c | 54 +++- py/circuitpy_mpconfig.h | 3 +- tools/build_memory_info.py | 3 +- 7 files changed, 349 insertions(+), 23 deletions(-) diff --git a/ports/atmel-samd/bindings/samd/Clock.c b/ports/atmel-samd/bindings/samd/Clock.c index be597c4440..b88bb82e22 100644 --- a/ports/atmel-samd/bindings/samd/Clock.c +++ b/ports/atmel-samd/bindings/samd/Clock.c @@ -163,3 +163,263 @@ const mp_obj_type_t samd_clock_type = { .print = samd_clock_print, .locals_dict = (mp_obj_t)&samd_clock_locals_dict, }; + +#ifdef SAMD21 + +#ifdef SAMD21_EXPOSE_ALL_CLOCKS +CLOCK_SOURCE(XOSC); +CLOCK_SOURCE(GCLKIN); +CLOCK_SOURCE(GCLKGEN1); +CLOCK_SOURCE(OSCULP32K); +#endif +CLOCK_SOURCE(OSC32K); +CLOCK_SOURCE(XOSC32K); +#ifdef SAMD21_EXPOSE_ALL_CLOCKS +CLOCK_SOURCE(OSC8M); +CLOCK_SOURCE(DFLL48M); +CLOCK_SOURCE(DPLL96M); + +CLOCK_GCLK_(SYSCTRL, DFLL48); +CLOCK_GCLK_(SYSCTRL, FDPLL); +CLOCK_GCLK_(SYSCTRL, FDPLL32K); +CLOCK_GCLK(WDT); +#endif +CLOCK_GCLK(RTC); +#ifdef SAMD21_EXPOSE_ALL_CLOCKS +CLOCK_GCLK(EIC); +CLOCK_GCLK(USB); +CLOCK_GCLK_(EVSYS, 0); +CLOCK_GCLK_(EVSYS, 1); +CLOCK_GCLK_(EVSYS, 2); +CLOCK_GCLK_(EVSYS, 3); +CLOCK_GCLK_(EVSYS, 4); +CLOCK_GCLK_(EVSYS, 5); +CLOCK_GCLK_(EVSYS, 6); +CLOCK_GCLK_(EVSYS, 7); +CLOCK_GCLK_(EVSYS, 8); +CLOCK_GCLK_(EVSYS, 9); +CLOCK_GCLK_(EVSYS, 10); +CLOCK_GCLK_(EVSYS, 11); +CLOCK(SERCOMx_SLOW, 1, 19); +CLOCK_GCLK_(SERCOM0, CORE); +CLOCK_GCLK_(SERCOM1, CORE); +CLOCK_GCLK_(SERCOM2, CORE); +CLOCK_GCLK_(SERCOM3, CORE); +CLOCK_GCLK_(SERCOM4, CORE); +CLOCK_GCLK_(SERCOM5, CORE); +CLOCK(TCC0_TCC1, 1, 26); +CLOCK(TCC2_TCC3, 1, 27); +CLOCK(TC4_TC5, 1, 28); +CLOCK(TC6_TC7, 1, 29); +CLOCK_GCLK(ADC); +CLOCK_GCLK_(AC, DIG); +CLOCK_GCLK_(AC, ANA); +CLOCK_GCLK(DAC); +CLOCK_GCLK(PTC); +CLOCK_GCLK_(I2S, 0); +CLOCK_GCLK_(I2S, 1); + +CLOCK(SYSTICK, 2, 0); +#endif + +STATIC const mp_rom_map_elem_t samd_clock_global_dict_table[] = { +#ifdef SAMD21_EXPOSE_ALL_CLOCKS + CLOCK_ENTRY(XOSC), + CLOCK_ENTRY(GCLKIN), + CLOCK_ENTRY(GCLKGEN1), + CLOCK_ENTRY(OSCULP32K), +#endif + CLOCK_ENTRY(OSC32K), + CLOCK_ENTRY(XOSC32K), +#ifdef SAMD21_EXPOSE_ALL_CLOCKS + CLOCK_ENTRY(OSC8M), + CLOCK_ENTRY(DFLL48M), + CLOCK_ENTRY(DPLL96M), + CLOCK_ENTRY_(SYSCTRL, DFLL48), + CLOCK_ENTRY_(SYSCTRL, FDPLL), + CLOCK_ENTRY_(SYSCTRL, FDPLL32K), + CLOCK_ENTRY(WDT), +#endif + CLOCK_ENTRY(RTC), +#ifdef SAMD21_EXPOSE_ALL_CLOCKS + CLOCK_ENTRY(EIC), + CLOCK_ENTRY(USB), + CLOCK_ENTRY_(EVSYS, 0), + CLOCK_ENTRY_(EVSYS, 1), + CLOCK_ENTRY_(EVSYS, 2), + CLOCK_ENTRY_(EVSYS, 3), + CLOCK_ENTRY_(EVSYS, 4), + CLOCK_ENTRY_(EVSYS, 5), + CLOCK_ENTRY_(EVSYS, 6), + CLOCK_ENTRY_(EVSYS, 7), + CLOCK_ENTRY_(EVSYS, 8), + CLOCK_ENTRY_(EVSYS, 9), + CLOCK_ENTRY_(EVSYS, 10), + CLOCK_ENTRY_(EVSYS, 11), + CLOCK_ENTRY(SERCOMx_SLOW), + CLOCK_ENTRY_(SERCOM0, CORE), + CLOCK_ENTRY_(SERCOM1, CORE), + CLOCK_ENTRY_(SERCOM2, CORE), + CLOCK_ENTRY_(SERCOM3, CORE), + CLOCK_ENTRY_(SERCOM4, CORE), + CLOCK_ENTRY_(SERCOM5, CORE), + CLOCK_ENTRY(TCC0_TCC1), + CLOCK_ENTRY(TCC2_TCC3), + CLOCK_ENTRY(TC4_TC5), + CLOCK_ENTRY(TC6_TC7), + CLOCK_ENTRY(ADC), + CLOCK_ENTRY_(AC, DIG), + CLOCK_ENTRY_(AC, ANA), + CLOCK_ENTRY(DAC), + CLOCK_ENTRY(PTC), + CLOCK_ENTRY_(I2S, 0), + CLOCK_ENTRY_(I2S, 1), + + CLOCK_ENTRY(SYSTICK), +#endif +}; +MP_DEFINE_CONST_DICT(samd_clock_globals, samd_clock_global_dict_table); + +#endif // SAMD21 + +#ifdef SAMD51 + + + +#include +#include +#include +#include +#include +#include +#include + +CLOCK_SOURCE(XOSC0); +CLOCK_SOURCE(XOSC1); +CLOCK_SOURCE(GCLKIN); +CLOCK_SOURCE(GCLKGEN1); +CLOCK_SOURCE(OSCULP32K); +CLOCK_SOURCE(XOSC32K); +CLOCK_SOURCE(DFLL); +CLOCK_SOURCE(DPLL0); +CLOCK_SOURCE(DPLL1); + +CLOCK_GCLK_(OSCCTRL, DFLL48); +CLOCK_GCLK_(OSCCTRL, FDPLL0); +CLOCK_GCLK_(OSCCTRL, FDPLL1); +CLOCK_GCLK_(OSCCTRL, FDPLL032K); // GCLK_OSCCTRL_FDPLL1_32K, GCLK_SDHC0_SLOW, GCLK_SDHC1_SLOW, GCLK_SERCOM[0..7]_SLOW +CLOCK_GCLK(EIC); +CLOCK_GCLK_(FREQM, MSR); +// 6: GCLK_FREQM_REF +CLOCK_GCLK_(SERCOM0, CORE); +CLOCK_GCLK_(SERCOM1, CORE); +CLOCK(TC0_TC1, 1, 9); +CLOCK_GCLK(USB); +CLOCK_GCLK_(EVSYS, 0); +CLOCK_GCLK_(EVSYS, 1); +CLOCK_GCLK_(EVSYS, 2); +CLOCK_GCLK_(EVSYS, 3); +CLOCK_GCLK_(EVSYS, 4); +CLOCK_GCLK_(EVSYS, 5); +CLOCK_GCLK_(EVSYS, 6); +CLOCK_GCLK_(EVSYS, 7); +CLOCK_GCLK_(EVSYS, 8); +CLOCK_GCLK_(EVSYS, 9); +CLOCK_GCLK_(EVSYS, 10); +CLOCK_GCLK_(EVSYS, 11); +CLOCK_GCLK_(SERCOM2, CORE); +CLOCK_GCLK_(SERCOM3, CORE); +CLOCK(TCC0_TCC1, 1, 25); +CLOCK(TC2_TC3, 1, 26); +CLOCK_GCLK(CAN0); +CLOCK_GCLK(CAN1); +CLOCK(TCC2_TCC3, 1, 29); +CLOCK(TC4_TC5, 1, 30); +// CLOCK_GCLK(PDEC); +// CLOCK_GCLK(AC); +// CLOCK_GCLK(CCL); +CLOCK_GCLK_(SERCOM4, CORE); +CLOCK_GCLK_(SERCOM5, CORE); +CLOCK_GCLK_(SERCOM6, CORE); +CLOCK_GCLK_(SERCOM7, CORE); +CLOCK_GCLK(TCC4); +CLOCK(TC6_TC7, 1, 39); +CLOCK_GCLK(ADC0); +CLOCK_GCLK(ADC1); +CLOCK_GCLK(DAC); +CLOCK_GCLK_(I2S, 0); +CLOCK_GCLK_(I2S, 1); +// CLOCK_GCLK(SDHC0); +// CLOCK_GCLK(SDHC1); +// 47: GCLK_CM4_TRACE + +CLOCK(SYSTICK, 2, 0); +CLOCK(CPU, 2, 1); +CLOCK(RTC, 2, 2); + + +STATIC const mp_rom_map_elem_t samd_clock_global_dict_table[] = { + CLOCK_ENTRY(XOSC0), + CLOCK_ENTRY(XOSC1), + CLOCK_ENTRY(GCLKIN), + CLOCK_ENTRY(GCLKGEN1), + CLOCK_ENTRY(OSCULP32K), + CLOCK_ENTRY(XOSC32K), + CLOCK_ENTRY(DFLL), + CLOCK_ENTRY(DPLL0), + CLOCK_ENTRY(DPLL1), + + CLOCK_ENTRY_(OSCCTRL, DFLL48), + CLOCK_ENTRY_(OSCCTRL, FDPLL0), + CLOCK_ENTRY_(OSCCTRL, FDPLL1), + CLOCK_ENTRY_(OSCCTRL, FDPLL032K), + CLOCK_ENTRY(EIC), + CLOCK_ENTRY_(FREQM, MSR), + CLOCK_ENTRY_(SERCOM0, CORE), + CLOCK_ENTRY_(SERCOM1, CORE), + CLOCK_ENTRY(TC0_TC1), + CLOCK_ENTRY(USB), + CLOCK_ENTRY_(EVSYS, 0), + CLOCK_ENTRY_(EVSYS, 1), + CLOCK_ENTRY_(EVSYS, 2), + CLOCK_ENTRY_(EVSYS, 3), + CLOCK_ENTRY_(EVSYS, 4), + CLOCK_ENTRY_(EVSYS, 5), + CLOCK_ENTRY_(EVSYS, 6), + CLOCK_ENTRY_(EVSYS, 7), + CLOCK_ENTRY_(EVSYS, 8), + CLOCK_ENTRY_(EVSYS, 9), + CLOCK_ENTRY_(EVSYS, 10), + CLOCK_ENTRY_(EVSYS, 11), + CLOCK_ENTRY_(SERCOM2, CORE), + CLOCK_ENTRY_(SERCOM3, CORE), + CLOCK_ENTRY(TCC0_TCC1), + CLOCK_ENTRY(TC2_TC3), + CLOCK_ENTRY(CAN0), + CLOCK_ENTRY(CAN1), + CLOCK_ENTRY(TCC2_TCC3), + CLOCK_ENTRY(TC4_TC5), + // CLOCK_ENTRY(PDEC), + // CLOCK_ENTRY(AC), + // CLOCK_ENTRY(CCL), + CLOCK_ENTRY_(SERCOM4, CORE), + CLOCK_ENTRY_(SERCOM5, CORE), + CLOCK_ENTRY_(SERCOM6, CORE), + CLOCK_ENTRY_(SERCOM7, CORE), + CLOCK_ENTRY(TCC4), + CLOCK_ENTRY(TC6_TC7), + CLOCK_ENTRY(ADC0), + CLOCK_ENTRY(ADC1), + CLOCK_ENTRY(DAC), + CLOCK_ENTRY_(I2S, 0), + CLOCK_ENTRY_(I2S, 1), + // CLOCK_ENTRY(SDHC0), + // CLOCK_ENTRY(SDHC1), + + CLOCK_ENTRY(SYSTICK), + CLOCK_ENTRY(CPU), + CLOCK_ENTRY(RTC), +}; +MP_DEFINE_CONST_DICT(samd_clock_globals, samd_clock_global_dict_table); + +#endif // SAMD51 diff --git a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c index d34049946b..6258818c83 100644 --- a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +++ b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c @@ -213,7 +213,7 @@ void frequencyin_samd51_start_dpll() { // Will also enable the Lock Bypass due to low-frequency sources causing DPLL unlocks // as outlined in the Errata (1.12.1) OSCCTRL->Dpll[1].DPLLRATIO.reg = OSCCTRL_DPLLRATIO_LDRFRAC(0) | OSCCTRL_DPLLRATIO_LDR(2999); - if (board_has_crystal()) { // we can use XOSC32K directly as the source + if (BOARD_HAS_CRYSTAL) { // we can use XOSC32K directly as the source OSC32KCTRL->XOSC32K.bit.EN32K = 1; OSCCTRL->Dpll[1].DPLLCTRLB.reg = OSCCTRL_DPLLCTRLB_REFCLK(1) | OSCCTRL_DPLLCTRLB_LBYPASS; diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index 9733d270ad..ecb9621945 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -30,28 +30,16 @@ // Definitions for which SAMD chip we're using. #include "include/sam.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////// +#ifdef SAMD21 + #if INTERNAL_FLASH_FILESYSTEM #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (64*1024) #else #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (0) #endif -#ifndef CALIBRATE_CRYSTALLESS -#define CALIBRATE_CRYSTALLESS (0) -#endif - -// if CALIBRATE_CRYSTALLESS is requested, make room for storing -// calibration data generated from external USB. -#ifndef CIRCUITPY_INTERNAL_CONFIG_SIZE - #if CALIBRATE_CRYSTALLESS - #define CIRCUITPY_INTERNAL_CONFIG_SIZE (256) - #else - #define CIRCUITPY_INTERNAL_CONFIG_SIZE (0) - #endif -#endif - -#ifdef SAMD21 - // HMCRAMC0_SIZE is defined in the ASF4 include files for each SAMD21 chip. #define RAM_SIZE HMCRAMC0_SIZE #define BOOTLOADER_SIZE (8*1024) @@ -84,6 +72,8 @@ #endif // SAMD21 +//////////////////////////////////////////////////////////////////////////////////////////////////// + #ifdef SAMD51 #ifndef CIRCUITPY_INTERNAL_NVM_SIZE @@ -110,6 +100,7 @@ #define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (1) #define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) #define MICROPY_PY_FUNCTION_ATTRS (1) +// MICROPY_PY_UJSON depends on MICROPY_PY_IO #define MICROPY_PY_IO (1) #define MICROPY_PY_UJSON (1) #define MICROPY_PY_REVERSE_SPECIAL_METHODS (1) @@ -117,6 +108,29 @@ #endif // SAMD51 +//////////////////////////////////////////////////////////////////////////////////////////////////// + +// This also includes mpconfigboard.h. +#include "py/circuitpy_mpconfig.h" + +#ifndef CALIBRATE_CRYSTALLESS +#define CALIBRATE_CRYSTALLESS (0) +#endif + +#ifndef BOARD_HAS_CRYSTAL +#define BOARD_HAS_CRYSTAL (0) +#endif + +// if CALIBRATE_CRYSTALLESS is requested, make room for storing +// calibration data generated from external USB. +#ifndef CIRCUITPY_INTERNAL_CONFIG_SIZE + #if CALIBRATE_CRYSTALLESS + #define CIRCUITPY_INTERNAL_CONFIG_SIZE (NVMCTRL_ROW_SIZE) // 256 + #else + #define CIRCUITPY_INTERNAL_CONFIG_SIZE (0) + #endif +#endif + // Flash layout, starting at 0x00000000 // // bootloader (8 or 16kB) @@ -155,8 +169,6 @@ #include "peripherals/samd/dma.h" -#include "py/circuitpy_mpconfig.h" - #define MICROPY_PORT_ROOT_POINTERS \ CIRCUITPY_COMMON_ROOT_POINTERS \ mp_obj_t playing_audio[AUDIO_DMA_CHANNEL_COUNT]; diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index 2ba5b20ba7..bb26a4145c 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit 2ba5b20ba725e1c91c77875fba3a5e22059cdb92 +Subproject commit bb26a4145c86a51debc6571bb1f791e0d4fd296b diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index e962281c1e..5662b159bc 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -24,12 +24,16 @@ * THE SOFTWARE. */ +#include +#include + #include "boards/board.h" #include "supervisor/port.h" // ASF 4 #include "atmel_start_pins.h" #include "hal/include/hal_delay.h" +#include "hal/include/hal_flash.h" #include "hal/include/hal_gpio.h" #include "hal/include/hal_init.h" #include "hpl/gclk/hpl_gclk_base.h" @@ -94,6 +98,40 @@ extern volatile bool mp_msc_enabled; __attribute__((__aligned__(TRACE_BUFFER_SIZE_BYTES))) uint32_t mtb[TRACE_BUFFER_SIZE] = {0}; #endif +#if CALIBRATE_CRYSTALLESS +static void save_usb_clock_calibration(void) { + // If we are on USB lets double check our fine calibration for the clock and + // save the new value if its different enough. + SYSCTRL->DFLLSYNC.bit.READREQ = 1; + uint16_t saved_calibration = 0x1ff; + if (strcmp((char*) CIRCUITPY_INTERNAL_CONFIG_START_ADDR, "CIRCUITPYTHON1") == 0) { + saved_calibration = ((uint16_t *) CIRCUITPY_INTERNAL_CONFIG_START_ADDR)[8]; + } + while (SYSCTRL->PCLKSR.bit.DFLLRDY == 0) { + // TODO(tannewt): Run the mass storage stuff if this takes a while. + } + int16_t current_calibration = SYSCTRL->DFLLVAL.bit.FINE; + if (abs(current_calibration - saved_calibration) > 10) { + // Copy the full internal config page to memory. + uint8_t page_buffer[NVMCTRL_ROW_SIZE]; + memcpy(page_buffer, (uint8_t*) CIRCUITPY_INTERNAL_CONFIG_START_ADDR, NVMCTRL_ROW_SIZE); + + // Modify it. + memcpy(page_buffer, "CIRCUITPYTHON1", 15); + // First 16 bytes (0-15) are ID. Little endian! + page_buffer[16] = current_calibration & 0xff; + page_buffer[17] = current_calibration >> 8; + + // Write it back. + // We don't use features that use any advanced NVMCTRL features so we can fake the descriptor + // whenever we need it instead of storing it long term. + struct flash_descriptor desc; + desc.dev.hw = NVMCTRL; + flash_write(&desc, (uint32_t) CIRCUITPY_INTERNAL_CONFIG_START_ADDR, page_buffer, NVMCTRL_ROW_SIZE); + } +} +#endif + safe_mode_t port_init(void) { #if defined(SAMD21) @@ -168,7 +206,19 @@ safe_mode_t port_init(void) { hri_nvmctrl_set_CTRLB_RWS_bf(NVMCTRL, 2); _pm_init(); #endif - clock_init(); + +#if CALIBRATE_CRYSTALLESS + uint32_t fine = DEFAULT_DFLL48M_FINE_CALIBRATION; + // The fine calibration data is stored in an NVM page after the text and data storage but before + // the optional file system. The first 16 bytes are the identifier for the section. + if (strcmp((char*) CIRCUITPY_INTERNAL_CONFIG_START_ADDR, "CIRCUITPYTHON1") == 0) { + fine = ((uint16_t *) CIRCUITPY_INTERNAL_CONFIG_START_ADDR)[8]; + } + clock_init(BOARD_HAS_CRYSTAL, fine); +#else + // Use a default fine value + clock_init(BOARD_HAS_CRYSTAL, DEFAULT_DFLL48M_FINE_CALIBRATION); +#endif // Configure millisecond timer initialization. tick_init(); @@ -257,9 +307,11 @@ void reset_port(void) { // gpio_set_pin_function(PIN_PB15, GPIO_PIN_FUNCTION_M); // GCLK1, D6 // #endif +#if CALIBRATE_CRYSTALLESS if (tud_cdc_connected()) { save_usb_clock_calibration(); } +#endif } void reset_to_bootloader(void) { diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index cf21d26dd0..c4606074fa 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -174,7 +174,8 @@ typedef long mp_off_t; { MP_OBJ_NEW_QSTR(MP_QSTR_input), (mp_obj_t)&mp_builtin_input_obj }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj }, -// board specific definitions +////////////////////////////////////////////////////////////////////////////////////////////////// +// board-specific definitions, which control and may override definitions below. #include "mpconfigboard.h" // CIRCUITPY_FULL_BUILD is defined in a *.mk file. diff --git a/tools/build_memory_info.py b/tools/build_memory_info.py index 0dcd5f6e48..f128561ab2 100644 --- a/tools/build_memory_info.py +++ b/tools/build_memory_info.py @@ -41,6 +41,7 @@ data = 0 bss = 0 # stdin is the linker output. for line in sys.stdin: + print(line) line = line.strip() if not line.startswith("text"): text, data, bss = map(int, line.split()[:3]) @@ -64,7 +65,7 @@ for region in regions: free_flash = regions["FLASH_FIRMWARE"] - text - data free_ram = regions["RAM"] - data - bss print("{} bytes free in flash firmware space out of {} bytes ({}kB).".format(free_flash, regions["FLASH_FIRMWARE"], regions["FLASH_FIRMWARE"] / 1024)) -print("{} bytes free in ram for stack out of {} bytes ({}kB).".format(free_ram, regions["RAM"], regions["RAM"] / 1024)) +print("{} bytes free in ram for heap out of {} bytes ({}kB).".format(free_ram, regions["RAM"], regions["RAM"] / 1024)) print() # Check that we have free flash space. GCC doesn't fail when the text + data From 252da17bc911b79ea82402d1dd7c5691bb5cbbba Mon Sep 17 00:00:00 2001 From: Hierophect Date: Fri, 6 Dec 2019 15:55:00 -0500 Subject: [PATCH 157/189] Create VBUS disable interface in shared supervisor --- .../stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h | 1 + ports/stm32f4/supervisor/usb.c | 9 ++++++++- supervisor/shared/usb/usb.c | 7 +++++++ supervisor/usb.h | 2 ++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h index a438b5baa6..b8e374f05b 100644 --- a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h +++ b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h @@ -33,6 +33,7 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV 25 +#define BOARD_NO_VBUS // On-board flash // #define SPI_FLASH_MOSI_PIN (&pin_PA07) diff --git a/ports/stm32f4/supervisor/usb.c b/ports/stm32f4/supervisor/usb.c index 95db0aafc2..a97b1f2574 100644 --- a/ports/stm32f4/supervisor/usb.c +++ b/ports/stm32f4/supervisor/usb.c @@ -43,6 +43,7 @@ void init_usb_hardware(void) { PA11 ------> USB_OTG_FS_DM PA12 ------> USB_OTG_FS_DP */ + __HAL_RCC_GPIOA_CLK_ENABLE(); /* Configure DM DP Pins */ @@ -58,7 +59,7 @@ void init_usb_hardware(void) { /* Configure VBUS Pin */ GPIO_InitStruct.Pin = GPIO_PIN_9; GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); never_reset_pin_number(0, 9); @@ -83,3 +84,9 @@ void init_usb_hardware(void) { /* Peripheral clock enable */ __HAL_RCC_USB_OTG_FS_CLK_ENABLE(); } + +void disable_usb_vbus(void) { + USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_NOVBUSSENS; + USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBUSBSEN; + USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBUSASEN; +} diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index c1d70c5b0f..fca08b4eed 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -33,6 +33,8 @@ #include "lib/utils/interrupt_char.h" #include "lib/mp-readline/readline.h" +#include "py/mpconfig.h" + #include "tusb.h" // Serial number as hex characters. This writes directly to the USB @@ -72,6 +74,11 @@ void usb_init(void) { #if CIRCUITPY_USB_MIDI usb_midi_init(); #endif + +#ifdef BOARD_NO_VBUS + disable_usb_vbus(); +#endif + } void usb_background(void) { diff --git a/supervisor/usb.h b/supervisor/usb.h index c87540d408..6b4082b6f8 100644 --- a/supervisor/usb.h +++ b/supervisor/usb.h @@ -37,6 +37,8 @@ void usb_background(void); // TinyUSB. void init_usb_hardware(void); +void disable_usb_vbus(void); + // Shared implementation. bool usb_enabled(void); void usb_init(void); From dd4d3a662d59360253e632415e65480c2bc1c9e0 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Fri, 6 Dec 2019 16:44:17 -0500 Subject: [PATCH 158/189] conditional for F412 register difference --- ports/stm32f4/supervisor/usb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/stm32f4/supervisor/usb.c b/ports/stm32f4/supervisor/usb.c index a97b1f2574..e3baf1412b 100644 --- a/ports/stm32f4/supervisor/usb.c +++ b/ports/stm32f4/supervisor/usb.c @@ -86,7 +86,12 @@ void init_usb_hardware(void) { } void disable_usb_vbus(void) { + +#ifdef USB_OTG_GCCFG_VBDEN + USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBDEN; +#else USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_NOVBUSSENS; USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBUSBSEN; USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBUSASEN; +#endif } From da0ea979ff651e6358e99b6369a22b9184e2f7e6 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 5 Dec 2019 15:02:52 -0800 Subject: [PATCH 159/189] Check connection validity after service discovery. Fixes #2347 --- ports/nrf/bluetooth/ble_drv.c | 4 ---- ports/nrf/common-hal/_bleio/Connection.c | 6 +----- shared-bindings/_bleio/Connection.c | 10 +++++----- shared-bindings/_bleio/Connection.h | 2 ++ shared-bindings/_bleio/Service.c | 2 +- 5 files changed, 9 insertions(+), 15 deletions(-) diff --git a/ports/nrf/bluetooth/ble_drv.c b/ports/nrf/bluetooth/ble_drv.c index 896fa0fb09..63d67a7f4a 100644 --- a/ports/nrf/bluetooth/ble_drv.c +++ b/ports/nrf/bluetooth/ble_drv.c @@ -153,10 +153,6 @@ void SD_EVT_IRQHandler(void) { ble_gatts_evt_write_t* write_evt = &event->evt.gatts_evt.params.write; mp_printf(&mp_plat_print, "Write to: UUID(0x%04x) handle %x of length %d auth %x\n", write_evt->uuid.uuid, write_evt->handle, write_evt->len, write_evt->auth_required); } - if (!done) { - mp_printf(&mp_plat_print, "Unhandled ble event: 0x%04x\n", event->header.evt_id); - - } #endif } } diff --git a/ports/nrf/common-hal/_bleio/Connection.c b/ports/nrf/common-hal/_bleio/Connection.c index 0720d5c472..e0b50901ad 100644 --- a/ports/nrf/common-hal/_bleio/Connection.c +++ b/ports/nrf/common-hal/_bleio/Connection.c @@ -248,11 +248,6 @@ bool connection_on_ble_evt(ble_evt_t *ble_evt, void *self_in) { default: - // For debugging. - #if CIRCUITPY_VERBOSE_BLE - mp_printf(&mp_plat_print, "Unhandled connection event: 0x%04x\n", ble_evt->header.evt_id); - #endif - return false; } return true; @@ -659,6 +654,7 @@ STATIC void discover_remote_services(bleio_connection_internal_t *self, mp_obj_t mp_obj_tuple_t *common_hal_bleio_connection_discover_remote_services(bleio_connection_obj_t *self, mp_obj_t service_uuids_whitelist) { discover_remote_services(self->connection, service_uuids_whitelist); + bleio_connection_ensure_connected(self); // Convert to a tuple and then clear the list so the callee will take ownership. mp_obj_tuple_t *services_tuple = service_linked_list_to_tuple(self->connection->remote_service_list); self->connection->remote_service_list = NULL; diff --git a/shared-bindings/_bleio/Connection.c b/shared-bindings/_bleio/Connection.c index 709f6c2540..c157af3652 100644 --- a/shared-bindings/_bleio/Connection.c +++ b/shared-bindings/_bleio/Connection.c @@ -66,7 +66,7 @@ //| connection = _bleio.adapter.connect(my_entry.address, timeout=10) //| -STATIC void ensure_connected(bleio_connection_obj_t *self) { +void bleio_connection_ensure_connected(bleio_connection_obj_t *self) { if (!common_hal_bleio_connection_get_connected(self)) { mp_raise_bleio_ConnectionError(translate("Connection has been disconnected and can no longer be used. Create a new connection.")); } @@ -106,7 +106,7 @@ STATIC mp_obj_t bleio_connection_pair(mp_uint_t n_args, const mp_obj_t *pos_args 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); - ensure_connected(self); + bleio_connection_ensure_connected(self); common_hal_bleio_connection_pair(self->connection, args[ARG_bond].u_bool); return mp_const_none; @@ -148,7 +148,7 @@ STATIC mp_obj_t bleio_connection_discover_remote_services(mp_uint_t n_args, cons 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); - ensure_connected(self); + bleio_connection_ensure_connected(self); return MP_OBJ_FROM_PTR(common_hal_bleio_connection_discover_remote_services( self, @@ -209,7 +209,7 @@ const mp_obj_property_t bleio_connection_paired_obj = { STATIC mp_obj_t bleio_connection_get_connection_interval(mp_obj_t self_in) { bleio_connection_obj_t *self = MP_OBJ_TO_PTR(self_in); - ensure_connected(self); + bleio_connection_ensure_connected(self); return mp_obj_new_float(common_hal_bleio_connection_get_connection_interval(self->connection)); } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_connection_get_connection_interval_obj, bleio_connection_get_connection_interval); @@ -219,7 +219,7 @@ STATIC mp_obj_t bleio_connection_set_connection_interval(mp_obj_t self_in, mp_ob mp_float_t interval = mp_obj_get_float(interval_in); - ensure_connected(self); + bleio_connection_ensure_connected(self); common_hal_bleio_connection_set_connection_interval(self->connection, interval); return mp_const_none; diff --git a/shared-bindings/_bleio/Connection.h b/shared-bindings/_bleio/Connection.h index b0e26da5c8..c6f2601608 100644 --- a/shared-bindings/_bleio/Connection.h +++ b/shared-bindings/_bleio/Connection.h @@ -43,4 +43,6 @@ extern mp_obj_tuple_t *common_hal_bleio_connection_discover_remote_services(blei mp_float_t common_hal_bleio_connection_get_connection_interval(bleio_connection_internal_t *self); void common_hal_bleio_connection_set_connection_interval(bleio_connection_internal_t *self, mp_float_t new_interval); +void bleio_connection_ensure_connected(bleio_connection_obj_t *self); + #endif // MICROPY_INCLUDED_SHARED_BINDINGS_BLEIO_CONNECTION_H diff --git a/shared-bindings/_bleio/Service.c b/shared-bindings/_bleio/Service.c index 43679393a2..bc242bc364 100644 --- a/shared-bindings/_bleio/Service.c +++ b/shared-bindings/_bleio/Service.c @@ -136,7 +136,7 @@ const mp_obj_property_t bleio_service_secondary_obj = { //| .. attribute:: uuid //| //| The UUID of this service. (read-only) -//| +//| //| Will be ``None`` if the 128-bit UUID for this service is not known. //| STATIC mp_obj_t bleio_service_get_uuid(mp_obj_t self_in) { From 1905d0746dbd8677161dfc4523558a8fa8b029ed Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 7 Dec 2019 19:06:17 -0600 Subject: [PATCH 160/189] samd: neopixel: Fix neopixels after #2297 This adapts the "inline assembler" code from the UF2 bootloader, which in turn is said to be adapted from the arduino neopixel library. This requires the cache remain ON when using M0, and be turned OFF on M4 (determined by trial and error) Testing performed on a Metro M4: * measured timings using o'scope and found all values within datasheet tolerance. * Drove a string of 96 neopixels without visible glitches * on-board neopixel worked Testing performed on a Circuit Playground Express (M0): * Color wheel code works on built-in neopixels * Color wheel code works on 96 neopixel strip As a bonus, this may have freed up a bit of flash on M0 targets. (2988 -> 3068 bytes free on Trinket M0) Closes: #2297 --- .../common-hal/neopixel_write/__init__.c | 157 +++++++----------- 1 file changed, 63 insertions(+), 94 deletions(-) diff --git a/ports/atmel-samd/common-hal/neopixel_write/__init__.c b/ports/atmel-samd/common-hal/neopixel_write/__init__.c index 57e963c918..ba69174af4 100644 --- a/ports/atmel-samd/common-hal/neopixel_write/__init__.c +++ b/ports/atmel-samd/common-hal/neopixel_write/__init__.c @@ -34,24 +34,62 @@ #ifdef SAMD51 #include "hri/hri_cmcc_d51.h" #include "hri/hri_nvmctrl_d51.h" - -// This magical macro makes sure the delay isn't optimized out and is the -// minimal three instructions. -#define delay_cycles(cycles) \ -{ \ - uint32_t t; \ - asm volatile ( \ - "movs %[t], %[c]\n\t" \ - "loop%=:\n\t" \ - "subs %[t], #1\n\t" \ - "bne.n loop%=" : [t] "=r"(t) : [c] "I" (cycles)); \ - } #endif -// Ensure this code is compiled with -Os. Any other optimization level may change the timing of it -// and break neopixels. -#pragma GCC push_options -#pragma GCC optimize ("Os") +__attribute__((naked,noinline,aligned(16))) +static void neopixel_send_buffer_core(volatile uint32_t *clraddr, uint32_t pinMask, + const uint8_t *ptr, int numBytes); + +static void neopixel_send_buffer_core(volatile uint32_t *clraddr, uint32_t pinMask, + const uint8_t *ptr, int numBytes) { + asm volatile(" push {r4, r5, r6, lr};" + " add r3, r2, r3;" + "loopLoad:" + " ldrb r5, [r2, #0];" // r5 := *ptr + " add r2, #1;" // ptr++ + " movs r4, #128;" // r4-mask, 0x80 + "loopBit:" + " str r1, [r0, #4];" // set + #ifdef SAMD21 + " movs r6, #3; d2: sub r6, #1; bne d2;" // delay 3 + #endif + #ifdef SAMD51 + " movs r6, #3; d2: subs r6, #1; bne d2;" // delay 3 + #endif + " tst r4, r5;" // mask&r5 + " bne skipclr;" + " str r1, [r0, #0];" // clr + "skipclr:" + #ifdef SAMD21 + " movs r6, #6; d0: sub r6, #1; bne d0;" // delay 6 + #endif + #ifdef SAMD51 + " movs r6, #6; d0: subs r6, #1; bne d0;" // delay 6 + #endif + " str r1, [r0, #0];" // clr (possibly again, doesn't matter) + #ifdef SAMD21 + " asr r4, r4, #1;" // mask >>= 1 + #endif + #ifdef SAMD51 + " asrs r4, r4, #1;" // mask >>= 1 + #endif + " beq nextbyte;" + " uxtb r4, r4;" + #ifdef SAMD21 + " movs r6, #2; d1: sub r6, #1; bne d1;" // delay 2 + #endif + #ifdef SAMD51 + " movs r6, #2; d1: subs r6, #1; bne d1;" // delay 2 + #endif + " b loopBit;" + "nextbyte:" + " cmp r2, r3;" + " bcs neopixel_stop;" + " b loopLoad;" + "neopixel_stop:" + " pop {r4, r5, r6, pc};" + ""); +} uint64_t next_start_tick_ms = 0; uint32_t next_start_tick_us = 1000; @@ -59,7 +97,7 @@ uint32_t next_start_tick_us = 1000; void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout, uint8_t *pixels, uint32_t numBytes) { // This is adapted directly from the Adafruit NeoPixel library SAMD21G18A code: // https://github.com/adafruit/Adafruit_NeoPixel/blob/master/Adafruit_NeoPixel.cpp - uint8_t *ptr, *end, p, bitMask; + // and the asm version from https://github.com/microsoft/uf2-samdx1/blob/master/inc/neopixel.h uint32_t pinMask; PortGroup* port; @@ -71,21 +109,18 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout, mp_hal_disable_all_interrupts(); - #ifdef SAMD21 - // Make sure the NVM cache is consistently timed. - NVMCTRL->CTRLB.bit.READMODE = NVMCTRL_CTRLB_READMODE_DETERMINISTIC_Val; - #endif - #ifdef SAMD51 // When this routine is positioned at certain addresses, the timing logic // below can be too fast by about 2.5x. This is some kind of (un)fortunate code - // positiong with respect to a cache line. + // positioning with respect to a cache line. // Theoretically we should turn on off the CMCC caches and the // NVM caches to ensure consistent timing. Testing shows the the NVMCTRL // cache disabling seems to make the difference. But turn both off to make sure. // It's difficult to test because additions to the code before the timing loop - // below change instruction placement. Testing was done by adding cache changes - // below the loop (so only the first time through is wrong). + // below change instruction placement. (though this should be less true now that + // the main code is in the cache-aligned function neopixel_send_buffer_core) + // Testing was done by adding cache changes below the loop (so only the + // first time through is wrong). // // Turn off instruction, data, and NVM caches to force consistent timing. // Invalidate existing cache entries. @@ -93,78 +128,13 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout, hri_cmcc_write_MAINT0_reg(CMCC, CMCC_MAINT0_INVALL); hri_nvmctrl_set_CTRLA_CACHEDIS0_bit(NVMCTRL); hri_nvmctrl_set_CTRLA_CACHEDIS1_bit(NVMCTRL); - #endif + #endif uint32_t pin = digitalinout->pin->number; port = &PORT->Group[GPIO_PORT(pin)]; // Convert GPIO # to port register pinMask = (1UL << (pin % 32)); // From port_pin_set_output_level ASF code. - ptr = pixels; - end = ptr + numBytes; - p = *ptr++; - bitMask = 0x80; - - volatile uint32_t *set = &(port->OUTSET.reg), - *clr = &(port->OUTCLR.reg); - - for(;;) { - *set = pinMask; - // This is the time where the line is always high regardless of the bit. - // For the SK6812 its 0.3us +- 0.15us - #ifdef SAMD21 - asm("nop; nop;"); - #endif - #ifdef SAMD51 - delay_cycles(2); - #endif - if((p & bitMask) != 0) { - // This is the high delay unique to a one bit. - // For the SK6812 its 0.3us - #ifdef SAMD21 - asm("nop; nop; nop; nop; nop; nop; nop;"); - #endif - #ifdef SAMD51 - delay_cycles(3); - #endif - *clr = pinMask; - } else { - *clr = pinMask; - // This is the low delay unique to a zero bit. - // For the SK6812 its 0.3us - #ifdef SAMD21 - asm("nop; nop;"); - #endif - #ifdef SAMD51 - delay_cycles(2); - #endif - } - if((bitMask >>= 1) != 0) { - // This is the delay between bits in a byte and is the 1 code low - // level time from the datasheet. - // For the SK6812 its 0.6us +- 0.15us - #ifdef SAMD21 - asm("nop; nop; nop; nop; nop;"); - #endif - #ifdef SAMD51 - delay_cycles(4); - #endif - } else { - if(ptr >= end) break; - p = *ptr++; - bitMask = 0x80; - // This is the delay between bytes. It's similar to the other branch - // in the if statement except its tuned to account for the time the - // above operations take. - // For the SK6812 its 0.6us +- 0.15us - #ifdef SAMD51 - delay_cycles(3); - #endif - } - } - - #ifdef SAMD21 - // Speed up! (But inconsistent timing.) - NVMCTRL->CTRLB.bit.READMODE = NVMCTRL_CTRLB_READMODE_NO_MISS_PENALTY_Val; - #endif + volatile uint32_t *clr = &(port->OUTCLR.reg); + neopixel_send_buffer_core(clr, pinMask, pixels, numBytes); #ifdef SAMD51 // Turn instruction, data, and NVM caches back on. @@ -189,4 +159,3 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout, } -#pragma GCC pop_options From 13620cc4db2c3e0d2655c6ee7ad9faab934488e2 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 9 Dec 2019 10:57:55 -0600 Subject: [PATCH 161/189] nRF: PWMAudioOut: fix half-speed playback of stereo samples The "spacing" of "buffer structure" is confusing, use the "channel count" instead. Testing performed on nrf52840 feather: Play stereo and mono, 8- and 16-bit, 8kHz RawSamples representing 333.33Hz square waves. Use both mono and stereo PWMAudioOut instances. Scope the RC-filtered signal and use the scope's frequency measurement function, verify the frequency is 333 or 334Hz in all tested cases. In the "stereo output" cases, verify both the L and R channels. Verify the output amplitude is the same in both channels. In the "stereo output" cases, run a second test where the L channel's amplitude is attenuated 50%. Verify the output amplitude is correct in each channel. --- ports/nrf/common-hal/audiopwmio/PWMAudioOut.c | 16 ++++++++++------ ports/nrf/common-hal/audiopwmio/PWMAudioOut.h | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c index 9496277b10..b4c626355f 100644 --- a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +++ b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c @@ -97,27 +97,28 @@ STATIC void fill_buffers(audiopwmio_pwmaudioout_obj_t *self, int buf) { common_hal_audiopwmio_pwmaudioout_stop(self); return; } - uint32_t num_samples = buffer_length / self->bytes_per_sample / self->spacing; + uint32_t num_samples = buffer_length / self->bytes_per_sample / self->sample_channel_count; + uint16_t *end_dev_buffer = dev_buffer + 2 * num_samples; if (self->bytes_per_sample == 1) { uint8_t offset = self->signed_to_unsigned ? 0x80 : 0; uint16_t scale = self->scale; - for (uint32_t i=0; ispacing; i++) { + while (dev_buffer < end_dev_buffer) { uint8_t rawval = (*buffer++ + offset); uint16_t val = (uint16_t)(((uint32_t)rawval * (uint32_t)scale) >> 8); *dev_buffer++ = val; - if (self->spacing == 1) + if (self->sample_channel_count == 1) *dev_buffer++ = val; } } else { uint16_t offset = self->signed_to_unsigned ? 0x8000 : 0; uint16_t scale = self->scale; uint16_t *buffer16 = (uint16_t*)buffer; - for (uint32_t i=0; ispacing; i++) { + while (dev_buffer < end_dev_buffer) { uint16_t rawval = (*buffer16++ + offset); uint16_t val = (uint16_t)((rawval * (uint32_t)scale) >> 16); *dev_buffer++ = val; - if (self->spacing == 1) + if (self->sample_channel_count == 1) *dev_buffer++ = val; } } @@ -231,9 +232,12 @@ void common_hal_audiopwmio_pwmaudioout_play(audiopwmio_pwmaudioout_obj_t* self, self->bytes_per_sample = audiosample_bits_per_sample(sample) / 8; uint32_t max_buffer_length; + uint8_t spacing; audiosample_get_buffer_structure(sample, /* single channel */ false, &self->single_buffer, &self->signed_to_unsigned, &max_buffer_length, - &self->spacing); + &spacing); + self->sample_channel_count = audiosample_channel_count(sample); + if (max_buffer_length > UINT16_MAX) { mp_raise_ValueError_varg(translate("Buffer length %d too big. It must be less than %d"), max_buffer_length, UINT16_MAX); } diff --git a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.h b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.h index 8deff5d340..ed00324c41 100644 --- a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.h +++ b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.h @@ -41,7 +41,7 @@ typedef struct { uint8_t left_channel_number; uint8_t right_channel_number; - uint8_t spacing; + uint8_t sample_channel_count; uint8_t bytes_per_sample; bool playing; From 60f399395a4439cbff865b9dc62f41e9ad93b9f9 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 9 Dec 2019 18:30:24 -0500 Subject: [PATCH 162/189] Add POWER_SWITCH pin to CPB --- .../nrf/boards/circuitplayground_bluefruit/board.c | 14 +++++++++++++- .../circuitplayground_bluefruit/mpconfigboard.h | 3 +++ .../nrf/boards/circuitplayground_bluefruit/pins.c | 6 +++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ports/nrf/boards/circuitplayground_bluefruit/board.c b/ports/nrf/boards/circuitplayground_bluefruit/board.c index 4421970eef..7c8ec8e9a2 100644 --- a/ports/nrf/boards/circuitplayground_bluefruit/board.c +++ b/ports/nrf/boards/circuitplayground_bluefruit/board.c @@ -25,6 +25,11 @@ */ #include "boards/board.h" +#include "mpconfigboard.h" +#include "py/obj.h" +#include "peripherals/nrf/pins.h" + +#include "nrf_gpio.h" void board_init(void) { } @@ -34,5 +39,12 @@ bool board_requests_safe_mode(void) { } void reset_board(void) { - + // Turn off board.POWER_SWITCH (power-saving switch) on each soft reload, to prevent confusion. + nrf_gpio_cfg(POWER_SWITCH_PIN->number, + NRF_GPIO_PIN_DIR_OUTPUT, + NRF_GPIO_PIN_INPUT_DISCONNECT, + NRF_GPIO_PIN_NOPULL, + NRF_GPIO_PIN_S0S1, + NRF_GPIO_PIN_NOSENSE); + nrf_gpio_pin_write(POWER_SWITCH_PIN->number, false); } diff --git a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h index 4e37eae0aa..21ba3a976b 100644 --- a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h +++ b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h @@ -54,6 +54,9 @@ #define SPI_FLASH_CS_PIN &pin_P0_15 #endif +// Disables onboard peripherals and neopixels to save power. +#define POWER_SWITCH_PIN (&pin_P0_06) + #define CIRCUITPY_AUTORELOAD_DELAY_MS 500 #define CIRCUITPY_INTERNAL_NVM_SIZE (4096) diff --git a/ports/nrf/boards/circuitplayground_bluefruit/pins.c b/ports/nrf/boards/circuitplayground_bluefruit/pins.c index e8e5f4110d..d0d9659db7 100644 --- a/ports/nrf/boards/circuitplayground_bluefruit/pins.c +++ b/ports/nrf/boards/circuitplayground_bluefruit/pins.c @@ -48,8 +48,12 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_SLIDE_SWITCH), MP_ROM_PTR(&pin_P1_06) }, { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_P1_06) }, - { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_P1_14) }, + // If high, turns off NeoPixels, LIS3DH, sound sensor, light sensor, temp sensor. + { MP_ROM_QSTR(MP_QSTR_POWER_SWITCH), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_P1_14) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_P1_14) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_P0_13) }, { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_P0_13) }, From a484a93b290806d01850e58905d65bc798b4cd91 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 29 Nov 2019 08:15:29 -0600 Subject: [PATCH 163/189] nRF: disk_read must be 4-byte aligned .. a requirement that oofatfs needs to be taught to respect. This problem can be demonstrated with the following snippet, except that the related file ("test.bin") must also be contiguous on the filesystem. You can ensure this by reformatting your device's filesystem before testing, then copying any single file bigger than 4kB to test.bin. f = open("test.bin", "rb") f.seek(2048) b = bytearray(2048) v = memoryview(b) f.readinto(v[909:]) Closes: #2332 --- lib/oofatfs/ff.c | 6 +++++- lib/oofatfs/ffconf.h | 6 ++++++ ports/nrf/Makefile | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/oofatfs/ff.c b/lib/oofatfs/ff.c index b0984756bf..71bd19702a 100644 --- a/lib/oofatfs/ff.c +++ b/lib/oofatfs/ff.c @@ -3382,7 +3382,11 @@ FRESULT f_read ( if (!sect) ABORT(fs, FR_INT_ERR); sect += csect; cc = btr / SS(fs); /* When remaining bytes >= sector size, */ - if (cc) { /* Read maximum contiguous sectors directly */ + if (cc +#if _FS_DISK_READ_ALIGNED + && (((int)rbuff & 3) == 0) +#endif + ) {/* Read maximum contiguous sectors directly */ if (csect + cc > fs->csize) { /* Clip at cluster boundary */ cc = fs->csize - csect; } diff --git a/lib/oofatfs/ffconf.h b/lib/oofatfs/ffconf.h index 214311b4c2..a3795fa3fe 100644 --- a/lib/oofatfs/ffconf.h +++ b/lib/oofatfs/ffconf.h @@ -343,6 +343,12 @@ / SemaphoreHandle_t and etc.. A header file for O/S definitions needs to be / included somewhere in the scope of ff.h. */ +// Set to nonzero if buffers passed to disk_read have a word alignment +// restriction +#ifndef _FS_DISK_READ_ALIGNED +#define _FS_DISK_READ_ALIGNED 0 +#endif + /* #include // O/S definitions */ diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index be8a71b3f3..096dfaa4bf 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -106,6 +106,7 @@ CFLAGS += -Wno-undef CFLAGS += -Wno-cast-align NRF_DEFINES += -DCONFIG_GPIO_AS_PINRESET +NRF_DEFINES += -D_FS_DISK_READ_ALIGNED=1 CFLAGS += $(NRF_DEFINES) CFLAGS += \ From a08d9e6d8e0059c8aa59feadd7b94d95d691e273 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 26 Nov 2019 09:29:55 -0600 Subject: [PATCH 164/189] audiocore: Add MP3File using Adafruit_MP3 library --- .gitmodules | 3 + lib/mp3 | 1 + locale/ID.po | 22 +- locale/circuitpython.pot | 22 +- locale/de_DE.po | 18 +- locale/en_US.po | 22 +- locale/en_x_pirate.po | 22 +- locale/es.po | 18 +- locale/fil.po | 18 +- locale/fr.po | 18 +- locale/it_IT.po | 18 +- locale/ko.po | 22 +- locale/pl.po | 18 +- locale/pt_BR.po | 18 +- locale/zh_Latn_pinyin.po | 18 +- .../boards/kicksat-sprite/mpconfigboard.mk | 1 + ports/atmel-samd/mpconfigport.mk | 4 + py/circuitpy_defns.mk | 25 ++ py/circuitpy_mpconfig.h | 8 + py/circuitpy_mpconfig.mk | 9 + shared-bindings/audiomp3/MP3File.c | 226 +++++++++++++++ shared-bindings/audiomp3/MP3File.h | 48 ++++ shared-bindings/audiomp3/__init__.c | 60 ++++ shared-bindings/audiomp3/__init__.h | 34 +++ shared-module/audiomp3/MP3File.c | 270 ++++++++++++++++++ shared-module/audiomp3/MP3File.h | 70 +++++ shared-module/audiomp3/__init__.c | 0 shared-module/audiomp3/__init__.h | 30 ++ 28 files changed, 1007 insertions(+), 36 deletions(-) create mode 160000 lib/mp3 create mode 100644 shared-bindings/audiomp3/MP3File.c create mode 100644 shared-bindings/audiomp3/MP3File.h create mode 100644 shared-bindings/audiomp3/__init__.c create mode 100644 shared-bindings/audiomp3/__init__.h create mode 100644 shared-module/audiomp3/MP3File.c create mode 100644 shared-module/audiomp3/MP3File.h create mode 100644 shared-module/audiomp3/__init__.c create mode 100644 shared-module/audiomp3/__init__.h diff --git a/.gitmodules b/.gitmodules index 764456cd65..98252c2afa 100644 --- a/.gitmodules +++ b/.gitmodules @@ -102,3 +102,6 @@ [submodule "ports/cxd56/spresense-exported-sdk"] path = ports/cxd56/spresense-exported-sdk url = https://github.com/sonydevworld/spresense-exported-sdk.git +[submodule "lib/mp3"] + path = lib/mp3 + url = https://github.com/adafruit/Adafruit_MP3 diff --git a/lib/mp3 b/lib/mp3 new file mode 160000 index 0000000000..2a3cc7873b --- /dev/null +++ b/lib/mp3 @@ -0,0 +1 @@ +Subproject commit 2a3cc7873b5c642d4bb60043dc14d2555e3377a5 diff --git a/locale/ID.po b/locale/ID.po index 472c042c60..4be18ec0de 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-06 13:25-0600\n" +"POT-Creation-Date: 2019-12-10 13:55-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -496,11 +496,21 @@ msgstr "" msgid "Could not initialize UART" msgstr "Tidak dapat menginisialisasi UART" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -msgid "Couldn't allocate first buffer" +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate decoder" msgstr "" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate first buffer" +msgstr "" + +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate input buffer" +msgstr "" + +#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c msgid "Couldn't allocate second buffer" msgstr "" @@ -613,6 +623,10 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" +#: shared-module/audiomp3/MP3File.c +msgid "Failed to parse MP3 file" +msgstr "" + #: ports/nrf/sd_mutex.c #, fuzzy, c-format msgid "Failed to release mutex, err 0x%04x" @@ -1779,7 +1793,7 @@ msgstr "argumen keyword ekstra telah diberikan" msgid "extra positional arguments given" msgstr "argumen posisi ekstra telah diberikan" -#: shared-bindings/audiocore/WaveFile.c +#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3File.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 1541b1f74d..f007202071 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-06 13:25-0600\n" +"POT-Creation-Date: 2019-12-10 13:55-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -486,11 +486,21 @@ msgstr "" msgid "Could not initialize UART" msgstr "" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -msgid "Couldn't allocate first buffer" +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate decoder" msgstr "" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate first buffer" +msgstr "" + +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate input buffer" +msgstr "" + +#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c msgid "Couldn't allocate second buffer" msgstr "" @@ -602,6 +612,10 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" +#: shared-module/audiomp3/MP3File.c +msgid "Failed to parse MP3 file" +msgstr "" + #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to release mutex, err 0x%04x" @@ -1749,7 +1763,7 @@ msgstr "" msgid "extra positional arguments given" msgstr "" -#: shared-bindings/audiocore/WaveFile.c +#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3File.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index b34626ea1a..1756a7717e 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-06 13:25-0600\n" +"POT-Creation-Date: 2019-12-10 13:55-0600\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -490,11 +490,21 @@ msgstr "Beschädigter raw code" msgid "Could not initialize UART" msgstr "Konnte UART nicht initialisieren" +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate decoder" +msgstr "" + #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c msgid "Couldn't allocate first buffer" msgstr "Konnte first buffer nicht zuteilen" +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate input buffer" +msgstr "" + #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c msgid "Couldn't allocate second buffer" msgstr "Konnte second buffer nicht zuteilen" @@ -606,6 +616,10 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "Verbindung nicht erfolgreich: timeout" +#: shared-module/audiomp3/MP3File.c +msgid "Failed to parse MP3 file" +msgstr "" + #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to release mutex, err 0x%04x" @@ -1798,7 +1812,7 @@ msgstr "Es wurden zusätzliche Keyword-Argumente angegeben" msgid "extra positional arguments given" msgstr "Es wurden zusätzliche Argumente ohne Keyword angegeben" -#: shared-bindings/audiocore/WaveFile.c +#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3File.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" msgstr "Die Datei muss eine im Byte-Modus geöffnete Datei sein" diff --git a/locale/en_US.po b/locale/en_US.po index 95884c7b25..79940e95ed 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-06 13:25-0600\n" +"POT-Creation-Date: 2019-12-10 13:55-0600\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -486,11 +486,21 @@ msgstr "" msgid "Could not initialize UART" msgstr "" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -msgid "Couldn't allocate first buffer" +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate decoder" msgstr "" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate first buffer" +msgstr "" + +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate input buffer" +msgstr "" + +#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c msgid "Couldn't allocate second buffer" msgstr "" @@ -602,6 +612,10 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" +#: shared-module/audiomp3/MP3File.c +msgid "Failed to parse MP3 file" +msgstr "" + #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to release mutex, err 0x%04x" @@ -1749,7 +1763,7 @@ msgstr "" msgid "extra positional arguments given" msgstr "" -#: shared-bindings/audiocore/WaveFile.c +#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3File.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index ed7d2cec72..9fe49ec9f1 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-06 13:25-0600\n" +"POT-Creation-Date: 2019-12-10 13:55-0600\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -490,11 +490,21 @@ msgstr "" msgid "Could not initialize UART" msgstr "" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -msgid "Couldn't allocate first buffer" +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate decoder" msgstr "" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate first buffer" +msgstr "" + +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate input buffer" +msgstr "" + +#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c msgid "Couldn't allocate second buffer" msgstr "" @@ -606,6 +616,10 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" +#: shared-module/audiomp3/MP3File.c +msgid "Failed to parse MP3 file" +msgstr "" + #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to release mutex, err 0x%04x" @@ -1753,7 +1767,7 @@ msgstr "" msgid "extra positional arguments given" msgstr "" -#: shared-bindings/audiocore/WaveFile.c +#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3File.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" msgstr "" diff --git a/locale/es.po b/locale/es.po index fac38c0817..b5c375481c 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-06 13:25-0600\n" +"POT-Creation-Date: 2019-12-10 13:55-0600\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -494,11 +494,21 @@ msgstr "" msgid "Could not initialize UART" msgstr "No se puede inicializar la UART" +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate decoder" +msgstr "" + #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c msgid "Couldn't allocate first buffer" msgstr "No se pudo asignar el primer buffer" +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate input buffer" +msgstr "" + #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c msgid "Couldn't allocate second buffer" msgstr "No se pudo asignar el segundo buffer" @@ -610,6 +620,10 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" +#: shared-module/audiomp3/MP3File.c +msgid "Failed to parse MP3 file" +msgstr "" + #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to release mutex, err 0x%04x" @@ -1802,7 +1816,7 @@ msgstr "argumento(s) por palabra clave adicionales fueron dados" msgid "extra positional arguments given" msgstr "argumento posicional adicional dado" -#: shared-bindings/audiocore/WaveFile.c +#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3File.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" msgstr "el archivo deberia ser una archivo abierto en modo byte" diff --git a/locale/fil.po b/locale/fil.po index 776002768d..ba20e69b81 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-06 13:25-0600\n" +"POT-Creation-Date: 2019-12-10 13:55-0600\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -495,11 +495,21 @@ msgstr "" msgid "Could not initialize UART" msgstr "Hindi ma-initialize ang UART" +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate decoder" +msgstr "" + #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c msgid "Couldn't allocate first buffer" msgstr "Hindi ma-iallocate ang first buffer" +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate input buffer" +msgstr "" + #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c msgid "Couldn't allocate second buffer" msgstr "Hindi ma-iallocate ang second buffer" @@ -616,6 +626,10 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" +#: shared-module/audiomp3/MP3File.c +msgid "Failed to parse MP3 file" +msgstr "" + #: ports/nrf/sd_mutex.c #, fuzzy, c-format msgid "Failed to release mutex, err 0x%04x" @@ -1810,7 +1824,7 @@ msgstr "dagdag na keyword argument na ibinigay" msgid "extra positional arguments given" msgstr "dagdag na positional argument na ibinigay" -#: shared-bindings/audiocore/WaveFile.c +#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3File.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" msgstr "file ay dapat buksan sa byte mode" diff --git a/locale/fr.po b/locale/fr.po index 78d079bf12..e103cd06d2 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-06 13:25-0600\n" +"POT-Creation-Date: 2019-12-10 13:55-0600\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -501,11 +501,21 @@ msgstr "" msgid "Could not initialize UART" msgstr "L'UART n'a pu être initialisé" +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate decoder" +msgstr "" + #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c msgid "Couldn't allocate first buffer" msgstr "Impossible d'allouer le 1er tampon" +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate input buffer" +msgstr "" + #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c msgid "Couldn't allocate second buffer" msgstr "Impossible d'allouer le 2e tampon" @@ -620,6 +630,10 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" +#: shared-module/audiomp3/MP3File.c +msgid "Failed to parse MP3 file" +msgstr "" + #: ports/nrf/sd_mutex.c #, fuzzy, c-format msgid "Failed to release mutex, err 0x%04x" @@ -1842,7 +1856,7 @@ msgstr "argument(s) nommé(s) supplémentaire(s) donné(s)" msgid "extra positional arguments given" msgstr "argument(s) positionnel(s) supplémentaire(s) donné(s)" -#: shared-bindings/audiocore/WaveFile.c +#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3File.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" msgstr "le fichier doit être un fichier ouvert en mode 'byte'" diff --git a/locale/it_IT.po b/locale/it_IT.po index 67585fe2fb..c1a445fa24 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-06 13:25-0600\n" +"POT-Creation-Date: 2019-12-10 13:55-0600\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -496,11 +496,21 @@ msgstr "" msgid "Could not initialize UART" msgstr "Impossibile inizializzare l'UART" +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate decoder" +msgstr "" + #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c msgid "Couldn't allocate first buffer" msgstr "Impossibile allocare il primo buffer" +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate input buffer" +msgstr "" + #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c msgid "Couldn't allocate second buffer" msgstr "Impossibile allocare il secondo buffer" @@ -616,6 +626,10 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" +#: shared-module/audiomp3/MP3File.c +msgid "Failed to parse MP3 file" +msgstr "" + #: ports/nrf/sd_mutex.c #, fuzzy, c-format msgid "Failed to release mutex, err 0x%04x" @@ -1803,7 +1817,7 @@ msgstr "argomento nominato aggiuntivo fornito" msgid "extra positional arguments given" msgstr "argomenti posizonali extra dati" -#: shared-bindings/audiocore/WaveFile.c +#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3File.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" msgstr "" diff --git a/locale/ko.po b/locale/ko.po index 0cf6747370..93a476b876 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-06 13:25-0600\n" +"POT-Creation-Date: 2019-12-10 13:55-0600\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -490,11 +490,21 @@ msgstr "" msgid "Could not initialize UART" msgstr "" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -msgid "Couldn't allocate first buffer" +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate decoder" msgstr "" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate first buffer" +msgstr "" + +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate input buffer" +msgstr "" + +#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c msgid "Couldn't allocate second buffer" msgstr "" @@ -606,6 +616,10 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" +#: shared-module/audiomp3/MP3File.c +msgid "Failed to parse MP3 file" +msgstr "" + #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to release mutex, err 0x%04x" @@ -1754,7 +1768,7 @@ msgstr "" msgid "extra positional arguments given" msgstr "" -#: shared-bindings/audiocore/WaveFile.c +#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3File.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 0e33f3022c..8efab18675 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-06 13:25-0600\n" +"POT-Creation-Date: 2019-12-10 13:55-0600\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -489,11 +489,21 @@ msgstr "" msgid "Could not initialize UART" msgstr "Ustawienie UART nie powiodło się" +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate decoder" +msgstr "" + #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c msgid "Couldn't allocate first buffer" msgstr "Nie udała się alokacja pierwszego bufora" +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate input buffer" +msgstr "" + #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c msgid "Couldn't allocate second buffer" msgstr "Nie udała się alokacja drugiego bufora" @@ -605,6 +615,10 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" +#: shared-module/audiomp3/MP3File.c +msgid "Failed to parse MP3 file" +msgstr "" + #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to release mutex, err 0x%04x" @@ -1774,7 +1788,7 @@ msgstr "nadmiarowe argumenty nazwane" msgid "extra positional arguments given" msgstr "nadmiarowe argumenty pozycyjne" -#: shared-bindings/audiocore/WaveFile.c +#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3File.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" msgstr "file musi być otwarte w trybie bajtowym" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index f1f707f63d..1ca6b7d9a5 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-06 13:25-0600\n" +"POT-Creation-Date: 2019-12-10 13:55-0600\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -492,11 +492,21 @@ msgstr "" msgid "Could not initialize UART" msgstr "Não foi possível inicializar o UART" +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate decoder" +msgstr "" + #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c msgid "Couldn't allocate first buffer" msgstr "Não pôde alocar primeiro buffer" +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate input buffer" +msgstr "" + #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c msgid "Couldn't allocate second buffer" msgstr "Não pôde alocar segundo buffer" @@ -611,6 +621,10 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" +#: shared-module/audiomp3/MP3File.c +msgid "Failed to parse MP3 file" +msgstr "" + #: ports/nrf/sd_mutex.c #, fuzzy, c-format msgid "Failed to release mutex, err 0x%04x" @@ -1771,7 +1785,7 @@ msgstr "argumentos extras de palavras-chave passados" msgid "extra positional arguments given" msgstr "argumentos extra posicionais passados" -#: shared-bindings/audiocore/WaveFile.c +#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3File.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 6e49774b56..40966090d4 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-06 13:25-0600\n" +"POT-Creation-Date: 2019-12-10 13:55-0600\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -490,11 +490,21 @@ msgstr "Sǔnhuài de yuánshǐ dàimǎ" msgid "Could not initialize UART" msgstr "Wúfǎ chūshǐhuà UART" +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate decoder" +msgstr "" + #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c msgid "Couldn't allocate first buffer" msgstr "Wúfǎ fēnpèi dì yī gè huǎnchōng qū" +#: shared-module/audiomp3/MP3File.c +msgid "Couldn't allocate input buffer" +msgstr "" + #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c +#: shared-module/audiomp3/MP3File.c msgid "Couldn't allocate second buffer" msgstr "Wúfǎ fēnpèi dì èr gè huǎnchōng qū" @@ -606,6 +616,10 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "Liánjiē shībài: Chāoshí" +#: shared-module/audiomp3/MP3File.c +msgid "Failed to parse MP3 file" +msgstr "" + #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to release mutex, err 0x%04x" @@ -1785,7 +1799,7 @@ msgstr "éwài de guānjiàn cí cānshù" msgid "extra positional arguments given" msgstr "gěi chūle éwài de wèizhì cānshù" -#: shared-bindings/audiocore/WaveFile.c +#: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3File.c #: shared-bindings/displayio/OnDiskBitmap.c msgid "file must be a file opened in byte mode" msgstr "wénjiàn bìxū shì zài zì jié móshì xià dǎkāi de wénjiàn" diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index 453be3b5ee..b9b88a368b 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -16,3 +16,4 @@ CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_NETWORK = 0 CIRCUITPY_PS2IO = 0 +CIRCUITPY_AUDIOMP3 = 0 diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index df108664ad..58bf07247c 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -21,6 +21,10 @@ ifndef CIRCUITPY_AUDIOMIXER CIRCUITPY_AUDIOMIXER = 0 endif +ifndef CIRCUITPY_AUDIOMP3 +CIRCUITPY_AUDIOMP3 = 0 +endif + ifndef CIRCUITPY_FREQUENCYIO CIRCUITPY_FREQUENCYIO = 0 endif diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 211e853689..446620d27b 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -117,6 +117,9 @@ endif ifeq ($(CIRCUITPY_AUDIOMIXER),1) SRC_PATTERNS += audiomixer/% endif +ifeq ($(CIRCUITPY_AUDIOMP3),1) +SRC_PATTERNS += audiomp3/% +endif ifeq ($(CIRCUITPY_BITBANGIO),1) SRC_PATTERNS += bitbangio/% endif @@ -319,6 +322,8 @@ SRC_SHARED_MODULE_ALL = \ audiomixer/__init__.c \ audiomixer/Mixer.c \ audiomixer/MixerVoice.c \ + audiomp3/__init__.c \ + audiomp3/MP3File.c \ bitbangio/I2C.c \ bitbangio/OneWire.c \ bitbangio/SPI.c \ @@ -371,6 +376,26 @@ SRC_SHARED_MODULE_ALL += \ touchio/TouchIn.c \ touchio/__init__.c endif +ifeq ($(CIRCUITPY_AUDIOMP3),1) +SRC_MOD += $(addprefix lib/mp3/src/, \ + bitstream.c \ + buffers.c \ + dct32.c \ + dequant.c \ + dqchan.c \ + huffman.c \ + hufftabs.c \ + imdct.c \ + mp3dec.c \ + mp3tabs.c \ + polyphase.c \ + scalfact.c \ + stproc.c \ + subband.c \ + trigtabs.c \ +) +$(BUILD)/lib/mp3/src/buffers.o: CFLAGS += -include "py/misc.h" -D'MPDEC_ALLOCATOR(x)=m_malloc(x,0)' -D'MPDEC_FREE(x)=m_free(x)' +endif # All possible sources are listed here, and are filtered by SRC_PATTERNS. SRC_SHARED_MODULE_INTERNAL = \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 000674c4f4..5ee5d52c07 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -252,6 +252,13 @@ extern const struct _mp_obj_module_t audiomixer_module; #define AUDIOMIXER_MODULE #endif +#if CIRCUITPY_AUDIOMP3 +#define AUDIOMP3_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_audiomp3), (mp_obj_t)&audiomp3_module }, +extern const struct _mp_obj_module_t audiomp3_module; +#else +#define AUDIOMP3_MODULE +#endif + #if CIRCUITPY_AUDIOPWMIO #define AUDIOPWMIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_audiopwmio), (mp_obj_t)&audiopwmio_module }, extern const struct _mp_obj_module_t audiopwmio_module; @@ -582,6 +589,7 @@ extern const struct _mp_obj_module_t ustack_module; AUDIOCORE_MODULE \ AUDIOIO_MODULE \ AUDIOMIXER_MODULE \ + AUDIOMP3_MODULE \ AUDIOPWMIO_MODULE \ BITBANGIO_MODULE \ BLEIO_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 241fa10175..c614ea06a0 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -104,6 +104,15 @@ CIRCUITPY_AUDIOMIXER = $(CIRCUITPY_AUDIOIO) endif CFLAGS += -DCIRCUITPY_AUDIOMIXER=$(CIRCUITPY_AUDIOMIXER) +ifndef CIRCUITPY_AUDIOMP3 +ifeq ($(CIRCUITPY_FULL_BUILD),1) +CIRCUITPY_AUDIOMP3 = $(CIRCUITPY_AUDIOCORE) +else +CIRCUITPY_AUDIOMP3 = 0 +endif +endif +CFLAGS += -DCIRCUITPY_AUDIOMP3=$(CIRCUITPY_AUDIOMP3) + ifndef CIRCUITPY_BITBANGIO CIRCUITPY_BITBANGIO = $(CIRCUITPY_FULL_BUILD) endif diff --git a/shared-bindings/audiomp3/MP3File.c b/shared-bindings/audiomp3/MP3File.c new file mode 100644 index 0000000000..f518bae4bb --- /dev/null +++ b/shared-bindings/audiomp3/MP3File.c @@ -0,0 +1,226 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 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 + * 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 "lib/utils/context_manager_helpers.h" +#include "py/objproperty.h" +#include "py/runtime.h" +#include "shared-bindings/audiomp3/MP3File.h" +#include "shared-bindings/util.h" +#include "supervisor/shared/translate.h" + +//| .. currentmodule:: audiomp3 +//| +//| :class:`MP3` -- Load a mp3 file for audio playback +//| ======================================================== +//| +//| A .mp3 file prepped for audio playback. Only mono and stereo files are supported. Samples must +//| be 8 bit unsigned or 16 bit signed. If a buffer is provided, it will be used instead of allocating +//| an internal buffer. +//| +//| .. class:: MP3(file[, buffer]) +//| +//| Load a .mp3 file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. +//| +//| :param typing.BinaryIO file: Already opened mp3 file +//| :param bytearray buffer: Optional pre-allocated buffer, that will be split in half and used for double-buffering of the data. If not provided, two buffers are allocated internally. The specific buffer size required depends on the mp3 file. +//| +//| +//| Playing a mp3 file from flash:: +//| +//| import board +//| import audiomp3 +//| import audioio +//| import digitalio +//| +//| # Required for CircuitPlayground Express +//| speaker_enable = digitalio.DigitalInOut(board.SPEAKER_ENABLE) +//| speaker_enable.switch_to_output(value=True) +//| +//| data = open("cplay-16bit-16khz-64kbps.mp3", "rb") +//| mp3 = audiomp3.MP3File(data) +//| a = audioio.AudioOut(board.A0) +//| +//| print("playing") +//| a.play(mp3) +//| while a.playing: +//| pass +//| print("stopped") +//| +STATIC mp_obj_t audiomp3_mp3file_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) { + mp_arg_check_num(n_args, kw_args, 1, 2, false); + + audiomp3_mp3file_obj_t *self = m_new_obj(audiomp3_mp3file_obj_t); + self->base.type = &audiomp3_mp3file_type; + if (!MP_OBJ_IS_TYPE(args[0], &mp_type_fileio)) { + mp_raise_TypeError(translate("file must be a file opened in byte mode")); + } + uint8_t *buffer = NULL; + size_t buffer_size = 0; + if (n_args >= 2) { + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(args[1], &bufinfo, MP_BUFFER_WRITE); + buffer = bufinfo.buf; + buffer_size = bufinfo.len; + } + common_hal_audiomp3_mp3file_construct(self, MP_OBJ_TO_PTR(args[0]), + buffer, buffer_size); + + return MP_OBJ_FROM_PTR(self); +} + +//| .. method:: deinit() +//| +//| Deinitialises the MP3 and releases all memory resources for reuse. +//| +STATIC mp_obj_t audiomp3_mp3file_deinit(mp_obj_t self_in) { + audiomp3_mp3file_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_audiomp3_mp3file_deinit(self); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(audiomp3_mp3file_deinit_obj, audiomp3_mp3file_deinit); + +STATIC void check_for_deinit(audiomp3_mp3file_obj_t *self) { + if (common_hal_audiomp3_mp3file_deinited(self)) { + raise_deinited_error(); + } +} + +//| .. method:: __enter__() +//| +//| No-op used by Context Managers. +//| +// Provided by context manager helper. + +//| .. method:: __exit__() +//| +//| Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info. +//| +STATIC mp_obj_t audiomp3_mp3file_obj___exit__(size_t n_args, const mp_obj_t *args) { + (void)n_args; + common_hal_audiomp3_mp3file_deinit(args[0]); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(audiomp3_mp3file___exit___obj, 4, 4, audiomp3_mp3file_obj___exit__); + +//| .. attribute:: sample_rate +//| +//| 32 bit value that dictates how quickly samples are loaded into the DAC +//| in Hertz (cycles per second). When the sample is looped, this can change +//| the pitch output without changing the underlying sample. +//| +STATIC mp_obj_t audiomp3_mp3file_obj_get_sample_rate(mp_obj_t self_in) { + audiomp3_mp3file_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_audiomp3_mp3file_get_sample_rate(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(audiomp3_mp3file_get_sample_rate_obj, audiomp3_mp3file_obj_get_sample_rate); + +STATIC mp_obj_t audiomp3_mp3file_obj_set_sample_rate(mp_obj_t self_in, mp_obj_t sample_rate) { + audiomp3_mp3file_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_audiomp3_mp3file_set_sample_rate(self, mp_obj_get_int(sample_rate)); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(audiomp3_mp3file_set_sample_rate_obj, audiomp3_mp3file_obj_set_sample_rate); + +const mp_obj_property_t audiomp3_mp3file_sample_rate_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&audiomp3_mp3file_get_sample_rate_obj, + (mp_obj_t)&audiomp3_mp3file_set_sample_rate_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| .. attribute:: bits_per_sample +//| +//| Bits per sample. (read only) +//| +STATIC mp_obj_t audiomp3_mp3file_obj_get_bits_per_sample(mp_obj_t self_in) { + audiomp3_mp3file_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_audiomp3_mp3file_get_bits_per_sample(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(audiomp3_mp3file_get_bits_per_sample_obj, audiomp3_mp3file_obj_get_bits_per_sample); + +const mp_obj_property_t audiomp3_mp3file_bits_per_sample_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&audiomp3_mp3file_get_bits_per_sample_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| .. attribute:: channel_count +//| +//| Number of audio channels. (read only) +//| +STATIC mp_obj_t audiomp3_mp3file_obj_get_channel_count(mp_obj_t self_in) { + audiomp3_mp3file_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_audiomp3_mp3file_get_channel_count(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(audiomp3_mp3file_get_channel_count_obj, audiomp3_mp3file_obj_get_channel_count); + +const mp_obj_property_t audiomp3_mp3file_channel_count_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&audiomp3_mp3file_get_channel_count_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + + +STATIC const mp_rom_map_elem_t audiomp3_mp3file_locals_dict_table[] = { + // Methods + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&audiomp3_mp3file_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&audiomp3_mp3file___exit___obj) }, + + // Properties + { MP_ROM_QSTR(MP_QSTR_sample_rate), MP_ROM_PTR(&audiomp3_mp3file_sample_rate_obj) }, + { MP_ROM_QSTR(MP_QSTR_bits_per_sample), MP_ROM_PTR(&audiomp3_mp3file_bits_per_sample_obj) }, + { MP_ROM_QSTR(MP_QSTR_channel_count), MP_ROM_PTR(&audiomp3_mp3file_channel_count_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(audiomp3_mp3file_locals_dict, audiomp3_mp3file_locals_dict_table); + +STATIC const audiosample_p_t audiomp3_mp3file_proto = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_audiosample) + .sample_rate = (audiosample_sample_rate_fun)common_hal_audiomp3_mp3file_get_sample_rate, + .bits_per_sample = (audiosample_bits_per_sample_fun)common_hal_audiomp3_mp3file_get_bits_per_sample, + .channel_count = (audiosample_channel_count_fun)common_hal_audiomp3_mp3file_get_channel_count, + .reset_buffer = (audiosample_reset_buffer_fun)audiomp3_mp3file_reset_buffer, + .get_buffer = (audiosample_get_buffer_fun)audiomp3_mp3file_get_buffer, + .get_buffer_structure = (audiosample_get_buffer_structure_fun)audiomp3_mp3file_get_buffer_structure, +}; + +const mp_obj_type_t audiomp3_mp3file_type = { + { &mp_type_type }, + .name = MP_QSTR_MP3File, + .make_new = audiomp3_mp3file_make_new, + .locals_dict = (mp_obj_dict_t*)&audiomp3_mp3file_locals_dict, + .protocol = &audiomp3_mp3file_proto, +}; diff --git a/shared-bindings/audiomp3/MP3File.h b/shared-bindings/audiomp3/MP3File.h new file mode 100644 index 0000000000..adc13ea2c0 --- /dev/null +++ b/shared-bindings/audiomp3/MP3File.h @@ -0,0 +1,48 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 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 + * 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_AUDIOIO_MP3FILE_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_AUDIOIO_MP3FILE_H + +#include "py/obj.h" +#include "extmod/vfs_fat.h" + +#include "shared-module/audiomp3/MP3File.h" + +extern const mp_obj_type_t audiomp3_mp3file_type; + +void common_hal_audiomp3_mp3file_construct(audiomp3_mp3file_obj_t* self, + pyb_file_obj_t* file, uint8_t *buffer, size_t buffer_size); + +void common_hal_audiomp3_mp3file_deinit(audiomp3_mp3file_obj_t* self); +bool common_hal_audiomp3_mp3file_deinited(audiomp3_mp3file_obj_t* self); +uint32_t common_hal_audiomp3_mp3file_get_sample_rate(audiomp3_mp3file_obj_t* self); +void common_hal_audiomp3_mp3file_set_sample_rate(audiomp3_mp3file_obj_t* self, uint32_t sample_rate); +uint8_t common_hal_audiomp3_mp3file_get_bits_per_sample(audiomp3_mp3file_obj_t* self); +uint8_t common_hal_audiomp3_mp3file_get_channel_count(audiomp3_mp3file_obj_t* self); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_AUDIOIO_MP3FILE_H diff --git a/shared-bindings/audiomp3/__init__.c b/shared-bindings/audiomp3/__init__.c new file mode 100644 index 0000000000..06f852ff1c --- /dev/null +++ b/shared-bindings/audiomp3/__init__.c @@ -0,0 +1,60 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 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 + * 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/audiomp3/MP3File.h" + +//| :mod:`audiomp3` --- Support for MP3-compressed audio files +//| ========================================================== +//| +//| .. module:: audiomp3 +//| :synopsis: Support for mp3 files +//| +//| The `audiomp3` module contains an mp3 decoder +//| +//| Libraries +//| +//| .. toctree:: +//| :maxdepth: 3 +//| +//| MP3File +//| + +STATIC const mp_rom_map_elem_t audiomp3_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_audiomp3) }, + { MP_ROM_QSTR(MP_QSTR_MP3File), MP_ROM_PTR(&audiomp3_mp3file_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(audiomp3_module_globals, audiomp3_module_globals_table); + +const mp_obj_module_t audiomp3_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&audiomp3_module_globals, +}; diff --git a/shared-bindings/audiomp3/__init__.h b/shared-bindings/audiomp3/__init__.h new file mode 100644 index 0000000000..9026af6368 --- /dev/null +++ b/shared-bindings/audiomp3/__init__.h @@ -0,0 +1,34 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 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 + * 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_AUDIOMP3___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_AUDIOMP3___INIT___H + +#include "py/obj.h" + +// Nothing now. + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_AUDIOMP3___INIT___H diff --git a/shared-module/audiomp3/MP3File.c b/shared-module/audiomp3/MP3File.c new file mode 100644 index 0000000000..cabb461056 --- /dev/null +++ b/shared-module/audiomp3/MP3File.c @@ -0,0 +1,270 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 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 + * 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/audiomp3/MP3File.h" + +#include +#include + +#include "py/mperrno.h" +#include "py/runtime.h" + +#include "shared-module/audiomp3/MP3File.h" +#include "supervisor/shared/translate.h" +#include "lib/mp3/src/mp3common.h" + +/** Fill the input buffer if it is less than half full. + * + * Returns true if the input buffer contains any useful data, + * false otherwise. (The input buffer will be padded to the end with + * 0 bytes, which do not interfere with MP3 decoding) + * + * Raises OSError if f_read fails. + * + * Sets self->eof if any read of the file returns 0 bytes + */ +STATIC bool mp3file_update_inbuf(audiomp3_mp3file_obj_t* self) { + // If buffer is over half full, do nothing + if (self->inbuf_offset < self->inbuf_length/2) return true; + + // If we didn't previously reach the end of file, we can try reading now + if (!self->eof) { + + // Move the unconsumed portion of the buffer to the start + uint8_t *end_of_buffer = self->inbuf + self->inbuf_length; + uint8_t *new_end_of_data = self->inbuf + self->inbuf_length - self->inbuf_offset; + memmove(self->inbuf, self->inbuf + self->inbuf_offset, + self->inbuf_length - self->inbuf_offset); + self->inbuf_offset = 0; + + UINT to_read = end_of_buffer - new_end_of_data; + UINT bytes_read = 0; + memset(new_end_of_data, 0, to_read); + if (f_read(&self->file->fp, new_end_of_data, to_read, &bytes_read) != FR_OK) { + self->eof = true; + mp_raise_OSError(MP_EIO); + } + + if (bytes_read == 0) { + self->eof = true; + } + + if (to_read != bytes_read) { + new_end_of_data += bytes_read; + memset(new_end_of_data, 0, end_of_buffer - new_end_of_data); + } + + } + + // Return true iff there are at least some useful bytes in the buffer + return self->inbuf_offset < self->inbuf_length; +} + +#define READ_PTR(self) (self->inbuf + self->inbuf_offset) +#define BYTES_LEFT(self) (self->inbuf_length - self->inbuf_offset) +#define CONSUME(self, n) (self->inbuf_offset += n) + +/* If a sync word can be found, advance to it and return true. Otherwise, + * return false. + */ +STATIC bool mp3file_find_sync_word(audiomp3_mp3file_obj_t* self) { + do { + mp3file_update_inbuf(self); + int offset = MP3FindSyncWord(READ_PTR(self), BYTES_LEFT(self)); + if (offset >= 0) { + CONSUME(self, offset); + mp3file_update_inbuf(self); + return true; + } + CONSUME(self, MAX(0, BYTES_LEFT(self) - 16)); + } while (!self->eof); + return false; +} + +STATIC bool mp3file_get_next_frame_info(audiomp3_mp3file_obj_t* self, MP3FrameInfo* fi) { + int err = MP3GetNextFrameInfo(self->decoder, fi, READ_PTR(self)); + return err == ERR_MP3_NONE; +} + +void common_hal_audiomp3_mp3file_construct(audiomp3_mp3file_obj_t* self, + pyb_file_obj_t* file, + uint8_t *buffer, + size_t buffer_size) { + // XXX Adafruit_MP3 uses a 2kB input buffer and two 4kB output buffers. + // for a whopping total of 10kB buffers (+mp3 decoder state and frame buffer) + // At 44kHz, that's 23ms of output audio data. + // + // We will choose a slightly different allocation strategy for the output: + // Make sure the buffers are sized exactly to match (a multiple of) the + // frame size; this is typically 2304 * 2 bytes, so a little bit bigger + // than the two 4kB output buffers, except that the alignment allows to + // never allocate that extra frame buffer. + + self->file = file; + self->inbuf_length = 2048; + self->inbuf_offset = self->inbuf_length; + self->inbuf = m_malloc(self->inbuf_length, false); + if (self->inbuf == NULL) { + common_hal_audiomp3_mp3file_deinit(self); + mp_raise_msg(&mp_type_MemoryError, + translate("Couldn't allocate input buffer")); + } + self->decoder = MP3InitDecoder(); + if (self->decoder == NULL) { + common_hal_audiomp3_mp3file_deinit(self); + mp_raise_msg(&mp_type_MemoryError, + translate("Couldn't allocate decoder")); + } + + mp3file_find_sync_word(self); + MP3FrameInfo fi; + if(!mp3file_get_next_frame_info(self, &fi)) { + mp_raise_msg(&mp_type_RuntimeError, + translate("Failed to parse MP3 file")); + } + + self->sample_rate = fi.samprate; + self->channel_count = fi.nChans; + self->frame_buffer_size = fi.outputSamps*sizeof(int16_t); + + if (buffer_size >= 2 * self->frame_buffer_size) { + self->len = buffer_size / 2 / self->frame_buffer_size * self->frame_buffer_size; + self->buffers[0] = buffer; + self->buffers[1] = buffer + self->len; + } else { + self->len = 2 * self->frame_buffer_size; + self->buffers[0] = m_malloc(self->len, false); + if (self->buffers[0] == NULL) { + common_hal_audiomp3_mp3file_deinit(self); + mp_raise_msg(&mp_type_MemoryError, + translate("Couldn't allocate first buffer")); + } + + self->buffers[1] = m_malloc(self->len, false); + if (self->buffers[1] == NULL) { + common_hal_audiomp3_mp3file_deinit(self); + mp_raise_msg(&mp_type_MemoryError, + translate("Couldn't allocate second buffer")); + } + } +} + +void common_hal_audiomp3_mp3file_deinit(audiomp3_mp3file_obj_t* self) { + MP3FreeDecoder(self->decoder); + self->decoder = NULL; + self->inbuf = NULL; + self->buffers[0] = NULL; + self->buffers[1] = NULL; + self->file = NULL; +} + +bool common_hal_audiomp3_mp3file_deinited(audiomp3_mp3file_obj_t* self) { + return self->buffers[0] == NULL; +} + +uint32_t common_hal_audiomp3_mp3file_get_sample_rate(audiomp3_mp3file_obj_t* self) { + return self->sample_rate; +} + +void common_hal_audiomp3_mp3file_set_sample_rate(audiomp3_mp3file_obj_t* self, + uint32_t sample_rate) { + self->sample_rate = sample_rate; +} + +uint8_t common_hal_audiomp3_mp3file_get_bits_per_sample(audiomp3_mp3file_obj_t* self) { + return 16; +} + +uint8_t common_hal_audiomp3_mp3file_get_channel_count(audiomp3_mp3file_obj_t* self) { + return self->channel_count; +} + +bool audiomp3_mp3file_samples_signed(audiomp3_mp3file_obj_t* self) { + return true; +} + +void audiomp3_mp3file_reset_buffer(audiomp3_mp3file_obj_t* self, + bool single_channel, + uint8_t channel) { + if (single_channel && channel == 1) { + return; + } + // We don't reset the buffer index in case we're looping and we have an odd number of buffer + // loads + f_lseek(&self->file->fp, 0); + self->inbuf_offset = self->inbuf_length; + self->eof = 0; + mp3file_update_inbuf(self); + mp3file_find_sync_word(self); +} + +audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t* self, + bool single_channel, + uint8_t channel, + uint8_t** bufptr, + uint32_t* buffer_length) { + if (!single_channel) { + channel = 0; + } + + uint16_t channel_read_count = self->channel_read_count[channel]++; + bool need_more_data = self->read_count++ == channel_read_count; + + *bufptr = self->buffers[self->buffer_index] + channel; + *buffer_length = self->frame_buffer_size; + + if (need_more_data) { + self->buffer_index = !self->buffer_index; + int16_t *buffer = (int16_t *)(void *)self->buffers[self->buffer_index]; + + if (!mp3file_find_sync_word(self)) { + return self->eof ? GET_BUFFER_DONE : GET_BUFFER_ERROR; + } + int bytes_left = BYTES_LEFT(self); + uint8_t *inbuf = READ_PTR(self); + int err = MP3Decode(self->decoder, &inbuf, &bytes_left, buffer, 0); + CONSUME(self, BYTES_LEFT(self) - bytes_left); + if (err) { + return GET_BUFFER_DONE; + } + } + + return GET_BUFFER_MORE_DATA; +} + +void audiomp3_mp3file_get_buffer_structure(audiomp3_mp3file_obj_t* self, bool single_channel, + bool* single_buffer, bool* samples_signed, + uint32_t* max_buffer_length, uint8_t* spacing) { + *single_buffer = false; + *samples_signed = true; + *max_buffer_length = self->frame_buffer_size; + if (single_channel) { + *spacing = self->channel_count; + } else { + *spacing = 1; + } +} diff --git a/shared-module/audiomp3/MP3File.h b/shared-module/audiomp3/MP3File.h new file mode 100644 index 0000000000..12649ac1ad --- /dev/null +++ b/shared-module/audiomp3/MP3File.h @@ -0,0 +1,70 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Scott Shawcroft + * Copyright (c) 2019 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 + * 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_MODULE_AUDIOIO_MP3FILE_H +#define MICROPY_INCLUDED_SHARED_MODULE_AUDIOIO_MP3FILE_H + +#include "extmod/vfs_fat.h" +#include "py/obj.h" + +#include "shared-module/audiocore/__init__.h" + +typedef struct { + mp_obj_base_t base; + struct _MP3DecInfo *decoder; + uint8_t* inbuf; + uint32_t inbuf_length; + uint32_t inbuf_offset; + uint8_t* buffers[2]; + uint32_t len; + uint32_t frame_buffer_size; + + uint32_t sample_rate; + pyb_file_obj_t* file; + + uint8_t buffer_index; + uint8_t channel_count; + bool eof; + + uint16_t read_count; + uint16_t channel_read_count[2]; +} audiomp3_mp3file_obj_t; + +// These are not available from Python because it may be called in an interrupt. +void audiomp3_mp3file_reset_buffer(audiomp3_mp3file_obj_t* self, + bool single_channel, + uint8_t channel); +audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t* self, + bool single_channel, + uint8_t channel, + uint8_t** buffer, + uint32_t* buffer_length); // length in bytes +void audiomp3_mp3file_get_buffer_structure(audiomp3_mp3file_obj_t* self, bool single_channel, + bool* single_buffer, bool* samples_signed, + uint32_t* max_buffer_length, uint8_t* spacing); + +#endif // MICROPY_INCLUDED_SHARED_MODULE_AUDIOIO_MP3FILE_H diff --git a/shared-module/audiomp3/__init__.c b/shared-module/audiomp3/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/shared-module/audiomp3/__init__.h b/shared-module/audiomp3/__init__.h new file mode 100644 index 0000000000..e7b1f3aab5 --- /dev/null +++ b/shared-module/audiomp3/__init__.h @@ -0,0 +1,30 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 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 + * 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_MODULE_AUDIOMP3__INIT__H +#define MICROPY_INCLUDED_SHARED_MODULE_AUDIOMP3__INIT__H + +#endif // MICROPY_INCLUDED_SHARED_MODULE_AUDIOMP3__INIT__H From 0e2a03e3bd0f43a07700a673d54552cb53561e92 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Tue, 10 Dec 2019 15:07:39 -0500 Subject: [PATCH 165/189] revert usb.c additions --- .../boards/stm32f411ce_blackpill/mpconfigboard.h | 1 - ports/stm32f4/supervisor/usb.c | 14 +------------- supervisor/shared/usb/usb.c | 7 ------- supervisor/usb.h | 2 -- 4 files changed, 1 insertion(+), 23 deletions(-) diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h index b8e374f05b..a438b5baa6 100644 --- a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h +++ b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h @@ -33,7 +33,6 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV 25 -#define BOARD_NO_VBUS // On-board flash // #define SPI_FLASH_MOSI_PIN (&pin_PA07) diff --git a/ports/stm32f4/supervisor/usb.c b/ports/stm32f4/supervisor/usb.c index e3baf1412b..95db0aafc2 100644 --- a/ports/stm32f4/supervisor/usb.c +++ b/ports/stm32f4/supervisor/usb.c @@ -43,7 +43,6 @@ void init_usb_hardware(void) { PA11 ------> USB_OTG_FS_DM PA12 ------> USB_OTG_FS_DP */ - __HAL_RCC_GPIOA_CLK_ENABLE(); /* Configure DM DP Pins */ @@ -59,7 +58,7 @@ void init_usb_hardware(void) { /* Configure VBUS Pin */ GPIO_InitStruct.Pin = GPIO_PIN_9; GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); never_reset_pin_number(0, 9); @@ -84,14 +83,3 @@ void init_usb_hardware(void) { /* Peripheral clock enable */ __HAL_RCC_USB_OTG_FS_CLK_ENABLE(); } - -void disable_usb_vbus(void) { - -#ifdef USB_OTG_GCCFG_VBDEN - USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBDEN; -#else - USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_NOVBUSSENS; - USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBUSBSEN; - USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBUSASEN; -#endif -} diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index fca08b4eed..c1d70c5b0f 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -33,8 +33,6 @@ #include "lib/utils/interrupt_char.h" #include "lib/mp-readline/readline.h" -#include "py/mpconfig.h" - #include "tusb.h" // Serial number as hex characters. This writes directly to the USB @@ -74,11 +72,6 @@ void usb_init(void) { #if CIRCUITPY_USB_MIDI usb_midi_init(); #endif - -#ifdef BOARD_NO_VBUS - disable_usb_vbus(); -#endif - } void usb_background(void) { diff --git a/supervisor/usb.h b/supervisor/usb.h index 6b4082b6f8..c87540d408 100644 --- a/supervisor/usb.h +++ b/supervisor/usb.h @@ -37,8 +37,6 @@ void usb_background(void); // TinyUSB. void init_usb_hardware(void); -void disable_usb_vbus(void); - // Shared implementation. bool usb_enabled(void); void usb_init(void); From 33233934e9be4fee31b6b8412234279ebb7d9ef3 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Tue, 10 Dec 2019 15:13:11 -0500 Subject: [PATCH 166/189] text fix --- ports/stm32f4/supervisor/usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/stm32f4/supervisor/usb.c b/ports/stm32f4/supervisor/usb.c index 95db0aafc2..f327050f58 100644 --- a/ports/stm32f4/supervisor/usb.c +++ b/ports/stm32f4/supervisor/usb.c @@ -58,7 +58,7 @@ void init_usb_hardware(void) { /* Configure VBUS Pin */ GPIO_InitStruct.Pin = GPIO_PIN_9; GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); never_reset_pin_number(0, 9); From b22fbcd77da8c9724ed08228b89cfea53afdd5b6 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 10 Dec 2019 15:11:10 -0600 Subject: [PATCH 167/189] supervisor: external_flash: don't call m_malloc_maybe when it's bad --- supervisor/shared/external_flash/external_flash.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/supervisor/shared/external_flash/external_flash.c b/supervisor/shared/external_flash/external_flash.c index 99df553e19..e7d86240b4 100644 --- a/supervisor/shared/external_flash/external_flash.c +++ b/supervisor/shared/external_flash/external_flash.c @@ -324,6 +324,10 @@ static bool allocate_ram_cache(void) { return true; } + if (MP_STATE_MEM(gc_pool_start) == 0) { + return false; + } + MP_STATE_VM(flash_ram_cache) = m_malloc_maybe(blocks_per_sector * pages_per_block * sizeof(uint32_t), false); if (MP_STATE_VM(flash_ram_cache) == NULL) { return false; From f4a5c17b5e79cf9bd02be248620d445065891a25 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 10 Dec 2019 17:05:37 -0600 Subject: [PATCH 168/189] supervisor: external_flash: don't call m_free when it's bad It's extremely dubious that we have these handles that we think are to GC'd memory at a time when the gc pool may not be initialized. Hopefully, they WERE valid GC memory and are undisturbed by the teardown of the interpreter that can lead to this state. In this case, don't try to m_free them, the memory will become free when the GC heap is reinitialized. Closes: #2338 (together with previous commit) --- supervisor/shared/external_flash/external_flash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supervisor/shared/external_flash/external_flash.c b/supervisor/shared/external_flash/external_flash.c index e7d86240b4..9d38c07d89 100644 --- a/supervisor/shared/external_flash/external_flash.c +++ b/supervisor/shared/external_flash/external_flash.c @@ -371,7 +371,7 @@ static void release_ram_cache(void) { if (supervisor_cache != NULL) { free_memory(supervisor_cache); supervisor_cache = NULL; - } else { + } else if (MP_STATE_MEM(gc_pool_start)) { m_free(MP_STATE_VM(flash_ram_cache)); } MP_STATE_VM(flash_ram_cache) = NULL; @@ -419,7 +419,7 @@ static bool flush_ram_cache(bool keep_cache) { write_flash(current_sector + (i * pages_per_block + j) * SPI_FLASH_PAGE_SIZE, MP_STATE_VM(flash_ram_cache)[i * pages_per_block + j], SPI_FLASH_PAGE_SIZE); - if (!keep_cache && supervisor_cache == NULL) { + if (!keep_cache && supervisor_cache == NULL && MP_STATE_MEM(gc_pool_start)) { m_free(MP_STATE_VM(flash_ram_cache)[i * pages_per_block + j]); } } From 6305d489475f0eb91b0fba59fd93fc72191a28eb Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 10 Dec 2019 17:05:47 -0600 Subject: [PATCH 169/189] gc_free: give a better error when freeing outside of VM --- py/gc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/py/gc.c b/py/gc.c index a8a5fde125..5e631f5ed8 100755 --- a/py/gc.c +++ b/py/gc.c @@ -667,6 +667,9 @@ void gc_free(void *ptr) { if (ptr == NULL) { GC_EXIT(); } else { + if (MP_STATE_MEM(gc_pool_start) == 0) { + reset_into_safe_mode(GC_ALLOC_OUTSIDE_VM); + } // get the GC block number corresponding to this pointer assert(VERIFY_PTR(ptr)); size_t block = BLOCK_FROM_PTR(ptr); From 013c84086288141696e4c09250c61b6f2dbdf4d2 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 10 Dec 2019 17:57:17 -0500 Subject: [PATCH 170/189] working on all ports --- ports/atmel-samd/Makefile | 15 +--- ports/atmel-samd/boards/common.template.ld | 4 +- ports/atmel-samd/mpconfigport.h | 47 +++++++++--- ports/atmel-samd/peripherals | 2 +- ports/cxd56/boards/spresense/mpconfigboard.mk | 2 + ports/nrf/Makefile | 34 +++------ .../mpconfigboard.h | 3 - ports/nrf/boards/common.template.ld | 8 +- .../feather_nrf52840_express/mpconfigboard.h | 3 - .../mpconfigboard.h | 3 - .../metro_nrf52840_express/mpconfigboard.h | 3 - ports/nrf/boards/pca10059/mpconfigboard.mk | 2 +- ports/nrf/ld_defines.c | 39 ++++++++++ ports/nrf/mpconfigport.h | 76 +++++++++++++++---- ports/nrf/mpconfigport.mk | 2 +- ports/nrf/supervisor/internal_flash.c | 8 +- py/circuitpy_defns.mk | 12 +++ supervisor/supervisor.mk | 6 +- tools/build_memory_info.py | 20 +++-- 19 files changed, 189 insertions(+), 100 deletions(-) create mode 100644 ports/nrf/ld_defines.c diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 32517c8016..83fd879aad 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -157,7 +157,7 @@ endif -LDFLAGS = $(CFLAGS) -nostartfiles -fshort-enums -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs +LDFLAGS = $(CFLAGS) -nostartfiles -fshort-enums -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs LIBS := -lgcc -lc # Use toolchain libm if we're not using our own. @@ -324,19 +324,10 @@ SRC_QSTR_PREPROCESSOR += peripherals/samd/$(CHIP_FAMILY)/clocks.c all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2 -LD_FILE = $(BUILD)/$(notdir $(patsubst %.template.ld,%.ld,$(LD_TEMPLATE_FILE))) - -# ld_defines.pp is generated from ld_defines.c. See py/mkrules.mk. -# Run gen_ld_files.py over ALL *.template.ld files, not just LD_TEMPLATE_FILE, -# because it may include other template files. -$(LD_FILE): $(BUILD)/ld_defines.pp boards/*.template.ld - $(STEPECHO) "GEN $@" - $(Q)$(PYTHON3) $(TOP)/tools/gen_ld_files.py --defines $< --out_dir $(BUILD) boards/*.template.ld - -$(BUILD)/firmware.elf: $(OBJ) $(LD_FILE) +$(BUILD)/firmware.elf: $(OBJ) $(GENERATED_LD_FILE) $(STEPECHO) "LINK $@" $(Q)$(CC) -o $@ $(LDFLAGS) $(OBJ) -Wl,--start-group $(LIBS) -Wl,--end-group - $(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(LD_FILE) + $(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(GENERATED_LD_FILE) $(BUILD)/firmware.bin: $(BUILD)/firmware.elf $(STEPECHO) "Create $@" diff --git a/ports/atmel-samd/boards/common.template.ld b/ports/atmel-samd/boards/common.template.ld index 4c537e0016..1054605c8c 100644 --- a/ports/atmel-samd/boards/common.template.ld +++ b/ports/atmel-samd/boards/common.template.ld @@ -6,9 +6,9 @@ MEMORY FLASH_BOOTLOADER (rx): ORIGIN = ${BOOTLOADER_START_ADDR}, LENGTH = ${BOOTLOADER_SIZE} FLASH_FIRMWARE (rx) : ORIGIN = ${CIRCUITPY_FIRMWARE_START_ADDR}, LENGTH = ${CIRCUITPY_FIRMWARE_SIZE} - FLASH_NVM (r) : ORIGIN = ${CIRCUITPY_INTERNAL_NVM_START_ADDR}, LENGTH = ${CIRCUITPY_INTERNAL_NVM_SIZE} - FLASH_CONFIG (r) : ORIGIN = ${CIRCUITPY_INTERNAL_CONFIG_START_ADDR}, LENGTH = ${CIRCUITPY_INTERNAL_CONFIG_SIZE} FLASH_FILESYSTEM (r) : ORIGIN = ${CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR}, LENGTH = ${CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE} + FLASH_CONFIG (r) : ORIGIN = ${CIRCUITPY_INTERNAL_CONFIG_START_ADDR}, LENGTH = ${CIRCUITPY_INTERNAL_CONFIG_SIZE} + FLASH_NVM (r) : ORIGIN = ${CIRCUITPY_INTERNAL_NVM_START_ADDR}, LENGTH = ${CIRCUITPY_INTERNAL_NVM_SIZE} RAM (xrw) : ORIGIN = 0x20000000, LENGTH = ${RAM_SIZE} } diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index ecb9621945..6ab95c8a5a 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -81,12 +81,12 @@ #endif // If CIRCUITPY is internal, use half of flash for it. -#ifndef CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE - #if INTERNAL_FLASH_FILESYSTEM - #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (FLASH_SIZE/2) - #else - #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (0) +#if INTERNAL_FLASH_FILESYSTEM + #ifndef CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE + #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (FLASH_SIZE/2) #endif +#else + #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (0) #endif // HSRAM_SIZE is defined in the ASF4 include files for each SAMD51 chip. @@ -135,9 +135,9 @@ // // bootloader (8 or 16kB) // firmware +// internal CIRCUITPY flash filesystem (optional) // internal config, used to store crystalless clock calibration info (optional) // microntroller.nvm (optional) -// internal CIRCUITPY flash filesystem (optional) // Define these regions starting up from the bottom of flash: @@ -147,18 +147,43 @@ // Define these regions start down from the top of flash: -#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR \ - (FLASH_SIZE - CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE) - #define CIRCUITPY_INTERNAL_NVM_START_ADDR \ - (CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR - CIRCUITPY_INTERNAL_NVM_SIZE) + (FLASH_SIZE - CIRCUITPY_INTERNAL_NVM_SIZE) #define CIRCUITPY_INTERNAL_CONFIG_START_ADDR \ (CIRCUITPY_INTERNAL_NVM_START_ADDR - CIRCUITPY_INTERNAL_CONFIG_SIZE) +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR \ + (CIRCUITPY_INTERNAL_CONFIG_START_ADDR - CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE) + // The firmware space is the space left over between the fixed lower and upper regions. #define CIRCUITPY_FIRMWARE_SIZE \ - (CIRCUITPY_INTERNAL_CONFIG_START_ADDR - CIRCUITPY_FIRMWARE_START_ADDR) + (CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR - CIRCUITPY_FIRMWARE_START_ADDR) + +#if BOOTLOADER_START_ADDR % FLASH_PAGE_SIZE != 0 +#error BOOTLOADER_START_ADDR must be on a flash page boundary. +#endif + +#if CIRCUITPY_INTERNAL_NVM_START_ADDR % FLASH_PAGE_SIZE != 0 +#error CIRCUITPY_INTERNAL_NVM_START_ADDR must be on a flash page boundary. +#endif +#if CIRCUITPY_INTERNAL_NVM_SIZE % FLASH_PAGE_SIZE != 0 +#error CIRCUITPY_INTERNAL_NVM_SIZE must be a multiple of FLASH_PAGE_SIZE. +#endif + +#if CIRCUITPY_INTERNAL_CONFIG_START_ADDR % FLASH_PAGE_SIZE != 0 +#error CIRCUITPY_INTERNAL_CONFIG_SIZE must be on a flash page boundary. +#endif +#if CIRCUITPY_INTERNAL_CONFIG_SIZE % FLASH_PAGE_SIZE != 0 +#error CIRCUITPY_INTERNAL_CONFIG_SIZE must be a multiple of FLASH_PAGE_SIZE. +#endif + +#if CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR % FLASH_PAGE_SIZE != 0 +#error CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE must be on a flash page boundary. +#endif +#if CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE % FLASH_PAGE_SIZE != 0 +#error CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE must be a multiple of FLASH_PAGE_SIZE. +#endif #if CIRCUITPY_FIRMWARE_SIZE < 0 #error No space left in flash for firmware after specifying other regions! diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index bb26a4145c..4c0deecf88 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit bb26a4145c86a51debc6571bb1f791e0d4fd296b +Subproject commit 4c0deecf889da0074c1dbc9a5e2d24cb7c7a31c6 diff --git a/ports/cxd56/boards/spresense/mpconfigboard.mk b/ports/cxd56/boards/spresense/mpconfigboard.mk index a2d4e5d88c..7b8ac6ff63 100644 --- a/ports/cxd56/boards/spresense/mpconfigboard.mk +++ b/ports/cxd56/boards/spresense/mpconfigboard.mk @@ -2,3 +2,5 @@ USB_VID = 0x054c USB_PID = 0x0bc2 USB_PRODUCT = "Spresense" USB_MANUFACTURER = "Sony" + +INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index b96b8affb3..e7af13a735 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -63,8 +63,6 @@ ifneq ($(SD), ) include bluetooth/bluetooth_common.mk endif -FROZEN_MPY_DIR = freeze - CROSS_COMPILE = arm-none-eabi- FATFS_DIR = lib/oofatfs @@ -92,7 +90,7 @@ INC += -I../../supervisor/shared/usb ifeq ($(DEBUG), 1) CFLAGS += -ggdb3 -Og else - CFLAGS += -Os -DNDEBUG + CFLAGS += -Os -DNDEBUG -ggdb3 CFLAGS += -flto -flto-partition=none endif @@ -118,7 +116,7 @@ CFLAGS += \ # TODO: check this CFLAGS += -D__START=main -LDFLAGS = $(CFLAGS) -nostartfiles -fshort-enums -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs +LDFLAGS = $(CFLAGS) -nostartfiles -fshort-enums -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs LIBS := -lgcc -lc LDFLAGS += -mthumb -mcpu=cortex-m4 @@ -193,15 +191,16 @@ SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) $(addprefix shared-module/, $(SRC_SHARED_MODULE)) \ $(addprefix shared-module/, $(SRC_SHARED_MODULE_INTERNAL)) -SRC_S = supervisor/cpu.s +# There may be duplicates between SRC_COMMON_HAL_EXPANDED and SRC_SHARED_MODULE_EXPANDED, +# because a few modules have files both in common-hal/ and shared-modules/. +# Doing a $(sort ...) removes duplicates as part of sorting. +SRC_COMMON_HAL_SHARED_MODULE_EXPANDED = $(sort $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED)) -FROZEN_MPY_PY_FILES := $(shell find -L $(FROZEN_MPY_DIR) -type f -name '*.py') -FROZEN_MPY_MPY_FILES := $(addprefix $(BUILD)/,$(FROZEN_MPY_PY_FILES:.py=.mpy)) +SRC_S = supervisor/cpu.s OBJ += $(PY_O) $(SUPERVISOR_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_NRFX:.c=.o)) -OBJ += $(addprefix $(BUILD)/, $(SRC_COMMON_HAL_EXPANDED:.c=.o)) -OBJ += $(addprefix $(BUILD)/, $(SRC_SHARED_MODULE_EXPANDED:.c=.o)) +OBJ += $(addprefix $(BUILD)/, $(SRC_COMMON_HAL_SHARED_MODULE_EXPANDED:.c=.o)) ifeq ($(INTERNAL_LIBM),1) OBJ += $(addprefix $(BUILD)/, $(SRC_LIBM:.c=.o)) endif @@ -219,19 +218,10 @@ SRC_QSTR_PREPROCESSOR += all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2 -LD_FILE = $(BUILD)/$(notdir $(patsubst %.template.ld,%.ld,$(LD_TEMPLATE_FILE))) - -# ld_defines.pp is generated from ld_defines.c. See py/mkrules.mk. -# Run gen_ld_files.py over ALL *.template.ld files, not just LD_TEMPLATE_FILE, -# because it may include other template files. -$(LD_FILE): $(BUILD)/ld_defines.pp boards/*.template.ld - $(STEPECHO) "GEN $@" - $(Q)$(PYTHON3) $(TOP)/tools/gen_ld_files.py --defines $< --out_dir $(BUILD) boards/*.template.ld - -$(BUILD)/firmware.elf: $(OBJ) +$(BUILD)/firmware.elf: $(OBJ) $(GENERATED_LD_FILE) $(STEPECHO) "LINK $@" - $(Q)$(CC) -o $@ $(LDFLAGS) $^ -Wl,--start-group $(LIBS) -Wl,--end-group - $(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(LD_FILE) + $(Q)$(CC) -o $@ $(LDFLAGS) $(OBJ) -Wl,--start-group $(LIBS) -Wl,--end-group + $(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(GENERATED_LD_FILE) $(BUILD)/firmware.bin: $(BUILD)/firmware.elf $(STEPECHO) "Create $@" @@ -273,7 +263,7 @@ else ifeq ($(FLASHER), pyocd) flash: $(BUILD)/firmware.hex pyocd-flashtool -t $(MCU_VARIANT) $< --sector_erase - #pyocd-tool -t $(MCU_VARIANT) erase $(BOOT_SETTING_ADDR) +# pyocd-tool -t $(MCU_VARIANT) erase $(BOOT_SETTING_ADDR) pyocd-tool -t $(MCU_VARIANT) write32 $(BOOT_SETTING_ADDR) 0x00000001 pyocd-tool -t $(MCU_VARIANT) reset diff --git a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h index 7ca9b12aee..5abb868204 100644 --- a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h +++ b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h @@ -30,9 +30,6 @@ #define MICROPY_HW_BOARD_NAME "Adafruit Circuit Playground Bluefruit" #define MICROPY_HW_MCU_NAME "nRF52840" -#define FLASH_SIZE (0x100000) -#define FLASH_PAGE_SIZE (4096) - #define MICROPY_HW_LED_STATUS (&pin_P1_14) // Unusually, board does not have a 32 kHz xtal. Nearly all boards do. diff --git a/ports/nrf/boards/common.template.ld b/ports/nrf/boards/common.template.ld index 9fd066de10..f267234924 100644 --- a/ports/nrf/boards/common.template.ld +++ b/ports/nrf/boards/common.template.ld @@ -9,11 +9,11 @@ MEMORY /* nRF SoftDevice */ FLASH_MBR (rx) : ORIGIN = ${MBR_START_ADDR}, LENGTH = ${MBR_SIZE} FLASH_SD (rx) : ORIGIN = ${SD_FLASH_START_ADDR}, LENGTH = ${SD_FLASH_SIZE} - FLASH_ISR (rx) : ORIGIN = ${CIRCUITPY_ISR_START_ADDR}, LENGTH = ${CIRCUITPY_ISR_LENGTH} + FLASH_ISR (rx) : ORIGIN = ${ISR_START_ADDR}, LENGTH = ${ISR_SIZE} FLASH_FIRMWARE (rx) : ORIGIN = ${CIRCUITPY_FIRMWARE_START_ADDR}, LENGTH = ${CIRCUITPY_FIRMWARE_SIZE} + FLASH_FATFS (r) : ORIGIN = ${CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR}, LENGTH = ${CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE} FLASH_BLE_CONFIG (r) : ORIGIN = ${CIRCUITPY_BLE_CONFIG_START_ADDR}, LENGTH = ${CIRCUITPY_BLE_CONFIG_SIZE} FLASH_NVM (r) : ORIGIN = ${CIRCUITPY_INTERNAL_NVM_START_ADDR}, LENGTH = ${CIRCUITPY_INTERNAL_NVM_SIZE} - FLASH_FATFS (r) : ORIGIN = ${CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR}, LENGTH = ${CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE} FLASH_BOOTLOADER (rx) : ORIGIN = ${BOOTLOADER_START_ADDR}, LENGTH = ${BOOTLOADER_SIZE} FLASH_BOOTLOADER_SETTINGS (r) : ORIGIN = ${BOOTLOADER_SETTINGS_START_ADDR}, LENGTH = ${BOOTLOADER_SETTINGS_SIZE} RAM (xrw) : ORIGIN = 0x20004000, LENGTH = 0x03C000 /* 240 KiB */ @@ -32,10 +32,6 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); _heap_end = 0x20020000; /* tunable */ -/* Flash region for File System */ -__fatfs_flash_start_addr = ORIGIN(FLASH_FATFS); -__fatfs_flash_length = LENGTH(FLASH_FATFS); - /* define output sections */ SECTIONS { diff --git a/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h b/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h index b388515e43..64988e1a28 100644 --- a/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h +++ b/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h @@ -30,9 +30,6 @@ #define MICROPY_HW_BOARD_NAME "Adafruit Feather nRF52840 Express" #define MICROPY_HW_MCU_NAME "nRF52840" -#define FLASH_SIZE (0x100000) -#define FLASH_PAGE_SIZE (4096) - #define MICROPY_HW_NEOPIXEL (&pin_P0_16) #define MICROPY_HW_LED_STATUS (&pin_P1_15) diff --git a/ports/nrf/boards/itsybitsy_nrf52840_express/mpconfigboard.h b/ports/nrf/boards/itsybitsy_nrf52840_express/mpconfigboard.h index 2f17460ae7..629463e4e2 100644 --- a/ports/nrf/boards/itsybitsy_nrf52840_express/mpconfigboard.h +++ b/ports/nrf/boards/itsybitsy_nrf52840_express/mpconfigboard.h @@ -3,9 +3,6 @@ #define MICROPY_HW_BOARD_NAME "Adafruit ItsyBitsy nRF52840 Express" #define MICROPY_HW_MCU_NAME "nRF52840" -#define FLASH_SIZE (0x100000) -#define FLASH_PAGE_SIZE (4096) - #define MICROPY_HW_LED_STATUS (&pin_P0_06) #define MICROPY_HW_APA102_MOSI (&pin_P0_08) diff --git a/ports/nrf/boards/metro_nrf52840_express/mpconfigboard.h b/ports/nrf/boards/metro_nrf52840_express/mpconfigboard.h index 5188a379f6..8373551545 100644 --- a/ports/nrf/boards/metro_nrf52840_express/mpconfigboard.h +++ b/ports/nrf/boards/metro_nrf52840_express/mpconfigboard.h @@ -30,9 +30,6 @@ #define MICROPY_HW_BOARD_NAME "Adafruit Metro nRF52840 Express" #define MICROPY_HW_MCU_NAME "nRF52840" -#define FLASH_SIZE (0x100000) -#define FLASH_PAGE_SIZE (4096) - #define MICROPY_HW_NEOPIXEL (&pin_P0_13) #define MICROPY_HW_LED_STATUS (&pin_P1_13) diff --git a/ports/nrf/boards/pca10059/mpconfigboard.mk b/ports/nrf/boards/pca10059/mpconfigboard.mk index f9ff9c21c5..3f97b08218 100644 --- a/ports/nrf/boards/pca10059/mpconfigboard.mk +++ b/ports/nrf/boards/pca10059/mpconfigboard.mk @@ -5,4 +5,4 @@ USB_MANUFACTURER = "Nordic Semiconductor" MCU_CHIP = nrf52840 -INTERNAL_FLASH_FILEYSTEM = 1 +INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/ld_defines.c b/ports/nrf/ld_defines.c new file mode 100644 index 0000000000..0ec6dfdb5d --- /dev/null +++ b/ports/nrf/ld_defines.c @@ -0,0 +1,39 @@ +// Fake source file used only to capture #define values for use in ld template files. +#include "mpconfigport.h" + +// For each value needed in the LD file, create a C-like line: +// /*NAME_OF_VALUE=*/ NAME_OF_VALUE; +// The C preprocessor will replace NAME_OF_VALUE with the actual value. +// This will be post-processed by tools/gen_ld_files.py to extract the name and value. + +// The next line is a marker to start looking for definitions. Lines above the next line are ignored. +// START_LD_DEFINES + +/*MBR_START_ADDR=*/ MBR_START_ADDR; +/*MBR_SIZE=*/ MBR_SIZE; + +/*SD_FLASH_START_ADDR=*/ SD_FLASH_START_ADDR; +/*SD_FLASH_SIZE=*/ SD_FLASH_SIZE; + +/*ISR_START_ADDR=*/ ISR_START_ADDR; +/*ISR_SIZE=*/ ISR_SIZE; + +/*CIRCUITPY_DEFAULT_STACK_SIZE=*/ CIRCUITPY_DEFAULT_STACK_SIZE; + +/*CIRCUITPY_FIRMWARE_START_ADDR=*/ CIRCUITPY_FIRMWARE_START_ADDR; +/*CIRCUITPY_FIRMWARE_SIZE=*/ CIRCUITPY_FIRMWARE_SIZE; + +/*CIRCUITPY_BLE_CONFIG_START_ADDR=*/ CIRCUITPY_BLE_CONFIG_START_ADDR; +/*CIRCUITPY_BLE_CONFIG_SIZE=*/ CIRCUITPY_BLE_CONFIG_SIZE; + +/*CIRCUITPY_INTERNAL_NVM_START_ADDR=*/ CIRCUITPY_INTERNAL_NVM_START_ADDR; +/*CIRCUITPY_INTERNAL_NVM_SIZE=*/ CIRCUITPY_INTERNAL_NVM_SIZE; + +/*CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR=*/ CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR; +/*CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE=*/ CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE; + +/*BOOTLOADER_START_ADDR=*/ BOOTLOADER_START_ADDR; +/*BOOTLOADER_SIZE=*/ BOOTLOADER_SIZE; + +/*BOOTLOADER_SETTINGS_START_ADDR=*/ BOOTLOADER_SETTINGS_START_ADDR; +/*BOOTLOADER_SETTINGS_SIZE=*/ BOOTLOADER_SETTINGS_SIZE; diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index 00d4a51ad8..d10f12f6a7 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -30,8 +30,13 @@ #include "ble_drv.h" +#include "nrf_mbr.h" // for MBR_SIZE +#include "nrf_sdm.h" // for SD_FLASH_SIZE +#include "peripherals/nrf/nvm.h" // for FLASH_PAGE_SIZE + #ifdef NRF52840 #define MICROPY_PY_SYS_PLATFORM "nRF52840" +#define FLASH_SIZE (0x100000) // 1MiB #endif #define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) @@ -45,11 +50,12 @@ // 24kiB stack #define CIRCUITPY_DEFAULT_STACK_SIZE 0x6000 -#if INTERNAL_FLASH_FILESYSTEM -#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (64*1024) -#else -#define CIRCUITPYINTERNAL_FLASH_FILESYSTEM_SIZE (0) -#endif +//////////////////////////////////////////////////////////////////////////////////////////////////// + +// This also includes mpconfigboard.h. +#include "py/circuitpy_mpconfig.h" + +// Definitions that might be overriden by mpconfigboard.h #ifndef CIRCUITPY_INTERNAL_NVM_SIZE #define CIRCUITPY_INTERNAL_NVM_SIZE (8192) @@ -60,14 +66,22 @@ #define BOARD_HAS_32KHZ_XTAL (1) #endif +#if INTERNAL_FLASH_FILESYSTEM + #ifndef CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE + #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (256*1024) + #endif +#else + #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (0) +#endif + // Flash layout, starting at 0x00000000 // // SoftDevice // ISR // firmware +// internal CIRCUITPY flash filesystem (optional) // BLE config (bonding info, etc.) (optional) // microntroller.nvm (optional) -// internal CIRCUITPY flash filesystem (optional) // bootloader (note the MBR at 0x0 redirects to the bootloader here, in high flash) // bootloader settings @@ -76,14 +90,14 @@ // Define these regions starting up from the bottom of flash: #define MBR_START_ADDR (0x0) -// MBR_SIZE is from nrf_sdm.h +// MBR_SIZE is from nrf_mbr.h #define SD_FLASH_START_ADDR (MBR_START_ADDR + MBR_SIZE) // SD_FLASH_SIZE is from nrf_sdm.h -#define ISR_FLASH_START_ADDR (SD_FLASH_START_ADDR + SD_FLASH_SIZE) -#define ISR_FLASH_SIZE (0x1000) // 4kiB +#define ISR_START_ADDR (SD_FLASH_START_ADDR + SD_FLASH_SIZE) +#define ISR_SIZE (0x1000) // 4kiB -#define CIRCUITPY_FIRMWARE_START_ADDR (ISR_FLASH_START_ADDR + ISR_FLASH_LENGTH) +#define CIRCUITPY_FIRMWARE_START_ADDR (ISR_START_ADDR + ISR_SIZE) // Define these regions starting down from the bootloader: @@ -92,22 +106,52 @@ #define BOOTLOADER_SETTINGS_START_ADDR (0x000FF000) #define BOOTLOADER_SETTINGS_SIZE (0x1000) // 4kiB -#define FLASH_FATFS_SIZE (256*1024) -#define FLASH_FATFS_START_ADDR (BOOTLOADER_START_ADDR - FLASH_FATFS_SIZE) - -#define CIRCUITPY_INTERNAL_NVM_START_ADDR (FLASH_FATFS_START_ADDR - CIRCUITPY_INTERNAL_NVM_SIZE) +#define CIRCUITPY_INTERNAL_NVM_START_ADDR (BOOTLOADER_START_ADDR - CIRCUITPY_INTERNAL_NVM_SIZE) +// 32kiB for bonding, etc. #define CIRCUITPY_BLE_CONFIG_SIZE (32*1024) #define CIRCUITPY_BLE_CONFIG_START_ADDR (CIRCUITPY_INTERNAL_NVM_START_ADDR - CIRCUITPY_BLE_CONFIG_SIZE) +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR (CIRCUITPY_BLE_CONFIG_START_ADDR - CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE) + // The firmware space is the space left over between the fixed lower and upper regions. -#define CIRCUITPY_FIRMWARE_SIZE (CIRCUITPY_BLE_CONFIG_START_ADDR - CIRCUITPY_FIRMWARE_START_ADDR) +#define CIRCUITPY_FIRMWARE_SIZE (CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR - CIRCUITPY_FIRMWARE_START_ADDR) + +#if BOOTLOADER_START_ADDR % FLASH_PAGE_SIZE != 0 +#error BOOTLOADER_START_ADDR must be on a flash page boundary. +#endif + +#if CIRCUITPY_INTERNAL_NVM_START_ADDR % FLASH_PAGE_SIZE != 0 +#error CIRCUITPY_INTERNAL_NVM_START_ADDR must be on a flash page boundary. +#endif +#if CIRCUITPY_INTERNAL_NVM_SIZE % FLASH_PAGE_SIZE != 0 +#error CIRCUITPY_INTERNAL_NVM_SIZE must be a multiple of FLASH_PAGE_SIZE. +#endif + +#if CIRCUITPY_BLE_CONFIG_START_ADDR % FLASH_PAGE_SIZE != 0 +#error CIRCUITPY_BLE_CONFIG_SIZE must be on a flash page boundary. +#endif +#if CIRCUITPY_BLE_CONFIG_SIZE % FLASH_PAGE_SIZE != 0 +#error CIRCUITPY_BLE_CONFIG_SIZE must be a multiple of FLASH_PAGE_SIZE. +#endif + +#if CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR % FLASH_PAGE_SIZE != 0 +#error CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE must be on a flash page boundary. +#endif +#if CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE % FLASH_PAGE_SIZE != 0 +#error CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE must be a multiple of FLASH_PAGE_SIZE. +#endif #if CIRCUITPY_FIRMWARE_SIZE < 0 #error No space left in flash for firmware after specifying other regions! #endif -#include "py/circuitpy_mpconfig.h" +#if CIRCUITPY_FIRMWARE_SIZE < 0 +#error No space left in flash for firmware after specifying other regions! +#endif + + + #define MICROPY_PORT_ROOT_POINTERS \ CIRCUITPY_COMMON_ROOT_POINTERS \ diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index 47cabffb5e..9b738d4b3a 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -53,7 +53,7 @@ CIRCUITPY_FREQUENCYIO = 0 # nRF52840-specific -ifeq($(MCU_CHIP),nrf52840) +ifeq ($(MCU_CHIP),nrf52840) MCU_SERIES = m4 MCU_VARIANT = nrf52 MCU_SUB_VARIANT = nrf52840 diff --git a/ports/nrf/supervisor/internal_flash.c b/ports/nrf/supervisor/internal_flash.c index c43454eb39..07aa5079f4 100644 --- a/ports/nrf/supervisor/internal_flash.c +++ b/ports/nrf/supervisor/internal_flash.c @@ -42,10 +42,6 @@ #include "nrf_sdm.h" #endif -// defined in linker -extern uint32_t __fatfs_flash_start_addr[]; -extern uint32_t __fatfs_flash_length[]; - #define NO_CACHE 0xffffffff uint8_t _flash_cache[FLASH_PAGE_SIZE] __attribute__((aligned(4))); @@ -56,7 +52,7 @@ uint32_t _flash_page_addr = NO_CACHE; /* Internal Flash API *------------------------------------------------------------------*/ static inline uint32_t lba2addr(uint32_t block) { - return ((uint32_t)__fatfs_flash_start_addr) + block * FILESYSTEM_BLOCK_SIZE; + return CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR + block * FILESYSTEM_BLOCK_SIZE; } void supervisor_flash_init(void) { @@ -67,7 +63,7 @@ uint32_t supervisor_flash_get_block_size(void) { } uint32_t supervisor_flash_get_block_count(void) { - return ((uint32_t) __fatfs_flash_length) / FILESYSTEM_BLOCK_SIZE ; + return CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE ; } void supervisor_flash_flush(void) { diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 34c097e36b..265b552bb1 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -402,6 +402,18 @@ $(addprefix lib/,\ ) endif +ifdef LD_TEMPLATE_FILE +# Generate a linker script (.ld file) from a template, for those builds that use it. +GENERATED_LD_FILE = $(BUILD)/$(notdir $(patsubst %.template.ld,%.ld,$(LD_TEMPLATE_FILE))) +# +# ld_defines.pp is generated from ld_defines.c. See py/mkrules.mk. +# Run gen_ld_files.py over ALL *.template.ld files, not just LD_TEMPLATE_FILE, +# because it may include other template files. +$(GENERATED_LD_FILE): $(BUILD)/ld_defines.pp boards/*.template.ld + $(STEPECHO) "GEN $@" + $(Q)$(PYTHON3) $(TOP)/tools/gen_ld_files.py --defines $< --out_dir $(BUILD) boards/*.template.ld +endif + .PHONY: check-release-needs-clean-build check-release-needs-clean-build: diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 87d506b3b8..96a14c25b4 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -25,14 +25,12 @@ CFLAGS += -DINTERNAL_FLASH_FILESYSTEM=$(INTERNAL_FLASH_FILESYSTEM) ifndef QSPI_FLASH_FILESYSTEM QSPI_FLASH_FILESYSTEM = 0 endif -# EXPRESS_BOARD is obsolete and should be removed when samd-peripherals is updated. -CFLAGS += -DQSPI_FLASH_FILESYSTEM=$(QSPI_FLASH_FILESYSTEM) -DEXPRESS_BOARD +CFLAGS += -DQSPI_FLASH_FILESYSTEM=$(QSPI_FLASH_FILESYSTEM) ifndef SPI_FLASH_FILESYSTEM SPI_FLASH_FILESYSTEM = 0 endif -# EXPRESS_BOARD is obsolete and should be removed when samd-peripherals is updated. -CFLAGS += -DSPI_FLASH_FILESYSTEM=$(SPI_FLASH_FILESYSTEM) -DEXPRESS_BOARD +CFLAGS += -DSPI_FLASH_FILESYSTEM=$(SPI_FLASH_FILESYSTEM) ifeq ($(CIRCUITPY_BLEIO),1) SRC_SUPERVISOR += supervisor/shared/bluetooth.c diff --git a/tools/build_memory_info.py b/tools/build_memory_info.py index f128561ab2..afe49650e2 100644 --- a/tools/build_memory_info.py +++ b/tools/build_memory_info.py @@ -41,7 +41,8 @@ data = 0 bss = 0 # stdin is the linker output. for line in sys.stdin: - print(line) + # Uncomment to see linker output. + # print(line) line = line.strip() if not line.startswith("text"): text, data, bss = map(int, line.split()[:3]) @@ -51,7 +52,7 @@ regions = {} with open(sys.argv[1], "r") as f: for line in f: line = line.strip() - if line.startswith(("FLASH_FIRMWARE", "RAM")): + if line.startswith(("FLASH_FIRMWARE", "FLASH", "RAM")): regions[line.split()[0]] = line.split("=")[-1] for region in regions: @@ -62,10 +63,17 @@ for region in regions: space = M_PATTERN.sub(M_REPLACE, space) regions[region] = eval(space) -free_flash = regions["FLASH_FIRMWARE"] - text - data -free_ram = regions["RAM"] - data - bss -print("{} bytes free in flash firmware space out of {} bytes ({}kB).".format(free_flash, regions["FLASH_FIRMWARE"], regions["FLASH_FIRMWARE"] / 1024)) -print("{} bytes free in ram for heap out of {} bytes ({}kB).".format(free_ram, regions["RAM"], regions["RAM"] / 1024)) +# TODO Remove check for both FLASH_FIRMWARE and FLASH after all ports are converted to use FLASH_FIRMWARE. +try: + firmware_region = regions["FLASH_FIRMWARE"] +except KeyError: + firmware_region = regions["FLASH"] +ram_region = regions["RAM"] + +free_flash = firmware_region - text - data +free_ram = ram_region - data - bss +print("{} bytes free in flash firmware space out of {} bytes ({}kB).".format(free_flash, firmware_region, firmware_region / 1024)) +print("{} bytes free in ram for heap out of {} bytes ({}kB).".format(free_ram, ram_region, ram_region / 1024)) print() # Check that we have free flash space. GCC doesn't fail when the text + data From c6221c5956018941804457274e4fbed03de7e403 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 10 Dec 2019 21:08:51 -0500 Subject: [PATCH 171/189] Remove no-longer-used nrf and atmel-samd .ld files --- .../samd21x18-bootloader-crystalless.ld | 13 -- ...8-bootloader-external-flash-crystalless.ld | 13 -- .../samd21x18-bootloader-external-flash.ld | 13 -- .../atmel-samd/boards/samd21x18-bootloader.ld | 14 --- .../boards/samd21x18-external-flash.ld | 13 -- ports/atmel-samd/boards/samd21x18.ld | 13 -- .../samd51x18-bootloader-external-flash.ld | 13 -- .../samd51x19-bootloader-external-flash.ld | 13 -- .../atmel-samd/boards/samd51x19-bootloader.ld | 13 -- .../samd51x20-bootloader-external-flash.ld | 13 -- .../atmel-samd/boards/samd51x20-bootloader.ld | 12 -- .../boards/samd51x20-external-flash.ld | 12 -- ports/atmel-samd/boards/samd51x20.ld | 13 -- ports/nrf/boards/adafruit_nrf52840_s140_v6.ld | 52 -------- ports/nrf/boards/common.ld | 115 ------------------ ports/nrf/boards/nrf52840_1M_256k.ld | 28 ----- .../nrf/boards/nrf52840_1M_256k_s140_6.0.0.ld | 28 ----- 17 files changed, 391 deletions(-) delete mode 100644 ports/atmel-samd/boards/samd21x18-bootloader-crystalless.ld delete mode 100644 ports/atmel-samd/boards/samd21x18-bootloader-external-flash-crystalless.ld delete mode 100644 ports/atmel-samd/boards/samd21x18-bootloader-external-flash.ld delete mode 100644 ports/atmel-samd/boards/samd21x18-bootloader.ld delete mode 100644 ports/atmel-samd/boards/samd21x18-external-flash.ld delete mode 100644 ports/atmel-samd/boards/samd21x18.ld delete mode 100644 ports/atmel-samd/boards/samd51x18-bootloader-external-flash.ld delete mode 100644 ports/atmel-samd/boards/samd51x19-bootloader-external-flash.ld delete mode 100644 ports/atmel-samd/boards/samd51x19-bootloader.ld delete mode 100644 ports/atmel-samd/boards/samd51x20-bootloader-external-flash.ld delete mode 100644 ports/atmel-samd/boards/samd51x20-bootloader.ld delete mode 100644 ports/atmel-samd/boards/samd51x20-external-flash.ld delete mode 100644 ports/atmel-samd/boards/samd51x20.ld delete mode 100644 ports/nrf/boards/adafruit_nrf52840_s140_v6.ld delete mode 100644 ports/nrf/boards/common.ld delete mode 100644 ports/nrf/boards/nrf52840_1M_256k.ld delete mode 100644 ports/nrf/boards/nrf52840_1M_256k_s140_6.0.0.ld diff --git a/ports/atmel-samd/boards/samd21x18-bootloader-crystalless.ld b/ports/atmel-samd/boards/samd21x18-bootloader-crystalless.ld deleted file mode 100644 index 1ee745eb17..0000000000 --- a/ports/atmel-samd/boards/samd21x18-bootloader-crystalless.ld +++ /dev/null @@ -1,13 +0,0 @@ -/* - GNU linker script for SAMD21x18 (256K flash, 32K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - /* Leave 8KiB for the bootloader, 256b for persistent config (clock), 64k for the flash file system and 256b for the user config. */ - FLASH (rx) : ORIGIN = 0x00000000 + 8K, LENGTH = 256K - 8K - 256 - 64K - 256 - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K -} - -INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd21x18-bootloader-external-flash-crystalless.ld b/ports/atmel-samd/boards/samd21x18-bootloader-external-flash-crystalless.ld deleted file mode 100644 index d8f4cc2365..0000000000 --- a/ports/atmel-samd/boards/samd21x18-bootloader-external-flash-crystalless.ld +++ /dev/null @@ -1,13 +0,0 @@ -/* - GNU linker script for SAMD21x18 (256K flash, 32K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - /* Leave 8KiB for the bootloader, 256b for internal config and 256b for user config. */ - FLASH (rx) : ORIGIN = 0x00000000 + 8K, LENGTH = 256K - 8K - 256 - 256 - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K -} - -INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd21x18-bootloader-external-flash.ld b/ports/atmel-samd/boards/samd21x18-bootloader-external-flash.ld deleted file mode 100644 index f663326d69..0000000000 --- a/ports/atmel-samd/boards/samd21x18-bootloader-external-flash.ld +++ /dev/null @@ -1,13 +0,0 @@ -/* - GNU linker script for SAMD21x18 (256K flash, 32K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - /* Leave 8KiB for the bootloader and 256b for user config. */ - FLASH (rx) : ORIGIN = 0x00000000 + 8K, LENGTH = 256K - 8K - 256 - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K /* 32 KiB RAM */ -} - -INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd21x18-bootloader.ld b/ports/atmel-samd/boards/samd21x18-bootloader.ld deleted file mode 100644 index 666ac79c47..0000000000 --- a/ports/atmel-samd/boards/samd21x18-bootloader.ld +++ /dev/null @@ -1,14 +0,0 @@ -/* - GNU linker script for SAMD21x18 (256K flash, 32K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - /* Leave 8KiB for the bootloader, 64k for the flash file system, and 256b - for user config. */ - FLASH (rx) : ORIGIN = 0x00000000 + 8K, LENGTH = 256K - 8K - 64K - 256 - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K -} - -INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd21x18-external-flash.ld b/ports/atmel-samd/boards/samd21x18-external-flash.ld deleted file mode 100644 index 6afdab7345..0000000000 --- a/ports/atmel-samd/boards/samd21x18-external-flash.ld +++ /dev/null @@ -1,13 +0,0 @@ -/* - GNU linker script for SAMD21x18 (256K flash, 32K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - /* 256 KiB but leave 256b for internal config and 256b for user config (protected eeprom) */ - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 256K - 256 - 256 - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K -} - -INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd21x18.ld b/ports/atmel-samd/boards/samd21x18.ld deleted file mode 100644 index c035f5117e..0000000000 --- a/ports/atmel-samd/boards/samd21x18.ld +++ /dev/null @@ -1,13 +0,0 @@ -/* - GNU linker script for SAMD21x18 (256K flash, 32K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - /* Leave 256b for internal config, 64k for the flash file system and 256b for user config. */ - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 256K - 256 - 64K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K -} - -INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd51x18-bootloader-external-flash.ld b/ports/atmel-samd/boards/samd51x18-bootloader-external-flash.ld deleted file mode 100644 index b22bef3f3a..0000000000 --- a/ports/atmel-samd/boards/samd51x18-bootloader-external-flash.ld +++ /dev/null @@ -1,13 +0,0 @@ -/* - GNU linker script for SAMD51x18 (256K flash, 128K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - /* Leave 16KiB for the bootloader. 8K for user data*/ - FLASH (rx) : ORIGIN = 0x00000000 + 16K, LENGTH = 256K - 16K - 8K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K -} - -INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x19-bootloader-external-flash.ld b/ports/atmel-samd/boards/samd51x19-bootloader-external-flash.ld deleted file mode 100644 index f1493f2510..0000000000 --- a/ports/atmel-samd/boards/samd51x19-bootloader-external-flash.ld +++ /dev/null @@ -1,13 +0,0 @@ -/* - GNU linker script for SAMD51x19 (512K flash, 192K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - /* Leave 16KiB for the bootloader. 8K for user data*/ - FLASH (rx) : ORIGIN = 0x00000000 + 16K, LENGTH = 512K - 16K - 8K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 192K -} - -INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x19-bootloader.ld b/ports/atmel-samd/boards/samd51x19-bootloader.ld deleted file mode 100644 index c73db2ece9..0000000000 --- a/ports/atmel-samd/boards/samd51x19-bootloader.ld +++ /dev/null @@ -1,13 +0,0 @@ -/* - GNU linker script for SAMD51x19 (512K flash, 192K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - /* Leave 16KiB for the bootloader, 256KiB for the internal file system, and 8KiB for user binary data. */ - FLASH (rx) : ORIGIN = 0x00000000 + 16K, LENGTH = 512K - 16K - 256K - 8K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 192K -} - -INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x20-bootloader-external-flash.ld b/ports/atmel-samd/boards/samd51x20-bootloader-external-flash.ld deleted file mode 100644 index ee28fdf1cc..0000000000 --- a/ports/atmel-samd/boards/samd51x20-bootloader-external-flash.ld +++ /dev/null @@ -1,13 +0,0 @@ -/* - GNU linker script for SAMD51x20 (1MB flash, 256K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - /* Leave 16KiB for the bootloader. */ - FLASH (rx) : ORIGIN = 0x00000000 + 16K, LENGTH = 1M - 16K - 8K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K -} - -INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x20-bootloader.ld b/ports/atmel-samd/boards/samd51x20-bootloader.ld deleted file mode 100644 index ea0e0569f5..0000000000 --- a/ports/atmel-samd/boards/samd51x20-bootloader.ld +++ /dev/null @@ -1,12 +0,0 @@ -/* - GNU linker script for SAMD51x20 (1MB flash, 256K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - /* Leave 16KiB for the bootloader, 512k for the filesystem and 8k for user config data. */ - FLASH (rx) : ORIGIN = 0x00000000 + 16K, LENGTH = 1M - 16K - 512K - 8K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K -} -INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x20-external-flash.ld b/ports/atmel-samd/boards/samd51x20-external-flash.ld deleted file mode 100644 index 5212363fe1..0000000000 --- a/ports/atmel-samd/boards/samd51x20-external-flash.ld +++ /dev/null @@ -1,12 +0,0 @@ -/* - GNU linker script for SAMD51x20 (1MB flash, 256K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 1M - 8K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K -} - -INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x20.ld b/ports/atmel-samd/boards/samd51x20.ld deleted file mode 100644 index 1f0b661720..0000000000 --- a/ports/atmel-samd/boards/samd51x20.ld +++ /dev/null @@ -1,13 +0,0 @@ -/* - GNU linker script for SAMD51x20 (1MB flash, 256K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - /* 1024 KiB minus 512KiB for the internal file system and 8KiB for the user nvm. */ - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 1M - 512K - 8K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K -} - -INCLUDE "samd51-common.ld" diff --git a/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld b/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld deleted file mode 100644 index 2d158c4964..0000000000 --- a/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld +++ /dev/null @@ -1,52 +0,0 @@ -/* - GNU linker script for NRF52840 w/S140 6.x.x SoftDevice - - MEMORY MAP - ------------------------------------------------------------------------ - START ADDR END ADDR SIZE DESCRIPTION - ---------- ---------- ------- ----------------------------------------- - 0x000FF000..0x000FFFFF ( 4KB) Bootloader Settings - 0x000FE000..0x000FEFFF ( 4KB) Master Boot Record Params - 0x000F4000..0x000FDFFF ( 40KB) Bootloader (UF2 + CDC + OTA) - - 0x000ED000..0x000F3FFF (28KB ) Private Config Data (Bonding, Keys, etc.) - 0x000AD000..0x000ECFFF (256KB) User Filesystem - 0x00026000..0x000ACFFF (540KB) Application Code (including ISR vector) - 0x00001000..0x00025FFF (148KB) SoftDevice - 0x00000000..0x00000FFF (4KB) Master Boot Record -*/ - - -/* Specify the memory areas (S140 6.x.x) */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 1M - - FLASH_ISR (rx) : ORIGIN = 0x00026000, LENGTH = 0x001000 - FLASH_TEXT (rx) : ORIGIN = 0x00027000, LENGTH = 0x086000 - FLASH_FATFS (r) : ORIGIN = 0x000AD000, LENGTH = 0x040000 - FLASH_NVM (r) : ORIGIN = 0x000EC000, LENGTH = 0x001000 - FLASH_CONFIG (r): ORIGIN = 0x000ED000, LENGTH = 0x007000 - - /* 0x2000000 - RAM:ORIGIN is reserved for Softdevice */ - /* SoftDevice 6.1.0 takes 0x1628 bytes (5.54 kb) minimum. */ - /* To measure the minimum required amount of memory for given configuration, set this number - high enough to work and then check the mutation of the value done by sd_ble_enable. */ - RAM (xrw) : ORIGIN = 0x20000000 + 16K, LENGTH = 256K - 16K -} - -/* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; -_minimum_heap_size = 0; - -/* top end of the stack */ - -/*_stack_end = ORIGIN(RAM) + LENGTH(RAM);*/ -_estack = ORIGIN(RAM) + LENGTH(RAM); - -/* RAM extents for the garbage collector and soft device init */ -_ram_start = ORIGIN(RAM); -_ram_end = ORIGIN(RAM) + LENGTH(RAM); -_heap_end = 0x20020000; /* tunable */ - -INCLUDE "boards/common.ld" diff --git a/ports/nrf/boards/common.ld b/ports/nrf/boards/common.ld deleted file mode 100644 index fade4b9e1b..0000000000 --- a/ports/nrf/boards/common.ld +++ /dev/null @@ -1,115 +0,0 @@ -/* Flash region for File System */ -__fatfs_flash_start_addr = ORIGIN(FLASH_FATFS); -__fatfs_flash_length = LENGTH(FLASH_FATFS); - -/* Flash region for configuration information (bonding info, keys, etc.) */ -__config_flash_start_addr = ORIGIN(FLASH_CONFIG); -__config_flash_length = LENGTH(FLASH_CONFIG); - -/* Flash region for microcontroller.nvm region */ -__nvm_flash_start_addr = ORIGIN(FLASH_NVM); -__nvm_flash_length = LENGTH(FLASH_NVM); - -/* define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - - . = ALIGN(4); - } >FLASH_ISR - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - /* *(.glue_7) */ /* glue arm to thumb code */ - /* *(.glue_7t) */ /* glue thumb to arm code */ - - . = ALIGN(4); - _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT - - /* - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } >FLASH - - .ARM : - { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } >FLASH - */ - - /* used by the startup to initialize data */ - _sidata = .; - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT (_sidata) - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - _ram_start = .; /* create a global symbol at ram start for garbage collector */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ - } >RAM - - /* this is to define the start of the heap, and make sure we have a minimum size */ - .heap : - { - . = ALIGN(4); - PROVIDE ( end = . ); - PROVIDE ( _end = . ); - _heap_start = .; /* define a global symbol at heap start */ - . = . + _minimum_heap_size; - } >RAM - - /* this just checks there is enough RAM for the stack */ - .stack : - { - . = ALIGN(4); - . = . + _minimum_stack_size; - . = ALIGN(4); - } >RAM - - /* Remove information from the standard libraries */ - /* - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - */ - - .ARM.attributes 0 : { *(.ARM.attributes) } -} diff --git a/ports/nrf/boards/nrf52840_1M_256k.ld b/ports/nrf/boards/nrf52840_1M_256k.ld deleted file mode 100644 index eb8a18aef6..0000000000 --- a/ports/nrf/boards/nrf52840_1M_256k.ld +++ /dev/null @@ -1,28 +0,0 @@ -/* - GNU linker script for NRF52840 blank w/ no SoftDevice -*/ - -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x100000 /* entire flash, 1 MiB */ - FLASH_ISR (rx) : ORIGIN = 0x00000000, LENGTH = 0x001000 /* sector 0, 4 KiB */ - FLASH_TEXT (rx) : ORIGIN = 0x00001000, LENGTH = 0x0E6000 /* 920 KiB */ - FLASH_FATFS (r) : ORIGIN = 0x000E7000, LENGTH = 0x019000 /* File system 100 KiB */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 0x040000 /* 256 KiB */ -} - -/* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 40K; -_minimum_heap_size = 0; - -/* top end of the stack */ - -/*_stack_end = ORIGIN(RAM) + LENGTH(RAM);*/ -_estack = ORIGIN(RAM) + LENGTH(RAM); - -/* RAM extents for the garbage collector */ -_ram_end = ORIGIN(RAM) + LENGTH(RAM); -_heap_end = 0x20020000; /* tunable */ - -INCLUDE "boards/common.ld" diff --git a/ports/nrf/boards/nrf52840_1M_256k_s140_6.0.0.ld b/ports/nrf/boards/nrf52840_1M_256k_s140_6.0.0.ld deleted file mode 100644 index 90d6c402d0..0000000000 --- a/ports/nrf/boards/nrf52840_1M_256k_s140_6.0.0.ld +++ /dev/null @@ -1,28 +0,0 @@ -/* - GNU linker script for NRF52840 w/ s140 6.0.0 SoftDevice -*/ - -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x100000 /* entire flash, 1 MiB */ - FLASH_ISR (rx) : ORIGIN = 0x00026000, LENGTH = 0x001000 /* sector 0, 4 KiB */ - FLASH_TEXT (rx) : ORIGIN = 0x00027000, LENGTH = 0x099000 /* 612 KiB */ - FLASH_FATFS (r) : ORIGIN = 0x000C0000, LENGTH = 0x040000 /* File system 256 KiB */ - RAM (xrw) : ORIGIN = 0x20004000, LENGTH = 0x03C000 /* 240 KiB */ -} - -/* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 40K; -_minimum_heap_size = 0; - -/* top end of the stack */ - -/*_stack_end = ORIGIN(RAM) + LENGTH(RAM);*/ -_estack = ORIGIN(RAM) + LENGTH(RAM); - -/* RAM extents for the garbage collector */ -_ram_end = ORIGIN(RAM) + LENGTH(RAM); -_heap_end = 0x20020000; /* tunable */ - -INCLUDE "boards/common.ld" From d9ca4c9a608c08585e37eba88f86a1d89e1335e4 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 10 Dec 2019 22:39:44 -0500 Subject: [PATCH 172/189] fix build failures --- .../boards/kicksat-sprite/mpconfigboard.h | 2 - .../boards/kicksat-sprite/mpconfigboard.mk | 1 - ports/atmel-samd/mpconfigport.h | 64 ++++++++++++------- .../electronut_labs_papyr/mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 2 +- ports/nrf/mpconfigport.h | 4 -- tools/build_memory_info.py | 2 +- 7 files changed, 44 insertions(+), 33 deletions(-) diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h index 6664524d24..4d911ad64c 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h @@ -10,8 +10,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define CALIBRATE_CRYSTALLESS 1 - #define CIRCUITPY_INTERNAL_NVM_SIZE 0 #define DEFAULT_I2C_BUS_SCL (&pin_PA17) diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index b89469776b..df1a2d8eb3 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -6,7 +6,6 @@ USB_MANUFACTURER = "maholli" CHIP_VARIANT = SAMD51G19A CHIP_FAMILY = samd51 -QSPI_FLASH_FILESYSTEM = 0 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index 6ab95c8a5a..a319c6199a 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -30,15 +30,11 @@ // Definitions for which SAMD chip we're using. #include "include/sam.h" +// Definitions that control circuitpy_mpconfig.h: //////////////////////////////////////////////////////////////////////////////////////////////////// -#ifdef SAMD21 -#if INTERNAL_FLASH_FILESYSTEM -#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (64*1024) -#else -#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (0) -#endif +#ifdef SAMD21 // HMCRAMC0_SIZE is defined in the ASF4 include files for each SAMD21 chip. #define RAM_SIZE HMCRAMC0_SIZE @@ -66,29 +62,12 @@ X(EISDIR) \ X(EINVAL) \ -#ifndef CIRCUITPY_INTERNAL_NVM_SIZE -#define CIRCUITPY_INTERNAL_NVM_SIZE (256) -#endif - #endif // SAMD21 //////////////////////////////////////////////////////////////////////////////////////////////////// #ifdef SAMD51 -#ifndef CIRCUITPY_INTERNAL_NVM_SIZE -#define CIRCUITPY_INTERNAL_NVM_SIZE (8192) -#endif - -// If CIRCUITPY is internal, use half of flash for it. -#if INTERNAL_FLASH_FILESYSTEM - #ifndef CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE - #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (FLASH_SIZE/2) - #endif -#else - #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (0) -#endif - // HSRAM_SIZE is defined in the ASF4 include files for each SAMD51 chip. #define RAM_SIZE HSRAM_SIZE #define BOOTLOADER_SIZE (16*1024) @@ -113,6 +92,45 @@ // This also includes mpconfigboard.h. #include "py/circuitpy_mpconfig.h" +// Definitions that can be overridden by mpconfigboard.h: + +//////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef SAMD21 + +#if INTERNAL_FLASH_FILESYSTEM +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (64*1024) +#else +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (0) +#endif + +#ifndef CIRCUITPY_INTERNAL_NVM_SIZE +#define CIRCUITPY_INTERNAL_NVM_SIZE (256) +#endif + +#endif // SAMD21 + +//////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef SAMD51 + +#ifndef CIRCUITPY_INTERNAL_NVM_SIZE +#define CIRCUITPY_INTERNAL_NVM_SIZE (8192) +#endif + +// If CIRCUITPY is internal, use half of flash for it. +#if INTERNAL_FLASH_FILESYSTEM + #ifndef CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE + #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (FLASH_SIZE/2) + #endif +#else + #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (0) +#endif + +#endif // SAMD51 + +//////////////////////////////////////////////////////////////////////////////////////////////////// + #ifndef CALIBRATE_CRYSTALLESS #define CALIBRATE_CRYSTALLESS (0) #endif diff --git a/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.mk b/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.mk index be7175e4ea..569dccc9c4 100644 --- a/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.mk +++ b/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.mk @@ -5,4 +5,4 @@ USB_MANUFACTURER = "Electronut Labs" MCU_CHIP = nrf52840 -INTERNAL_FLASH_FILEYSTEM = 1 +INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk index 0a29c54e55..55ca410d9f 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk +++ b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk @@ -5,4 +5,4 @@ USB_MANUFACTURER = "makerdiary" MCU_CHIP = nrf52840 -INTERNAL_FLASH_FILEYSTEM = 1 +INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index d10f12f6a7..c6d148234b 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -146,10 +146,6 @@ #error No space left in flash for firmware after specifying other regions! #endif -#if CIRCUITPY_FIRMWARE_SIZE < 0 -#error No space left in flash for firmware after specifying other regions! -#endif - diff --git a/tools/build_memory_info.py b/tools/build_memory_info.py index afe49650e2..f61b843ced 100644 --- a/tools/build_memory_info.py +++ b/tools/build_memory_info.py @@ -61,7 +61,7 @@ for region in regions: space = space.split("/*")[0] space = K_PATTERN.sub(K_REPLACE, space) space = M_PATTERN.sub(M_REPLACE, space) - regions[region] = eval(space) + regions[region] = int(eval(space)) # TODO Remove check for both FLASH_FIRMWARE and FLASH after all ports are converted to use FLASH_FIRMWARE. try: From 1e11f2708b345468ae9b1762339bf3511c8ab7eb Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 11 Dec 2019 09:34:56 -0500 Subject: [PATCH 173/189] remove debugging leftovers --- ports/nrf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 4bb72324fb..e6070fc329 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -90,7 +90,7 @@ INC += -I../../supervisor/shared/usb ifeq ($(DEBUG), 1) CFLAGS += -ggdb3 -Og else - CFLAGS += -Os -DNDEBUG -ggdb3 + CFLAGS += -Os -DNDEBUG CFLAGS += -flto -flto-partition=none endif From d67a9a827111114c1984390fd303e9812af6654c Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Wed, 11 Dec 2019 11:41:10 -0800 Subject: [PATCH 174/189] Added PyPortal Pynt alias --- tools/build_board_info.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/build_board_info.py b/tools/build_board_info.py index 710cdb0c22..7c4484a659 100644 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -49,6 +49,7 @@ extension_by_board = { aliases_by_board = { "circuitplayground_express": ["circuitplayground_express_4h", "circuitplayground_express_digikey_pycon2019"], "pybadge": ["edgebadge"], + "pyportal": ["pyportal_pynt"], "gemma_m0": ["gemma_m0_pycon2018"], "pewpew10": ["pewpew13"] } From ae64a669ddd47c5e5ed01b6f94f8c206f1f65cf6 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 11 Dec 2019 15:43:06 -0500 Subject: [PATCH 175/189] address review comments --- .../common-hal/frequencyio/FrequencyIn.c | 22 +++++++++---------- ports/nrf/README.md | 12 ++-------- ports/nrf/common-hal/_bleio/Adapter.c | 2 +- ports/nrf/mpconfigport.h | 5 ++--- .../stm32f412zg_discovery/mpconfigboard.h | 2 +- 5 files changed, 17 insertions(+), 26 deletions(-) diff --git a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c index 6258818c83..cbb0671045 100644 --- a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +++ b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c @@ -213,17 +213,17 @@ void frequencyin_samd51_start_dpll() { // Will also enable the Lock Bypass due to low-frequency sources causing DPLL unlocks // as outlined in the Errata (1.12.1) OSCCTRL->Dpll[1].DPLLRATIO.reg = OSCCTRL_DPLLRATIO_LDRFRAC(0) | OSCCTRL_DPLLRATIO_LDR(2999); - if (BOARD_HAS_CRYSTAL) { // we can use XOSC32K directly as the source - OSC32KCTRL->XOSC32K.bit.EN32K = 1; - OSCCTRL->Dpll[1].DPLLCTRLB.reg = OSCCTRL_DPLLCTRLB_REFCLK(1) | - OSCCTRL_DPLLCTRLB_LBYPASS; - } else { - // can't use OSCULP32K directly; need to setup a GCLK as a reference, - // which must be done in samd/clocks.c to avoid waiting for sync - return; - //OSC32KCTRL->OSCULP32K.bit.EN32K = 1; - //OSCCTRL->Dpll[1].DPLLCTRLB.reg = OSCCTRL_DPLLCTRLB_REFCLK(0); - } +#if BOARD_HAS_CRYSTAL + // we can use XOSC32K directly as the source + OSC32KCTRL->XOSC32K.bit.EN32K = 1; + OSCCTRL->Dpll[1].DPLLCTRLB.reg = OSCCTRL_DPLLCTRLB_REFCLK(1) | OSCCTRL_DPLLCTRLB_LBYPASS; +#else + // can't use OSCULP32K directly; need to setup a GCLK as a reference, + // which must be done in samd/clocks.c to avoid waiting for sync + return; + //OSC32KCTRL->OSCULP32K.bit.EN32K = 1; + //OSCCTRL->Dpll[1].DPLLCTRLB.reg = OSCCTRL_DPLLCTRLB_REFCLK(0); +#endif OSCCTRL->Dpll[1].DPLLCTRLA.reg = OSCCTRL_DPLLCTRLA_ENABLE; while (!(OSCCTRL->Dpll[1].DPLLSTATUS.bit.LOCK || OSCCTRL->Dpll[1].DPLLSTATUS.bit.CLKRDY)) {} diff --git a/ports/nrf/README.md b/ports/nrf/README.md index 64f5b8aff5..88dd472738 100644 --- a/ports/nrf/README.md +++ b/ports/nrf/README.md @@ -5,21 +5,13 @@ This is a port of CircuitPython to the Nordic Semiconductor nRF52 series of chip > **NOTE**: There are board-specific READMEs that may be more up to date than the generic board-neutral documentation below. -## Compile and Flash - -Prerequisite steps for building the nrf port: - - git clone .git circuitpython - cd circuitpython - git submodule update --init --recursive - make -C mpy-cross +## Flash Some boards have UF2 bootloaders and can simply be flashed in the normal way, by copying firmware.uf2 to the BOOT drive. -To build and flash issue the following command inside the ports/nrf/ folder: +For some boards, you can use the `flash` target: - make BOARD=pca10056 make BOARD=pca10056 flash ## Segger Targets diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index 1c9f1fcfaf..cee40a5a0c 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -59,8 +59,8 @@ const nvm_bytearray_obj_t common_hal_bleio_nvm_obj = { .base = { .type = &nvm_bytearray_type, }, - .len = CIRCUITPY_BLE_CONFIG_SIZE, .start_address = (uint8_t*) CIRCUITPY_BLE_CONFIG_START_ADDR, + .len = CIRCUITPY_BLE_CONFIG_SIZE, }; STATIC void softdevice_assert_handler(uint32_t id, uint32_t pc, uint32_t info) { diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index c6d148234b..71bf6bc8f0 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -81,12 +81,10 @@ // firmware // internal CIRCUITPY flash filesystem (optional) // BLE config (bonding info, etc.) (optional) -// microntroller.nvm (optional) +// microcontroller.nvm (optional) // bootloader (note the MBR at 0x0 redirects to the bootloader here, in high flash) // bootloader settings -// Bootloader values from https://github.com/adafruit/Adafruit_nRF52_Bootloader/blob/master/src/linker/s140_v6.ld - // Define these regions starting up from the bottom of flash: #define MBR_START_ADDR (0x0) @@ -101,6 +99,7 @@ // Define these regions starting down from the bootloader: +// Bootloader values from https://github.com/adafruit/Adafruit_nRF52_Bootloader/blob/master/src/linker/s140_v6.ld #define BOOTLOADER_START_ADDR (0x000F4000) #define BOOTLOADER_SIZE (0xA000) // 40kiB #define BOOTLOADER_SETTINGS_START_ADDR (0x000FF000) diff --git a/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h b/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h index 1d47142a83..3ab9a55853 100644 --- a/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h +++ b/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h @@ -33,4 +33,4 @@ #define FLASH_PAGE_SIZE (0x4000) #define DEFAULT_I2C_BUS_SCL (&pin_PB10) -#define DEFAULT_I2C_BUS_SDA (&pin_PB09) \ No newline at end of file +#define DEFAULT_I2C_BUS_SDA (&pin_PB09) From 8c841af9461eba6252690c38bc3e726f2fd09e8b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 11 Dec 2019 22:04:10 -0600 Subject: [PATCH 176/189] MP3File: Avoid crash in get_buffer when deinitted When a playing mp3 is deinitted, it's possible to reach get_buffer, but all the internal pointers are NULL. This would lead to a hard fault. Avoid it by returning GET_BUFFER_ERROR instead. --- shared-module/audiomp3/MP3File.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shared-module/audiomp3/MP3File.c b/shared-module/audiomp3/MP3File.c index cabb461056..f0c4adc263 100644 --- a/shared-module/audiomp3/MP3File.c +++ b/shared-module/audiomp3/MP3File.c @@ -227,6 +227,9 @@ audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t* uint8_t channel, uint8_t** bufptr, uint32_t* buffer_length) { + if (!self->inbuf) { + return GET_BUFFER_ERROR; + } if (!single_channel) { channel = 0; } From fd03fd5e4f7d6a7fb5e126a5e56955e73a0d0711 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 12 Dec 2019 00:19:03 -0500 Subject: [PATCH 177/189] sd_flash_operation_status should be volatile --- ports/nrf/bluetooth/ble_drv.c | 2 +- ports/nrf/bluetooth/ble_drv.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/nrf/bluetooth/ble_drv.c b/ports/nrf/bluetooth/ble_drv.c index 63d67a7f4a..7dbb315826 100644 --- a/ports/nrf/bluetooth/ble_drv.c +++ b/ports/nrf/bluetooth/ble_drv.c @@ -43,7 +43,7 @@ nrf_nvic_state_t nrf_nvic_state = { 0 }; // Flag indicating progress of internal flash operation. -sd_flash_operation_status_t sd_flash_operation_status; +volatile sd_flash_operation_status_t sd_flash_operation_status; __attribute__((aligned(4))) static uint8_t m_ble_evt_buf[sizeof(ble_evt_t) + (BLE_GATT_ATT_MTU_DEFAULT)]; diff --git a/ports/nrf/bluetooth/ble_drv.h b/ports/nrf/bluetooth/ble_drv.h index 7716cab8be..91990da6df 100644 --- a/ports/nrf/bluetooth/ble_drv.h +++ b/ports/nrf/bluetooth/ble_drv.h @@ -59,7 +59,7 @@ typedef enum { } sd_flash_operation_status_t; // Flag indicating progress of internal flash operation. -extern sd_flash_operation_status_t sd_flash_operation_status; +extern volatile sd_flash_operation_status_t sd_flash_operation_status; typedef struct ble_drv_evt_handler_entry { struct ble_drv_evt_handler_entry *next; From 1cdac3f16a9244c992e8494a7246ab643cdb47c0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 12 Dec 2019 08:44:15 -0600 Subject: [PATCH 178/189] MP3File: Fix stereo playback on samd AudioOut There were several problems with the way this worked -- the read_count approach was too complicated and I made a mistake "simplifying" it from WaveFile. And when the right channel was returned, it was off by 1 byte, making it into static. Instead, directly track which is the "other" channel that has data available, and by using the right data type make the "+ channel" arithmetic give the right result. This requires a double cast (int16_t*)(void*) due to an alignment warning; the alignment is now ensured manually, but the compiler doesn't make the necessary inference that the low address bit must be clear. --- shared-module/audiomp3/MP3File.c | 46 +++++++++++++++++++------------- shared-module/audiomp3/MP3File.h | 6 ++--- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/shared-module/audiomp3/MP3File.c b/shared-module/audiomp3/MP3File.c index f0c4adc263..f4861da360 100644 --- a/shared-module/audiomp3/MP3File.c +++ b/shared-module/audiomp3/MP3File.c @@ -151,10 +151,13 @@ void common_hal_audiomp3_mp3file_construct(audiomp3_mp3file_obj_t* self, self->channel_count = fi.nChans; self->frame_buffer_size = fi.outputSamps*sizeof(int16_t); + if ((intptr_t)buffer & 1) { + buffer += 1; buffer_size -= 1; + } if (buffer_size >= 2 * self->frame_buffer_size) { self->len = buffer_size / 2 / self->frame_buffer_size * self->frame_buffer_size; - self->buffers[0] = buffer; - self->buffers[1] = buffer + self->len; + self->buffers[0] = (int16_t*)(void*)buffer; + self->buffers[1] = (int16_t*)(void*)buffer + self->len; } else { self->len = 2 * self->frame_buffer_size; self->buffers[0] = m_malloc(self->len, false); @@ -218,6 +221,7 @@ void audiomp3_mp3file_reset_buffer(audiomp3_mp3file_obj_t* self, f_lseek(&self->file->fp, 0); self->inbuf_offset = self->inbuf_length; self->eof = 0; + self->other_channel = -1; mp3file_update_inbuf(self); mp3file_find_sync_word(self); } @@ -234,26 +238,30 @@ audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t* channel = 0; } - uint16_t channel_read_count = self->channel_read_count[channel]++; - bool need_more_data = self->read_count++ == channel_read_count; - - *bufptr = self->buffers[self->buffer_index] + channel; + *bufptr = (uint8_t*)(self->buffers[self->buffer_index] + channel); *buffer_length = self->frame_buffer_size; - if (need_more_data) { - self->buffer_index = !self->buffer_index; - int16_t *buffer = (int16_t *)(void *)self->buffers[self->buffer_index]; + if (channel == self->other_channel) { + *bufptr = (uint8_t*)(self->buffers[self->other_buffer_index] + channel); + self->other_channel = -1; + return GET_BUFFER_MORE_DATA; + } - if (!mp3file_find_sync_word(self)) { - return self->eof ? GET_BUFFER_DONE : GET_BUFFER_ERROR; - } - int bytes_left = BYTES_LEFT(self); - uint8_t *inbuf = READ_PTR(self); - int err = MP3Decode(self->decoder, &inbuf, &bytes_left, buffer, 0); - CONSUME(self, BYTES_LEFT(self) - bytes_left); - if (err) { - return GET_BUFFER_DONE; - } + self->other_channel = 1-channel; + self->other_buffer_index = self->buffer_index; + + self->buffer_index = !self->buffer_index; + int16_t *buffer = (int16_t *)(void *)self->buffers[self->buffer_index]; + + if (!mp3file_find_sync_word(self)) { + return self->eof ? GET_BUFFER_DONE : GET_BUFFER_ERROR; + } + int bytes_left = BYTES_LEFT(self); + uint8_t *inbuf = READ_PTR(self); + int err = MP3Decode(self->decoder, &inbuf, &bytes_left, buffer, 0); + CONSUME(self, BYTES_LEFT(self) - bytes_left); + if (err) { + return GET_BUFFER_DONE; } return GET_BUFFER_MORE_DATA; diff --git a/shared-module/audiomp3/MP3File.h b/shared-module/audiomp3/MP3File.h index 12649ac1ad..9d99e8d1f0 100644 --- a/shared-module/audiomp3/MP3File.h +++ b/shared-module/audiomp3/MP3File.h @@ -39,7 +39,7 @@ typedef struct { uint8_t* inbuf; uint32_t inbuf_length; uint32_t inbuf_offset; - uint8_t* buffers[2]; + int16_t* buffers[2]; uint32_t len; uint32_t frame_buffer_size; @@ -50,8 +50,8 @@ typedef struct { uint8_t channel_count; bool eof; - uint16_t read_count; - uint16_t channel_read_count[2]; + int8_t other_channel; + int8_t other_buffer_index; } audiomp3_mp3file_obj_t; // These are not available from Python because it may be called in an interrupt. From 63046d800d64081a4f7756476f5249179179ff5e Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 19 Aug 2019 15:50:02 +1000 Subject: [PATCH 179/189] py: Introduce MP_UNREACHABLE macro to annotate unreachable code. And use it to replace the same pattern at the end of nlrthumb.c:nlr_jump. --- py/mpconfig.h | 9 +++++++++ py/nlrthumb.c | 6 +----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/py/mpconfig.h b/py/mpconfig.h index 3ec383817e..a0d211bfaa 100755 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -1440,6 +1440,15 @@ typedef double mp_float_t; #define MP_UNLIKELY(x) __builtin_expect((x), 0) #endif +// To annotate that code is unreachable +#ifndef MP_UNREACHABLE +#if defined(__GNUC__) +#define MP_UNREACHABLE __builtin_unreachable(); +#else +#define MP_UNREACHABLE for (;;); +#endif +#endif + #ifndef MP_HTOBE16 #if MP_ENDIANNESS_LITTLE # define MP_HTOBE16(x) ((uint16_t)( (((x) & 0xff) << 8) | (((x) >> 8) & 0xff) )) diff --git a/py/nlrthumb.c b/py/nlrthumb.c index 69d3f868af..eb32e2ce5b 100644 --- a/py/nlrthumb.c +++ b/py/nlrthumb.c @@ -127,11 +127,7 @@ NORETURN void nlr_jump(void *val) { : // clobbered registers ); - #if defined(__GNUC__) - __builtin_unreachable(); - #else - for (;;); // needed to silence compiler warning - #endif + MP_UNREACHABLE } #endif // MICROPY_NLR_THUMB From 1cf0ce094a4a1571b7404643e7a3b992592317a5 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 19 Aug 2019 15:51:40 +1000 Subject: [PATCH 180/189] py/nlr: Use MP_UNREACHABLE at the end of arch-specific nlr_jump funcs. Recent versions of gcc perform optimisations which can lead to the following code from the MP_NLR_JUMP_HEAD macro being omitted: top->ret_val = val; \ MP_NLR_RESTORE_PYSTACK(top); \ *_top_ptr = top->prev; \ This is noticeable (at least) in the unix coverage on x86-64 built with gcc 9.1.0. This is because the nlr_jump function is marked as no-return, so gcc deduces that the above code has no effect. Adding MP_UNREACHABLE tells the compiler that the asm code may branch elsewhere, and so it cannot optimise away the code. --- py/nlrx64.c | 2 +- py/nlrx86.c | 2 +- py/nlrxtensa.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/py/nlrx64.c b/py/nlrx64.c index 9b2b22c225..569ad84fb0 100644 --- a/py/nlrx64.c +++ b/py/nlrx64.c @@ -108,7 +108,7 @@ NORETURN void nlr_jump(void *val) { : // clobbered registers ); - for (;;); // needed to silence compiler warning + MP_UNREACHABLE } #endif // MICROPY_NLR_X64 diff --git a/py/nlrx86.c b/py/nlrx86.c index 4900a4c0d2..6fbbe44327 100644 --- a/py/nlrx86.c +++ b/py/nlrx86.c @@ -100,7 +100,7 @@ NORETURN void nlr_jump(void *val) { : // clobbered registers ); - for (;;); // needed to silence compiler warning + MP_UNREACHABLE } #endif // MICROPY_NLR_X86 diff --git a/py/nlrxtensa.c b/py/nlrxtensa.c index d66c7a9a7f..5640350043 100644 --- a/py/nlrxtensa.c +++ b/py/nlrxtensa.c @@ -77,7 +77,7 @@ NORETURN void nlr_jump(void *val) { : // clobbered registers ); - for (;;); // needed to silence compiler warning + MP_UNREACHABLE } #endif // MICROPY_NLR_XTENSA From 767d47dd6025e8046b03e6b307fd0ba6a81cf504 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 17 Jun 2019 23:19:34 +1000 Subject: [PATCH 181/189] py/nlrthumb: Save and restore VFP registers s16-s21 when CPU has them. These s16-s21 registers are used by gcc so need to be saved. Future versions of gcc (beyond v9.1.0), or other compilers, may eventually need additional registers saved/restored. See issue #4844. --- py/nlr.h | 9 ++++++++- py/nlrthumb.c | 10 ++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/py/nlr.h b/py/nlr.h index b442aaf8a0..1b95002d3b 100644 --- a/py/nlr.h +++ b/py/nlr.h @@ -54,7 +54,14 @@ #endif #elif defined(__thumb2__) || defined(__thumb__) || defined(__arm__) #define MICROPY_NLR_THUMB (1) - #define MICROPY_NLR_NUM_REGS (10) + #if defined(__SOFTFP__) + #define MICROPY_NLR_NUM_REGS (10) + #else + // With hardware FP registers s16-s31 are callee save so in principle + // should be saved and restored by the NLR code. gcc only uses s16-s21 + // so only save/restore those as an optimisation. + #define MICROPY_NLR_NUM_REGS (10 + 6) + #endif #elif defined(__xtensa__) #define MICROPY_NLR_XTENSA (1) #define MICROPY_NLR_NUM_REGS (10) diff --git a/py/nlrthumb.c b/py/nlrthumb.c index eb32e2ce5b..056aa358e7 100644 --- a/py/nlrthumb.c +++ b/py/nlrthumb.c @@ -63,6 +63,11 @@ __attribute__((naked)) unsigned int nlr_push(nlr_buf_t *nlr) { "str r10, [r0, #36] \n" // store r10 into nlr_buf "str r11, [r0, #40] \n" // store r11 into nlr_buf "str r13, [r0, #44] \n" // store r13=sp into nlr_buf + #if MICROPY_NLR_NUM_REGS == 16 + "vstr d8, [r0, #48] \n" // store s16-s17 into nlr_buf + "vstr d9, [r0, #56] \n" // store s18-s19 into nlr_buf + "vstr d10, [r0, #64] \n" // store s20-s21 into nlr_buf + #endif "str lr, [r0, #8] \n" // store lr into nlr_buf #endif @@ -118,6 +123,11 @@ NORETURN void nlr_jump(void *val) { "ldr r10, [r0, #36] \n" // load r10 from nlr_buf "ldr r11, [r0, #40] \n" // load r11 from nlr_buf "ldr r13, [r0, #44] \n" // load r13=sp from nlr_buf + #if MICROPY_NLR_NUM_REGS == 16 + "vldr d8, [r0, #48] \n" // load s16-s17 from nlr_buf + "vldr d9, [r0, #56] \n" // load s18-s19 from nlr_buf + "vldr d10, [r0, #64] \n" // load s20-s21 from nlr_buf + #endif "ldr lr, [r0, #8] \n" // load lr from nlr_buf #endif "movs r0, #1 \n" // return 1, non-local return From 7889b999ccb32b78ddabc2b2738f0a9d182b9411 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 12 Dec 2019 14:35:24 -0500 Subject: [PATCH 182/189] Fix flash write error handling; clean up safe mode message printing --- main.c | 4 +- ports/nrf/common-hal/nvm/ByteArray.c | 11 +++- ports/nrf/peripherals/nrf/nvm.c | 15 ++--- ports/nrf/peripherals/nrf/nvm.h | 2 +- ports/nrf/supervisor/internal_flash.c | 6 +- supervisor/shared/safe_mode.c | 80 ++++++++++++++++++--------- supervisor/shared/safe_mode.h | 3 +- 7 files changed, 78 insertions(+), 43 deletions(-) diff --git a/main.c b/main.c index a6c7c05816..2bbfd1be0c 100755 --- a/main.c +++ b/main.c @@ -264,9 +264,7 @@ bool run_code_py(safe_mode_t safe_mode) { rgb_status_animation_t animation; prep_rgb_status_animation(&result, found_main, safe_mode, &animation); while (true) { - #ifdef MICROPY_VM_HOOK_LOOP - MICROPY_VM_HOOK_LOOP - #endif + RUN_BACKGROUND_TASKS; if (reload_requested) { reload_requested = false; return true; diff --git a/ports/nrf/common-hal/nvm/ByteArray.c b/ports/nrf/common-hal/nvm/ByteArray.c index ee270f79bb..bace8221c8 100644 --- a/ports/nrf/common-hal/nvm/ByteArray.c +++ b/ports/nrf/common-hal/nvm/ByteArray.c @@ -24,6 +24,7 @@ * THE SOFTWARE. */ +#include "py/runtime.h" #include "common-hal/nvm/ByteArray.h" #include @@ -43,16 +44,20 @@ uint32_t common_hal_nvm_bytearray_get_length(nvm_bytearray_obj_t *self) { } 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 + // 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. + bool status; if (offset == 0 && len == FLASH_PAGE_SIZE) { - nrf_nvm_safe_flash_page_write(page_addr, bytes); + status = nrf_nvm_safe_flash_page_write(page_addr, bytes); } else { uint8_t buffer[FLASH_PAGE_SIZE]; memcpy(buffer, (uint8_t *)page_addr, FLASH_PAGE_SIZE); memcpy(buffer + offset, bytes, len); - nrf_nvm_safe_flash_page_write(page_addr, buffer); + status = nrf_nvm_safe_flash_page_write(page_addr, buffer); + } + if (!status) { + mp_raise_OSError_msg(translate("Flash write failed")); } } diff --git a/ports/nrf/peripherals/nrf/nvm.c b/ports/nrf/peripherals/nrf/nvm.c index d8fddc4dcf..7118b9c870 100644 --- a/ports/nrf/peripherals/nrf/nvm.c +++ b/ports/nrf/peripherals/nrf/nvm.c @@ -50,7 +50,7 @@ STATIC sd_flash_operation_status_t sd_flash_operation_wait_until_done(void) { } #endif -void nrf_nvm_safe_flash_page_write(uint32_t page_addr, uint8_t *data) { +bool nrf_nvm_safe_flash_page_write(uint32_t page_addr, uint8_t *data) { #ifdef BLUETOOTH_SD uint8_t sd_en = 0; (void) sd_softdevice_is_enabled(&sd_en); @@ -61,11 +61,11 @@ void nrf_nvm_safe_flash_page_write(uint32_t page_addr, uint8_t *data) { sd_flash_operation_start(); err_code = sd_flash_page_erase(page_addr / FLASH_PAGE_SIZE); if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg_varg(translate("Flash erase failed to start, err 0x%04x"), err_code); + return false; } status = sd_flash_operation_wait_until_done(); if (status == SD_FLASH_OPERATION_ERROR) { - mp_raise_OSError_msg(translate("Flash erase failed")); + return false; } // Divide a full page into parts, because writing a full page causes an assertion failure. @@ -78,18 +78,19 @@ void nrf_nvm_safe_flash_page_write(uint32_t page_addr, uint8_t *data) { (uint32_t *)data + i * words_to_write, words_to_write); if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg_varg(translate("Flash write failed to start, err 0x%04x"), err_code); + return false; } status = sd_flash_operation_wait_until_done(); if (status == SD_FLASH_OPERATION_ERROR) { - mp_raise_OSError_msg(translate("Flash write failed")); + return false; } } - return; + return true; } #endif nrf_nvmc_page_erase(page_addr); nrf_nvmc_write_bytes(page_addr, data, FLASH_PAGE_SIZE); -} + return true; +} diff --git a/ports/nrf/peripherals/nrf/nvm.h b/ports/nrf/peripherals/nrf/nvm.h index 4eac3d7283..c1a2a76dad 100644 --- a/ports/nrf/peripherals/nrf/nvm.h +++ b/ports/nrf/peripherals/nrf/nvm.h @@ -31,4 +31,4 @@ #define CIRCUITPY_INTERNAL_NVM_SIZE (0) #endif -void nrf_nvm_safe_flash_page_write(uint32_t page_addr, uint8_t *data); +bool nrf_nvm_safe_flash_page_write(uint32_t page_addr, uint8_t *data); diff --git a/ports/nrf/supervisor/internal_flash.c b/ports/nrf/supervisor/internal_flash.c index dcacd4d27f..4688e0ceeb 100644 --- a/ports/nrf/supervisor/internal_flash.c +++ b/ports/nrf/supervisor/internal_flash.c @@ -34,6 +34,7 @@ #include "py/obj.h" #include "py/runtime.h" #include "lib/oofatfs/ff.h" +#include "supervisor/shared/safe_mode.h" #include "peripherals/nrf/nvm.h" @@ -75,7 +76,9 @@ void supervisor_flash_flush(void) { // Skip if data is the same if (memcmp(_flash_cache, (void *)_flash_page_addr, FLASH_PAGE_SIZE) != 0) { - nrf_nvm_safe_flash_page_write(_flash_page_addr, _flash_cache); + if (!nrf_nvm_safe_flash_page_write(_flash_page_addr, _flash_cache)) { + reset_into_safe_mode(FLASH_WRITE_FAIL); + } } } @@ -120,4 +123,3 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32 void supervisor_flash_release_cache(void) { } - diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c index 363181da06..9e3b864028 100644 --- a/supervisor/shared/safe_mode.c +++ b/supervisor/shared/safe_mode.c @@ -94,44 +94,72 @@ void __attribute__((noinline,)) reset_into_safe_mode(safe_mode_t reason) { reset_cpu(); } + + +#define FILE_AN_ISSUE translate("\r\nPlease file an issue with the contents of your CIRCUITPY drive at \nhttps://github.com/adafruit/circuitpython/issues\r\n") + void print_safe_mode_message(safe_mode_t reason) { if (reason == NO_SAFE_MODE) { return; } serial_write("\r\n"); - // Output a user safe mode string if its set. + // Output a user safe mode string if it's set. #ifdef BOARD_USER_SAFE_MODE if (reason == USER_SAFE_MODE) { serial_write_compressed(translate("You requested starting safe mode by ")); serial_write(BOARD_USER_SAFE_MODE_ACTION); - serial_write("\r\n"); - serial_write_compressed(translate("To exit, please reset the board without ")); + serial_write_compressed(translate("\r\nTo exit, please reset the board without ")); serial_write(BOARD_USER_SAFE_MODE_ACTION); serial_write("\r\n"); } else #endif - if (reason == MANUAL_SAFE_MODE) { - serial_write_compressed(translate("The reset button was pressed while booting CircuitPython. Press again to exit safe mode.\n")); - } else if (reason == PROGRAMMATIC_SAFE_MODE) { - serial_write_compressed(translate("The `microcontroller` module was used to boot into safe mode. Press reset to exit safe mode.\n")); - } else { - serial_write_compressed(translate("You are running in safe mode which means something unanticipated happened.\n")); - if (reason == HARD_CRASH || reason == MICROPY_NLR_JUMP_FAIL || reason == MICROPY_FATAL_ERROR || reason == GC_ALLOC_OUTSIDE_VM) { - serial_write_compressed(translate("Looks like our core CircuitPython code crashed hard. Whoops!\nPlease file an issue at https://github.com/adafruit/circuitpython/issues\n with the contents of your CIRCUITPY drive and this message:\n")); - if (reason == HARD_CRASH) { - serial_write_compressed(translate("Crash into the HardFault_Handler.\n")); - } else if (reason == MICROPY_NLR_JUMP_FAIL) { - serial_write_compressed(translate("MicroPython NLR jump failed. Likely memory corruption.\n")); - } else if (reason == MICROPY_FATAL_ERROR) { - serial_write_compressed(translate("MicroPython fatal error.\n")); - } else if (reason == GC_ALLOC_OUTSIDE_VM) { - serial_write_compressed(translate("Attempted heap allocation when MicroPython VM not running.\n")); - } - } else if (reason == BROWNOUT) { - serial_write_compressed(translate("The microcontroller's power dipped. Please make sure your power supply provides\nenough power for the whole circuit and press reset (after ejecting CIRCUITPY).\n")); - } else if (reason == HEAP_OVERWRITTEN) { - serial_write_compressed(translate("The CircuitPython heap was corrupted because the stack was too small.\nPlease increase stack size limits and press reset (after ejecting CIRCUITPY).\nIf you didn't change the stack, then file an issue here with the contents of your CIRCUITPY drive:\n")); - serial_write("https://github.com/adafruit/circuitpython/issues\r\n"); + switch (reason) { + case MANUAL_SAFE_MODE: + serial_write_compressed(translate("CircuitPython is in safe mode because you pressed the reset button during boot. Press again to exit safe mode.\r\n")); + return; + case PROGRAMMATIC_SAFE_MODE: + serial_write_compressed(translate("The `microcontroller` module was used to boot into safe mode. Press reset to exit safe mode.\r\n")); + return; + default: + break; } - } + + serial_write_compressed(translate("You are in safe mode: something unanticipated happened.\r\n")); + switch (reason) { + case BROWNOUT: + serial_write_compressed(translate("The microcontroller's power dipped. Make sure your power supply provides\r\nenough power for the whole circuit and press reset (after ejecting CIRCUITPY).\r\n")); + return; + case HEAP_OVERWRITTEN: + serial_write_compressed(translate("The CircuitPython heap was corrupted because the stack was too small.\r\nPlease increase the stack size if you know how, or if not:")); + serial_write_compressed(FILE_AN_ISSUE); + return; + default: + break; + } + + serial_write_compressed(translate("CircuitPython core code crashed hard. Whoops!\r\n")); + switch (reason) { + case HARD_CRASH: + serial_write_compressed(translate("Crash into the HardFault_Handler.")); + return; + case MICROPY_NLR_JUMP_FAIL: + serial_write_compressed(translate("MicroPython NLR jump failed. Likely memory corruption.")); + return; + case MICROPY_FATAL_ERROR: + serial_write_compressed(translate("MicroPython fatal error.")); + break; + case GC_ALLOC_OUTSIDE_VM: + serial_write_compressed(translate("Attempted heap allocation when MicroPython VM not running.")); + break; + case NORDIC_SOFT_DEVICE_ASSERT: + serial_write_compressed(translate("Nordic Soft Device failure assertion.")); + break; + case FLASH_WRITE_FAIL: + serial_write_compressed(translate("Failed to write internal flash.")); + break; + default: + serial_write_compressed(translate("Unknown reason.")); + break; + } + serial_write_compressed(FILE_AN_ISSUE); } diff --git a/supervisor/shared/safe_mode.h b/supervisor/shared/safe_mode.h index 8c5dcd9c5d..e05fca0e46 100644 --- a/supervisor/shared/safe_mode.h +++ b/supervisor/shared/safe_mode.h @@ -38,7 +38,8 @@ typedef enum { MICROPY_FATAL_ERROR, GC_ALLOC_OUTSIDE_VM, PROGRAMMATIC_SAFE_MODE, - NORDIC_SOFT_DEVICE_ASSERT + NORDIC_SOFT_DEVICE_ASSERT, + FLASH_WRITE_FAIL, } safe_mode_t; safe_mode_t wait_for_safe_mode_reset(void); From 1b3028bed139149247ff5e692f24ec5356450f83 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 12 Dec 2019 14:51:50 -0500 Subject: [PATCH 183/189] make translate and remove backslash-r's --- locale/ID.po | 116 ++++++++++++--------- locale/circuitpython.pot | 89 ++++++++-------- locale/de_DE.po | 176 +++++++++++++++++++------------ locale/en_US.po | 89 ++++++++-------- locale/en_x_pirate.po | 89 ++++++++-------- locale/es.po | 191 ++++++++++++++++++++++------------ locale/fil.po | 168 +++++++++++++++++++----------- locale/fr.po | 190 +++++++++++++++++++++------------ locale/it_IT.po | 130 ++++++++++++++--------- locale/ko.po | 89 ++++++++-------- locale/pl.po | 182 ++++++++++++++++++++------------ locale/pt_BR.po | 92 ++++++++-------- locale/zh_Latn_pinyin.po | 185 ++++++++++++++++++++------------ supervisor/shared/safe_mode.c | 20 ++-- 14 files changed, 1073 insertions(+), 733 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 4be18ec0de..c147a5f5f9 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -23,6 +23,19 @@ msgid "" "Code done running. Waiting for 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 "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr "" @@ -294,7 +307,7 @@ msgid "Array values should be single bytes." msgstr "" #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" +msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" #: main.c @@ -454,6 +467,16 @@ msgstr "" 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 "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "" @@ -515,7 +538,7 @@ msgid "Couldn't allocate second buffer" msgstr "" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" +msgid "Crash into the HardFault_Handler." msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -632,28 +655,18 @@ msgstr "" msgid "Failed to release mutex, err 0x%04x" msgstr "Gagal untuk melepaskan mutex, status: 0x%08lX" +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + #: py/moduerrno.c msgid "File exists" msgstr "" -#: ports/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -826,13 +839,6 @@ msgstr "" msgid "Length must be non-negative" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "" @@ -847,11 +853,11 @@ msgid "Maximum x value when mirrored is %d" msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" +msgid "MicroPython fatal error." msgstr "" #: shared-bindings/audiobusio/PDMIn.c @@ -920,6 +926,10 @@ msgstr "" msgid "No such file/directory" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c #, fuzzy @@ -1103,10 +1113,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" #: supervisor/shared/safe_mode.c @@ -1116,21 +1123,11 @@ msgid "" msgstr "" #: supervisor/shared/safe_mode.c -#, fuzzy msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"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 "" -"Tegangan dari mikrokontroler turun atau mati. Pastikan sumber tegangan " -"memberikan daya\n" - -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -1164,10 +1161,6 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "Untuk keluar, silahkan reset board tanpa " - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Terlalu banyak channel dalam sampel" @@ -1246,6 +1239,10 @@ msgstr "" 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" @@ -1323,12 +1320,8 @@ msgstr "" "Untuk menampilkan modul built-in silahkan ketik `help(\"modules\")`.\n" #: supervisor/shared/safe_mode.c -#, fuzzy -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" +msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" -"Anda sedang menjalankan mode aman (safe mode) yang berarti sesuatu yang " -"sangat buruk telah terjadi.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -2853,6 +2846,19 @@ msgstr "" #~ msgid "Soft device assert, id: 0x%08lX, pc: 0x%08lX" #~ msgstr "Dukungan soft device, id: 0x%08lX, pc: 0x%08l" +#, fuzzy +#~ msgid "" +#~ "The microcontroller's power dipped. Please make sure your power supply " +#~ "provides\n" +#~ "enough power for the whole circuit and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ msgstr "" +#~ "Tegangan dari mikrokontroler turun atau mati. Pastikan sumber tegangan " +#~ "memberikan daya\n" + +#~ msgid "To exit, please reset the board without " +#~ msgstr "Untuk keluar, silahkan reset board tanpa " + #~ msgid "UART(%d) does not exist" #~ msgstr "UART(%d) tidak ada" @@ -2870,6 +2876,14 @@ msgstr "" #~ "Gunakan esptool untuk menghapus flash dan upload ulang Python sebagai " #~ "gantinya" +#, fuzzy +#~ msgid "" +#~ "You are running in safe mode which means something unanticipated " +#~ "happened.\n" +#~ msgstr "" +#~ "Anda sedang menjalankan mode aman (safe mode) yang berarti sesuatu yang " +#~ "sangat buruk telah terjadi.\n" + #~ msgid "[addrinfo error %d]" #~ msgstr "[addrinfo error %d]" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index f007202071..3b605d99fd 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -23,6 +23,19 @@ msgid "" "Code done running. Waiting for 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 "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr "" @@ -292,7 +305,7 @@ msgid "Array values should be single bytes." msgstr "" #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" +msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" #: main.c @@ -444,6 +457,16 @@ msgstr "" 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 "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "" @@ -505,7 +528,7 @@ msgid "Couldn't allocate second buffer" msgstr "" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" +msgid "Crash into the HardFault_Handler." msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -621,28 +644,18 @@ msgstr "" 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/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -815,13 +828,6 @@ msgstr "" msgid "Length must be non-negative" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "" @@ -836,11 +842,11 @@ msgid "Maximum x value when mirrored is %d" msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" +msgid "MicroPython fatal error." msgstr "" #: shared-bindings/audiobusio/PDMIn.c @@ -909,6 +915,10 @@ msgstr "" msgid "No such file/directory" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1087,10 +1097,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" #: supervisor/shared/safe_mode.c @@ -1101,18 +1108,11 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"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 "" -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" - #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" msgstr "" @@ -1145,10 +1145,6 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -1227,6 +1223,10 @@ msgstr "" 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" @@ -1297,8 +1297,7 @@ msgid "" msgstr "" #: supervisor/shared/safe_mode.c -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" +msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" #: supervisor/shared/safe_mode.c diff --git a/locale/de_DE.po b/locale/de_DE.po index 1756a7717e..f1158b1b3a 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -25,6 +25,19 @@ msgstr "" "\n" "Der Code wurde ausgeführt. Warte auf reload.\n" +#: 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 "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr " Datei \"%q\"" @@ -294,7 +307,7 @@ msgid "Array values should be single bytes." msgstr "Array-Werte sollten aus Einzelbytes bestehen." #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" +msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" #: main.c @@ -448,6 +461,16 @@ msgstr "Kann nicht ohne MOSI-Pin schreiben." msgid "CharacteristicBuffer writing not provided" msgstr "Schreiben von CharacteristicBuffer ist nicht vorgesehen" +#: 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 "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Clock pin init fehlgeschlagen." @@ -509,8 +532,8 @@ msgid "Couldn't allocate second buffer" msgstr "Konnte second buffer nicht zuteilen" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" -msgstr "Absturz in HardFault_Handler.\n" +msgid "Crash into the HardFault_Handler." +msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -625,28 +648,18 @@ msgstr "" msgid "Failed to release mutex, err 0x%04x" msgstr "Mutex konnte nicht freigegeben werden. Status: 0x%04x" +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + #: py/moduerrno.c msgid "File exists" msgstr "Datei existiert" -#: ports/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -823,17 +836,6 @@ msgstr "Länge muss ein int sein" msgid "Length must be non-negative" msgstr "Länge darf nicht negativ sein" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" -"Sieht aus, als wäre der CircuitPython-Kernel-Code abgestürzt. Uups!\n" -"Bitte melde das Problem unter https://github.com/adafruit/circuitpython/" -"issues\n" -"mit dem Inhalt deines CIRCUITPY-Laufwerks und dieser Nachricht:\n" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "MISO pin Initialisierung fehlgeschlagen" @@ -848,14 +850,12 @@ msgid "Maximum x value when mirrored is %d" msgstr "Maximaler x-Wert beim Spiegeln ist %d" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" -"MicroPython-NLR-Sprung ist fehlgeschlagen. Wahrscheinlich " -"Speicherbeschädigung.\n" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" -msgstr "Schwerwiegender MicroPython-Fehler\n" +msgid "MicroPython fatal error." +msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" @@ -924,6 +924,10 @@ msgstr "Kein Speicherplatz mehr verfügbar auf dem Gerät" msgid "No such file/directory" msgstr "Keine solche Datei/Verzeichnis" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1110,17 +1114,8 @@ msgstr "Stream fehlt readinto() oder write() Methode." #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" -"Der CircuitPython-Heap war beschädigt, weil der Stack zu klein war.\n" -"Bitte erhöhe die stack size limits und drücke die Reset-Taste (nach Auswurf " -"des CIRCUITPY-Laufwerks)\n" -"Wenn du den Stack nicht geändert hast, melde bitte das Problem unter https://" -"github.com/adafruit/circuitpython/issues\n" -"mit dem Inhalt deines CIRCUITPY-Laufwerks.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -1132,23 +1127,10 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"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 "" -"Die Stromversorgung des Mikrocontrollers ist eingebrochen. Stelle sicher, " -"dass deine Stromversorgung genug Leistung für die gesamte Schaltung zur " -"Verfügung stellt und drücke die Reset-Taste (nach Auswurf des CIRCUITPY-" -"Laufwerks)\n" - -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" -"Die Reset-Taste wurde beim Booten von CircuitPython gedrückt. Drücke sie " -"erneut um den abgesicherten Modus zu verlassen. \n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -1182,10 +1164,6 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "Zum beenden, resette bitte das board ohne " - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Zu viele Kanäle im sample" @@ -1264,6 +1242,10 @@ msgstr "Unerwarteter nrfx uuid-Typ" 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" @@ -1343,11 +1325,8 @@ msgstr "" "aus.\n" #: supervisor/shared/safe_mode.c -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" +msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" -"Sie laufen im abgesicherten Modus, was bedeutet, dass etwas Unerwartetes " -"passiert ist.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -2737,6 +2716,9 @@ msgstr "" #~ msgid "Could not decode ble_uuid, err 0x%04x" #~ msgstr "Konnte ble_uuid nicht decodieren. Status: 0x%04x" +#~ msgid "Crash into the HardFault_Handler.\n" +#~ msgstr "Absturz in HardFault_Handler.\n" + #~ msgid "Data too large for the advertisement packet" #~ msgstr "Daten sind zu groß für das advertisement packet" @@ -2871,9 +2853,27 @@ msgstr "" #~ msgid "Invalid data pin" #~ msgstr "Ungültiger data pin" +#~ msgid "" +#~ "Looks like our core CircuitPython code crashed hard. Whoops!\n" +#~ "Please file an issue at https://github.com/adafruit/circuitpython/issues\n" +#~ " with the contents of your CIRCUITPY drive and this message:\n" +#~ msgstr "" +#~ "Sieht aus, als wäre der CircuitPython-Kernel-Code abgestürzt. Uups!\n" +#~ "Bitte melde das Problem unter https://github.com/adafruit/circuitpython/" +#~ "issues\n" +#~ "mit dem Inhalt deines CIRCUITPY-Laufwerks und dieser Nachricht:\n" + #~ msgid "Maximum PWM frequency is %dhz." #~ msgstr "Maximale PWM Frequenz ist %dHz" +#~ msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +#~ msgstr "" +#~ "MicroPython-NLR-Sprung ist fehlgeschlagen. Wahrscheinlich " +#~ "Speicherbeschädigung.\n" + +#~ msgid "MicroPython fatal error.\n" +#~ msgstr "Schwerwiegender MicroPython-Fehler\n" + #~ msgid "Minimum PWM frequency is 1hz." #~ msgstr "Minimale PWM Frequenz ist %dHz" @@ -2920,6 +2920,41 @@ msgstr "" #~ msgid "STA required" #~ msgstr "STA erforderlich" +#~ msgid "" +#~ "The CircuitPython heap was corrupted because the stack was too small.\n" +#~ "Please increase stack size limits and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ "If you didn't change the stack, then file an issue here with the contents " +#~ "of your CIRCUITPY drive:\n" +#~ msgstr "" +#~ "Der CircuitPython-Heap war beschädigt, weil der Stack zu klein war.\n" +#~ "Bitte erhöhe die stack size limits und drücke die Reset-Taste (nach " +#~ "Auswurf des CIRCUITPY-Laufwerks)\n" +#~ "Wenn du den Stack nicht geändert hast, melde bitte das Problem unter " +#~ "https://github.com/adafruit/circuitpython/issues\n" +#~ "mit dem Inhalt deines CIRCUITPY-Laufwerks.\n" + +#~ msgid "" +#~ "The microcontroller's power dipped. Please make sure your power supply " +#~ "provides\n" +#~ "enough power for the whole circuit and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ msgstr "" +#~ "Die Stromversorgung des Mikrocontrollers ist eingebrochen. Stelle sicher, " +#~ "dass deine Stromversorgung genug Leistung für die gesamte Schaltung zur " +#~ "Verfügung stellt und drücke die Reset-Taste (nach Auswurf des CIRCUITPY-" +#~ "Laufwerks)\n" + +#~ msgid "" +#~ "The reset button was pressed while booting CircuitPython. Press again to " +#~ "exit safe mode.\n" +#~ msgstr "" +#~ "Die Reset-Taste wurde beim Booten von CircuitPython gedrückt. Drücke sie " +#~ "erneut um den abgesicherten Modus zu verlassen. \n" + +#~ msgid "To exit, please reset the board without " +#~ msgstr "Zum beenden, resette bitte das board ohne " + #~ msgid "UART(%d) does not exist" #~ msgstr "UART(%d) existiert nicht" @@ -2942,6 +2977,13 @@ msgstr "" #~ msgid "Voice index too high" #~ msgstr "Voice index zu hoch" +#~ msgid "" +#~ "You are running in safe mode which means something unanticipated " +#~ "happened.\n" +#~ msgstr "" +#~ "Sie laufen im abgesicherten Modus, was bedeutet, dass etwas Unerwartetes " +#~ "passiert ist.\n" + #~ msgid "buffer too long" #~ msgstr "Buffer zu lang" diff --git a/locale/en_US.po b/locale/en_US.po index 79940e95ed..c6f342186f 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -23,6 +23,19 @@ msgid "" "Code done running. Waiting for 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 "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr "" @@ -292,7 +305,7 @@ msgid "Array values should be single bytes." msgstr "" #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" +msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" #: main.c @@ -444,6 +457,16 @@ msgstr "" 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 "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "" @@ -505,7 +528,7 @@ msgid "Couldn't allocate second buffer" msgstr "" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" +msgid "Crash into the HardFault_Handler." msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -621,28 +644,18 @@ msgstr "" 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/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -815,13 +828,6 @@ msgstr "" msgid "Length must be non-negative" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "" @@ -836,11 +842,11 @@ msgid "Maximum x value when mirrored is %d" msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" +msgid "MicroPython fatal error." msgstr "" #: shared-bindings/audiobusio/PDMIn.c @@ -909,6 +915,10 @@ msgstr "" msgid "No such file/directory" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1087,10 +1097,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" #: supervisor/shared/safe_mode.c @@ -1101,18 +1108,11 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"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 "" -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" - #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" msgstr "" @@ -1145,10 +1145,6 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -1227,6 +1223,10 @@ msgstr "" 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" @@ -1297,8 +1297,7 @@ msgid "" msgstr "" #: supervisor/shared/safe_mode.c -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" +msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" #: supervisor/shared/safe_mode.c diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index 9fe49ec9f1..54d246e2de 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -25,6 +25,19 @@ msgstr "" "\n" "Captin's orders are complete. Holdin' fast fer reload.\n" +#: 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 "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr "" @@ -294,7 +307,7 @@ msgid "Array values should be single bytes." msgstr "" #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" +msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" #: main.c @@ -448,6 +461,16 @@ msgstr "" 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 "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "" @@ -509,7 +532,7 @@ msgid "Couldn't allocate second buffer" msgstr "" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" +msgid "Crash into the HardFault_Handler." msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -625,28 +648,18 @@ msgstr "" 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/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -819,13 +832,6 @@ msgstr "" msgid "Length must be non-negative" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "" @@ -840,11 +846,11 @@ msgid "Maximum x value when mirrored is %d" msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" +msgid "MicroPython fatal error." msgstr "" #: shared-bindings/audiobusio/PDMIn.c @@ -913,6 +919,10 @@ msgstr "" msgid "No such file/directory" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1091,10 +1101,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" #: supervisor/shared/safe_mode.c @@ -1105,18 +1112,11 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"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 "" -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" - #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" msgstr "" @@ -1149,10 +1149,6 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -1231,6 +1227,10 @@ msgstr "" 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" @@ -1301,8 +1301,7 @@ msgid "" msgstr "" #: supervisor/shared/safe_mode.c -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" +msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" #: supervisor/shared/safe_mode.c diff --git a/locale/es.po b/locale/es.po index b5c375481c..7ced099be5 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -25,6 +25,19 @@ msgstr "" "\n" "El código terminó su ejecución. Esperando para recargar.\n" +#: 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 "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr " Archivo \"%q\"" @@ -296,10 +309,8 @@ msgid "Array values should be single bytes." msgstr "Valores del array deben ser bytes individuales." #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" +msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" -"Intento de allocation de heap cuando la VM de MicroPython no estaba " -"corriendo.\n" #: main.c msgid "Auto-reload is off.\n" @@ -452,6 +463,16 @@ msgstr "No se puede escribir sin pin MOSI." msgid "CharacteristicBuffer writing not provided" msgstr "CharateristicBuffer escritura no proporcionada" +#: 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 "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Clock pin init fallido" @@ -513,8 +534,8 @@ msgid "Couldn't allocate second buffer" msgstr "No se pudo asignar el segundo buffer" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" -msgstr "Choque en el HardFault_Handler.\n" +msgid "Crash into the HardFault_Handler." +msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -629,28 +650,18 @@ msgstr "" msgid "Failed to release mutex, err 0x%04x" msgstr "No se puede liberar el mutex, err 0x%04x" +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + #: py/moduerrno.c msgid "File exists" msgstr "El archivo ya existe" -#: ports/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "Falló borrado de flash" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "Falló el iniciar borrado de flash, err 0x%04x" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "Falló la escritura" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "Falló el iniciar la escritura de flash, err 0x%04x" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "Frecuencia capturada por encima de la capacidad. Captura en pausa." @@ -825,17 +836,6 @@ msgstr "Length debe ser un int" msgid "Length must be non-negative" msgstr "Longitud no deberia ser negativa" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" -"Parece que nuestro código de CircuitPython ha fallado con fuerza. Whoops!\n" -"Por favor, crea un issue en https://github.com/adafruit/circuitpython/" -"issues\n" -" con el contenido de su unidad CIRCUITPY y este mensaje:\n" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "MISO pin init fallido." @@ -850,12 +850,12 @@ msgid "Maximum x value when mirrored is %d" msgstr "Valor máximo de x cuando se refleja es %d" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" -msgstr "MicroPython NLR salto fallido. Probable corrupción de memoria.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." +msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" -msgstr "Error fatal de MicroPython.\n" +msgid "MicroPython fatal error." +msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" @@ -923,6 +923,10 @@ msgstr "No queda espacio en el dispositivo" msgid "No such file/directory" msgstr "No existe el archivo/directorio" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1112,17 +1116,8 @@ msgstr "A Stream le falta el método readinto() o write()." #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" -"El heap de CircuitPython estaba corrupto porque el stack era demasiado " -"pequeño.\n" -"Aumente los límites del tamaño del stacj y presione reset (después de " -"expulsarCIRCUITPY).\n" -"Si no cambió el stack, entonces reporte un issue aquí con el contenido desu " -"unidad CIRCUITPY:\n" #: supervisor/shared/safe_mode.c msgid "" @@ -1132,23 +1127,10 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"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 "" -"La alimentación del microcontrolador cayó. Por favor asegurate de que tu " -"fuente de alimentación provee\n" -"suficiente energia para todo el circuito y presiona el botón de reset " -"(despuesde expulsar CIRCUITPY).\n" - -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" -"El botón reset fue presionado mientras arrancaba CircuitPython. Presiona " -"otra vez para salir del modo seguro.\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -1182,10 +1164,6 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "Ancho del Tile debe dividir exactamente el ancho de mapa de bits" -#: supervisor/shared/safe_mode.c -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 msgid "Too many channels in sample." msgstr "Demasiados canales en sample." @@ -1264,6 +1242,10 @@ msgstr "Tipo de uuid nrfx inesperado" 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" @@ -1341,11 +1323,8 @@ msgstr "" "Para listar los módulos incorporados por favor haga `help(\"modules\")`.\n" #: supervisor/shared/safe_mode.c -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" +msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" -"Estás ejecutando en modo seguro, lo cual significa que algo realmente malo " -"ha sucedido.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -2702,6 +2681,11 @@ msgstr "paso cero" #~ msgid "Address is not %d bytes long or is in wrong format" #~ msgstr "Direción no es %d bytes largo o esta en el formato incorrecto" +#~ msgid "Attempted heap allocation when MicroPython VM not running.\n" +#~ msgstr "" +#~ "Intento de allocation de heap cuando la VM de MicroPython no estaba " +#~ "corriendo.\n" + #~ msgid "Can't add services in Central mode" #~ msgstr "No se pueden agregar servicio en modo Central" @@ -2735,6 +2719,9 @@ msgstr "paso cero" #~ msgid "Could not decode ble_uuid, err 0x%04x" #~ msgstr "No se puede descodificar ble_uuid, err 0x%04x" +#~ msgid "Crash into the HardFault_Handler.\n" +#~ msgstr "Choque en el HardFault_Handler.\n" + #, fuzzy #~ msgid "Data too large for the advertisement packet" #~ msgstr "Los datos no caben en el paquete de anuncio." @@ -2849,6 +2836,15 @@ msgstr "paso cero" #~ msgid "Failed to write gatts value, err 0x%04x" #~ msgstr "No se puede escribir el valor del atributo. err: 0x%04x" +#~ msgid "Flash erase failed" +#~ msgstr "Falló borrado de flash" + +#~ msgid "Flash erase failed to start, err 0x%04x" +#~ msgstr "Falló el iniciar borrado de flash, err 0x%04x" + +#~ msgid "Flash write failed to start, err 0x%04x" +#~ msgstr "Falló el iniciar la escritura de flash, err 0x%04x" + #~ msgid "Function requires lock." #~ msgstr "La función requiere lock" @@ -2864,9 +2860,26 @@ msgstr "paso cero" #~ msgid "Invalid data pin" #~ msgstr "Pin de datos inválido" +#~ msgid "" +#~ "Looks like our core CircuitPython code crashed hard. Whoops!\n" +#~ "Please file an issue at https://github.com/adafruit/circuitpython/issues\n" +#~ " with the contents of your CIRCUITPY drive and this message:\n" +#~ msgstr "" +#~ "Parece que nuestro código de CircuitPython ha fallado con fuerza. " +#~ "Whoops!\n" +#~ "Por favor, crea un issue en https://github.com/adafruit/circuitpython/" +#~ "issues\n" +#~ " con el contenido de su unidad CIRCUITPY y este mensaje:\n" + #~ msgid "Maximum PWM frequency is %dhz." #~ msgstr "La frecuencia máxima del PWM es %dhz." +#~ msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +#~ msgstr "MicroPython NLR salto fallido. Probable corrupción de memoria.\n" + +#~ msgid "MicroPython fatal error.\n" +#~ msgstr "Error fatal de MicroPython.\n" + #~ msgid "Minimum PWM frequency is 1hz." #~ msgstr "La frecuencia mínima del PWM es 1hz" @@ -2926,9 +2939,44 @@ msgstr "paso cero" #~ msgid "Soft device assert, id: 0x%08lX, pc: 0x%08lX" #~ msgstr "Soft device assert, id: 0x%08lX, pc: 0x%08lX" +#~ msgid "" +#~ "The CircuitPython heap was corrupted because the stack was too small.\n" +#~ "Please increase stack size limits and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ "If you didn't change the stack, then file an issue here with the contents " +#~ "of your CIRCUITPY drive:\n" +#~ msgstr "" +#~ "El heap de CircuitPython estaba corrupto porque el stack era demasiado " +#~ "pequeño.\n" +#~ "Aumente los límites del tamaño del stacj y presione reset (después de " +#~ "expulsarCIRCUITPY).\n" +#~ "Si no cambió el stack, entonces reporte un issue aquí con el contenido " +#~ "desu unidad CIRCUITPY:\n" + +#~ msgid "" +#~ "The microcontroller's power dipped. Please make sure your power supply " +#~ "provides\n" +#~ "enough power for the whole circuit and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ msgstr "" +#~ "La alimentación del microcontrolador cayó. Por favor asegurate de que tu " +#~ "fuente de alimentación provee\n" +#~ "suficiente energia para todo el circuito y presiona el botón de reset " +#~ "(despuesde expulsar CIRCUITPY).\n" + +#~ msgid "" +#~ "The reset button was pressed while booting CircuitPython. Press again to " +#~ "exit safe mode.\n" +#~ msgstr "" +#~ "El botón reset fue presionado mientras arrancaba CircuitPython. Presiona " +#~ "otra vez para salir del modo seguro.\n" + #~ msgid "Tile indices must be 0 - 255" #~ msgstr "Los índices de Tile deben ser 0 - 255" +#~ msgid "To exit, please reset the board without " +#~ msgstr "Para salir, por favor reinicia la tarjeta sin " + #~ msgid "UART(%d) does not exist" #~ msgstr "UART(%d) no existe" @@ -2951,6 +2999,13 @@ msgstr "paso cero" #~ msgid "Voice index too high" #~ msgstr "Index de voz demasiado alto" +#~ msgid "" +#~ "You are running in safe mode which means something unanticipated " +#~ "happened.\n" +#~ msgstr "" +#~ "Estás ejecutando en modo seguro, lo cual significa que algo realmente " +#~ "malo ha sucedido.\n" + #~ msgid "bad GATT role" #~ msgstr "mal GATT role" diff --git a/locale/fil.po b/locale/fil.po index ba20e69b81..16fac72244 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -23,6 +23,19 @@ msgid "" "Code done running. Waiting for 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 "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr " File \"%q\"" @@ -296,7 +309,7 @@ msgid "Array values should be single bytes." msgstr "Array values ay dapat single bytes." #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" +msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" #: main.c @@ -452,6 +465,16 @@ msgstr "Hindi maaring isulat kapag walang MOSI pin." 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 "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Nabigo sa pag init ng Clock pin." @@ -514,8 +537,8 @@ msgid "Couldn't allocate second buffer" msgstr "Hindi ma-iallocate ang second buffer" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" -msgstr "Nagcrash sa HardFault_Handler.\n" +msgid "Crash into the HardFault_Handler." +msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -635,28 +658,18 @@ msgstr "" msgid "Failed to release mutex, err 0x%04x" msgstr "Nabigo sa pagrelease ng mutex, status: 0x%08lX" +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + #: py/moduerrno.c msgid "File exists" msgstr "Mayroong file" -#: ports/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -831,17 +844,6 @@ msgstr "Haba ay dapat int" msgid "Length must be non-negative" msgstr "Haba ay dapat hindi negatibo" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" -"Mukhang ang core CircuitPython code nag crash. Ay!\n" -"Maaring mag file ng issue sa https://github.com/adafruit/circuitpython/" -"issues\n" -"kasama ng laman ng iyong CIRCUITPY drive at ang message na ito:\n" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "Hindi ma-initialize ang MISO pin." @@ -856,12 +858,12 @@ msgid "Maximum x value when mirrored is %d" msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" -msgstr "CircuitPython NLR jump nabigo. Maaring memory corruption.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." +msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" -msgstr "CircuitPython fatal na pagkakamali.\n" +msgid "MicroPython fatal error." +msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" @@ -929,6 +931,10 @@ msgstr "" msgid "No such file/directory" msgstr "Walang file/directory" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c #, fuzzy @@ -1116,16 +1122,8 @@ msgstr "Stream kulang ng readinto() o write() method." #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" -"Ang CircuitPython heap ay na corrupt dahil ang stack ay maliit.\n" -"Maaring i-increase ang stack size limit at i-press ang reset (pagkatapos i-" -"eject ang CIRCUITPY.\n" -"Kung hindi mo pinalitan ang stack, mag file ng issue dito kasama ng laman ng " -"CIRCUITPY drive:\n" #: supervisor/shared/safe_mode.c msgid "" @@ -1135,22 +1133,10 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"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 "" -"Ang kapangyarihan ng mikrokontroller ay bumaba. Mangyaring suriin ang power " -"supply \n" -"pindutin ang reset (pagkatapos i-eject ang CIRCUITPY).\n" - -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" -"Ang reset button ay pinindot habang nag boot ang CircuitPython. Pindutin " -"ulit para lumabas sa safe mode.\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -1184,10 +1170,6 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "" -#: supervisor/shared/safe_mode.c -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 msgid "Too many channels in sample." msgstr "Sobra ang channels sa sample." @@ -1267,6 +1249,10 @@ msgstr "hindi inaasahang indent" 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" @@ -1346,9 +1332,8 @@ msgstr "" "Para makita ang listahan ng modules, `help(“modules”)`.\n" #: supervisor/shared/safe_mode.c -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" -msgstr "Ikaw ay tumatakbo sa safe mode dahil may masamang nangyari.\n" +msgid "You are in safe mode: something unanticipated happened.\n" +msgstr "" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -2735,6 +2720,9 @@ msgstr "zero step" #~ msgid "Cannot update i/f status" #~ msgstr "Hindi ma-update i/f status" +#~ msgid "Crash into the HardFault_Handler.\n" +#~ msgstr "Nagcrash sa HardFault_Handler.\n" + #, fuzzy #~ msgid "Data too large for the advertisement packet" #~ msgstr "Hindi makasya ang data sa loob ng advertisement packet" @@ -2871,9 +2859,25 @@ msgstr "zero step" #~ msgid "Invalid data pin" #~ msgstr "Mali ang data pin" +#~ msgid "" +#~ "Looks like our core CircuitPython code crashed hard. Whoops!\n" +#~ "Please file an issue at https://github.com/adafruit/circuitpython/issues\n" +#~ " with the contents of your CIRCUITPY drive and this message:\n" +#~ msgstr "" +#~ "Mukhang ang core CircuitPython code nag crash. Ay!\n" +#~ "Maaring mag file ng issue sa https://github.com/adafruit/circuitpython/" +#~ "issues\n" +#~ "kasama ng laman ng iyong CIRCUITPY drive at ang message na ito:\n" + #~ msgid "Maximum PWM frequency is %dhz." #~ msgstr "Pinakamataas na PWM frequency ay %dhz." +#~ msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +#~ msgstr "CircuitPython NLR jump nabigo. Maaring memory corruption.\n" + +#~ msgid "MicroPython fatal error.\n" +#~ msgstr "CircuitPython fatal na pagkakamali.\n" + #~ msgid "Minimum PWM frequency is 1hz." #~ msgstr "Pinakamababang PWM frequency ay 1hz." @@ -2918,6 +2922,39 @@ msgstr "zero step" #~ msgid "STA required" #~ msgstr "STA kailangan" +#~ msgid "" +#~ "The CircuitPython heap was corrupted because the stack was too small.\n" +#~ "Please increase stack size limits and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ "If you didn't change the stack, then file an issue here with the contents " +#~ "of your CIRCUITPY drive:\n" +#~ msgstr "" +#~ "Ang CircuitPython heap ay na corrupt dahil ang stack ay maliit.\n" +#~ "Maaring i-increase ang stack size limit at i-press ang reset (pagkatapos " +#~ "i-eject ang CIRCUITPY.\n" +#~ "Kung hindi mo pinalitan ang stack, mag file ng issue dito kasama ng laman " +#~ "ng CIRCUITPY drive:\n" + +#~ msgid "" +#~ "The microcontroller's power dipped. Please make sure your power supply " +#~ "provides\n" +#~ "enough power for the whole circuit and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ msgstr "" +#~ "Ang kapangyarihan ng mikrokontroller ay bumaba. Mangyaring suriin ang " +#~ "power supply \n" +#~ "pindutin ang reset (pagkatapos i-eject ang CIRCUITPY).\n" + +#~ msgid "" +#~ "The reset button was pressed while booting CircuitPython. Press again to " +#~ "exit safe mode.\n" +#~ msgstr "" +#~ "Ang reset button ay pinindot habang nag boot ang CircuitPython. Pindutin " +#~ "ulit para lumabas sa safe mode.\n" + +#~ msgid "To exit, please reset the board without " +#~ msgstr "Para lumabas, paki-reset ang board na wala ang " + #~ msgid "UART(%d) does not exist" #~ msgstr "Walang UART(%d)" @@ -2937,6 +2974,11 @@ msgstr "zero step" #~ msgid "Voice index too high" #~ msgstr "Index ng Voice ay masyadong mataas" +#~ msgid "" +#~ "You are running in safe mode which means something unanticipated " +#~ "happened.\n" +#~ msgstr "Ikaw ay tumatakbo sa safe mode dahil may masamang nangyari.\n" + #~ msgid "[addrinfo error %d]" #~ msgstr "[addrinfo error %d]" diff --git a/locale/fr.po b/locale/fr.po index e103cd06d2..9762b5e7da 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -25,6 +25,19 @@ msgstr "" "\n" "Fin d'éxecution du code. En attente de recharge.\n" +#: 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 "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr " Fichier \"%q\"" @@ -300,9 +313,8 @@ msgid "Array values should be single bytes." msgstr "Les valeurs du tableau doivent être des octets simples 'bytes'." #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" +msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" -"Tentative d'allocation de tas alors que la VM MicroPython ne tourne pas.\n" #: main.c msgid "Auto-reload is off.\n" @@ -458,6 +470,16 @@ msgstr "Impossible d'écrire sans broche MOSI." msgid "CharacteristicBuffer writing not provided" msgstr "Ecriture sur 'CharacteristicBuffer' non fournie" +#: 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 "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Echec de l'init. de la broche d'horloge" @@ -520,8 +542,8 @@ msgid "Couldn't allocate second buffer" msgstr "Impossible d'allouer le 2e tampon" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" -msgstr "Plantage vers le 'HardFault_Handler'.\n" +msgid "Crash into the HardFault_Handler." +msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -639,28 +661,18 @@ msgstr "" msgid "Failed to release mutex, err 0x%04x" msgstr "Impossible de libérer mutex, err 0x%04x" +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + #: py/moduerrno.c msgid "File exists" msgstr "Le fichier existe" -#: ports/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "L'effacement de la flash a échoué" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "Echec du démarrage de l'effacement de la flash, err 0x%04x" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "L'écriture de la flash échoué" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "Echec du démarrage de l'écriture de la flash, err 0x%04x" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "La fréquence capturée est au delà des capacités. Capture en pause." @@ -839,17 +851,6 @@ msgstr "La longueur doit être un nombre entier" msgid "Length must be non-negative" msgstr "La longueur ne doit pas être négative" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" -"On dirait que notre code CircuitPython a durement planté. Oups !\n" -"Merci de remplir un ticket sur https://github.com/adafruit/circuitpython/" -"issues\n" -"avec le contenu de votre lecteur CIRCUITPY et ce message:\n" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "Echec de l'init. de la broche MISO" @@ -864,12 +865,12 @@ msgid "Maximum x value when mirrored is %d" msgstr "La valeur max. de x est %d lors d'une opération miroir" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" -msgstr "Saut MicroPython NLR a échoué. Corruption de mémoire possible.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." +msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" -msgstr "Erreur fatale de MicroPython.\n" +msgid "MicroPython fatal error." +msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" @@ -937,6 +938,10 @@ msgstr "Il n'y a plus d'espace libre sur le périphérique" msgid "No such file/directory" msgstr "Fichier/dossier introuvable" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c #, fuzzy @@ -1131,17 +1136,8 @@ msgstr "Il manque une méthode readinto() ou write() au flux." #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" -"Le tas (heap) de CircuitPython a été corrompu parce que la pile était trop " -"petite.\n" -"Augmentez la limite de taille de la pile et appuyez sur 'reset' (après avoir " -"éjecté CIRCUITPY).\n" -"Si vous n'avez pas modifié la pile, merci de remplir un ticket avec le " -"contenu de votre lecteur CIRCUITPY :\n" #: supervisor/shared/safe_mode.c msgid "" @@ -1150,25 +1146,11 @@ msgid "" msgstr "" #: supervisor/shared/safe_mode.c -#, fuzzy msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"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 "" -"L'alimentation du microcontroleur a chuté. Merci de vérifier que votre " -"alimentation fournit\n" -"suffisamment de puissance pour l'ensemble du circuit et appuyez sur " -"'reset' (après avoir éjecté CIRCUITPY).\n" - -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" -"Le bouton 'reset' a été appuyé pendant le démarrage de CircuitPython. " -"Appuyer de nouveau pour quitter de le mode sans-échec.\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -1203,10 +1185,6 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "La largeur de la tuile doit diviser exactement la largeur de l'image" -#: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "Pour quitter, redémarrez la carte SVP sans " - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Trop de canaux dans l'échantillon." @@ -1289,6 +1267,10 @@ msgstr "Type inattendu pour l'uuid nrfx" 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" @@ -1367,11 +1349,8 @@ msgstr "" "Pour lister les modules inclus, tapez `help(\"modules\")`.\n" #: supervisor/shared/safe_mode.c -#, fuzzy -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" +msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" -"Vous êtes en mode sans-échec ce qui signifie qu'un imprévu est survenu.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -2753,6 +2732,10 @@ msgstr "'step' nul" #~ msgid "Address is not %d bytes long or is in wrong format" #~ msgstr "L'adresse n'est pas longue de %d octets ou est d'un format erroné" +#~ msgid "Attempted heap allocation when MicroPython VM not running.\n" +#~ msgstr "" +#~ "Tentative d'allocation de tas alors que la VM MicroPython ne tourne pas.\n" + #~ msgid "Can't add services in Central mode" #~ msgstr "Impossible d'ajouter des services en mode Central" @@ -2786,6 +2769,9 @@ msgstr "'step' nul" #~ msgid "Could not decode ble_uuid, err 0x%04x" #~ msgstr "Impossible de décoder le 'ble_uuid', err 0x%04x" +#~ msgid "Crash into the HardFault_Handler.\n" +#~ msgstr "Plantage vers le 'HardFault_Handler'.\n" + #~ msgid "Data too large for the advertisement packet" #~ msgstr "Données trop volumineuses pour le paquet de diffusion" @@ -2912,6 +2898,15 @@ msgstr "'step' nul" #~ msgid "Failed to write gatts value, err 0x%04x" #~ msgstr "Impossible d'écrire la valeur de 'gatts', err 0x%04x" +#~ msgid "Flash erase failed" +#~ msgstr "L'effacement de la flash a échoué" + +#~ msgid "Flash erase failed to start, err 0x%04x" +#~ msgstr "Echec du démarrage de l'effacement de la flash, err 0x%04x" + +#~ msgid "Flash write failed to start, err 0x%04x" +#~ msgstr "Echec du démarrage de l'écriture de la flash, err 0x%04x" + #~ msgid "Function requires lock." #~ msgstr "La fonction nécessite un verrou." @@ -2927,9 +2922,25 @@ msgstr "'step' nul" #~ msgid "Invalid data pin" #~ msgstr "Broche de données invalide" +#~ msgid "" +#~ "Looks like our core CircuitPython code crashed hard. Whoops!\n" +#~ "Please file an issue at https://github.com/adafruit/circuitpython/issues\n" +#~ " with the contents of your CIRCUITPY drive and this message:\n" +#~ msgstr "" +#~ "On dirait que notre code CircuitPython a durement planté. Oups !\n" +#~ "Merci de remplir un ticket sur https://github.com/adafruit/circuitpython/" +#~ "issues\n" +#~ "avec le contenu de votre lecteur CIRCUITPY et ce message:\n" + #~ msgid "Maximum PWM frequency is %dhz." #~ msgstr "La fréquence de PWM maximale est %dHz" +#~ msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +#~ msgstr "Saut MicroPython NLR a échoué. Corruption de mémoire possible.\n" + +#~ msgid "MicroPython fatal error.\n" +#~ msgstr "Erreur fatale de MicroPython.\n" + #~ msgid "Minimum PWM frequency is 1hz." #~ msgstr "La fréquence de PWM minimale est 1Hz" @@ -2986,9 +2997,45 @@ msgstr "'step' nul" #~ msgid "Soft device assert, id: 0x%08lX, pc: 0x%08lX" #~ msgstr "Assertion en mode 'soft-device', id: 0x%08lX, pc: 0x%08lX" +#~ msgid "" +#~ "The CircuitPython heap was corrupted because the stack was too small.\n" +#~ "Please increase stack size limits and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ "If you didn't change the stack, then file an issue here with the contents " +#~ "of your CIRCUITPY drive:\n" +#~ msgstr "" +#~ "Le tas (heap) de CircuitPython a été corrompu parce que la pile était " +#~ "trop petite.\n" +#~ "Augmentez la limite de taille de la pile et appuyez sur 'reset' (après " +#~ "avoir éjecté CIRCUITPY).\n" +#~ "Si vous n'avez pas modifié la pile, merci de remplir un ticket avec le " +#~ "contenu de votre lecteur CIRCUITPY :\n" + +#, fuzzy +#~ msgid "" +#~ "The microcontroller's power dipped. Please make sure your power supply " +#~ "provides\n" +#~ "enough power for the whole circuit and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ msgstr "" +#~ "L'alimentation du microcontroleur a chuté. Merci de vérifier que votre " +#~ "alimentation fournit\n" +#~ "suffisamment de puissance pour l'ensemble du circuit et appuyez sur " +#~ "'reset' (après avoir éjecté CIRCUITPY).\n" + +#~ msgid "" +#~ "The reset button was pressed while booting CircuitPython. Press again to " +#~ "exit safe mode.\n" +#~ msgstr "" +#~ "Le bouton 'reset' a été appuyé pendant le démarrage de CircuitPython. " +#~ "Appuyer de nouveau pour quitter de le mode sans-échec.\n" + #~ msgid "Tile indices must be 0 - 255" #~ msgstr "Les indices des tuiles doivent être compris entre 0 et 255 " +#~ msgid "To exit, please reset the board without " +#~ msgstr "Pour quitter, redémarrez la carte SVP sans " + #~ msgid "UART(%d) does not exist" #~ msgstr "UART(%d) n'existe pas" @@ -3011,6 +3058,13 @@ msgstr "'step' nul" #~ msgid "Voice index too high" #~ msgstr "Index de la voix trop grand" +#, fuzzy +#~ msgid "" +#~ "You are running in safe mode which means something unanticipated " +#~ "happened.\n" +#~ msgstr "" +#~ "Vous êtes en mode sans-échec ce qui signifie qu'un imprévu est survenu.\n" + #~ msgid "bad GATT role" #~ msgstr "mauvais rôle GATT" diff --git a/locale/it_IT.po b/locale/it_IT.po index c1a445fa24..0a3c30d2bd 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -23,6 +23,19 @@ msgid "" "Code done running. Waiting for 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 "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr " File \"%q\"" @@ -295,7 +308,7 @@ msgid "Array values should be single bytes." msgstr "Valori di Array dovrebbero essere bytes singulari" #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" +msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" #: main.c @@ -453,6 +466,16 @@ msgstr "Impossibile scrivere senza pin MOSI." msgid "CharacteristicBuffer writing not provided" msgstr "CharacteristicBuffer scritura non dato" +#: 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 "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Inizializzazione del pin di clock fallita." @@ -515,7 +538,7 @@ msgid "Couldn't allocate second buffer" msgstr "Impossibile allocare il secondo buffer" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" +msgid "Crash into the HardFault_Handler." msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -635,28 +658,18 @@ msgstr "" msgid "Failed to release mutex, err 0x%04x" msgstr "Impossibile leggere valore dell'attributo. status: 0x%02x" +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + #: py/moduerrno.c msgid "File exists" msgstr "File esistente" -#: ports/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "Cancellamento di Flash fallito" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "Iniziamento di Cancellamento di Flash fallito, err 0x%04x" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "Impostazione di Flash fallito" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "Iniziamento di Impostazione di Flash dallito, err 0x%04x" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -834,13 +847,6 @@ msgstr "Length deve essere un intero" msgid "Length must be non-negative" msgstr "Length deve essere non negativo" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "inizializzazione del pin MISO fallita." @@ -855,12 +861,12 @@ msgid "Maximum x value when mirrored is %d" msgstr "Valore massimo di x quando rispachiato è %d" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" -msgstr "Errore fatale in MicroPython.\n" +msgid "MicroPython fatal error." +msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" @@ -929,6 +935,10 @@ msgstr "Non che spazio sul dispositivo" msgid "No such file/directory" msgstr "Nessun file/directory esistente" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c #, fuzzy @@ -1123,10 +1133,7 @@ msgstr "Metodi mancanti readinto() o write() allo stream." #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" #: supervisor/shared/safe_mode.c @@ -1136,21 +1143,11 @@ msgid "" msgstr "" #: supervisor/shared/safe_mode.c -#, fuzzy msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"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 "" -"La potenza del microcontrollore è calata. Assicurati che l'alimentazione sia " -"attaccata correttamente\n" - -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -1184,10 +1181,6 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "Per uscire resettare la scheda senza " - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -1267,6 +1260,10 @@ msgstr "indentazione inaspettata" 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" @@ -1338,12 +1335,8 @@ msgid "" msgstr "" #: supervisor/shared/safe_mode.c -#, fuzzy -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" +msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" -"Sei nella modalità sicura che significa che qualcosa di molto brutto è " -"successo.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -2862,6 +2855,15 @@ msgstr "zero step" #~ msgid "Failed to write gatts value, err 0x%04x" #~ msgstr "Impossibile scrivere valore dell'attributo. status: 0x%02x" +#~ msgid "Flash erase failed" +#~ msgstr "Cancellamento di Flash fallito" + +#~ msgid "Flash erase failed to start, err 0x%04x" +#~ msgstr "Iniziamento di Cancellamento di Flash fallito, err 0x%04x" + +#~ msgid "Flash write failed to start, err 0x%04x" +#~ msgstr "Iniziamento di Impostazione di Flash dallito, err 0x%04x" + #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 non supporta pull-up" @@ -2877,6 +2879,9 @@ msgstr "zero step" #~ msgid "Maximum PWM frequency is %dhz." #~ msgstr "Frequenza massima su PWM è %dhz" +#~ msgid "MicroPython fatal error.\n" +#~ msgstr "Errore fatale in MicroPython.\n" + #~ msgid "Minimum PWM frequency is 1hz." #~ msgstr "Frequenza minima su PWM è 1hz" @@ -2922,6 +2927,19 @@ msgstr "zero step" #~ msgid "STA required" #~ msgstr "STA richiesta" +#, fuzzy +#~ msgid "" +#~ "The microcontroller's power dipped. Please make sure your power supply " +#~ "provides\n" +#~ "enough power for the whole circuit and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ msgstr "" +#~ "La potenza del microcontrollore è calata. Assicurati che l'alimentazione " +#~ "sia attaccata correttamente\n" + +#~ msgid "To exit, please reset the board without " +#~ msgstr "Per uscire resettare la scheda senza " + #~ msgid "UART(%d) does not exist" #~ msgstr "UART(%d) non esistente" @@ -2937,6 +2955,14 @@ msgstr "zero step" #~ msgid "Use esptool to erase flash and re-upload Python instead" #~ msgstr "Usa esptool per cancellare la flash e ricaricare Python invece" +#, fuzzy +#~ msgid "" +#~ "You are running in safe mode which means something unanticipated " +#~ "happened.\n" +#~ msgstr "" +#~ "Sei nella modalità sicura che significa che qualcosa di molto brutto è " +#~ "successo.\n" + #~ msgid "[addrinfo error %d]" #~ msgstr "[errore addrinfo %d]" diff --git a/locale/ko.po b/locale/ko.po index 93a476b876..78f0c756b1 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -25,6 +25,19 @@ msgstr "" "\n" "실행 완료 코드. 재장전 을 기다리는 중입니다\n" +#: 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 "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr " 파일 \"%q\"" @@ -294,7 +307,7 @@ msgid "Array values should be single bytes." msgstr "" #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" +msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" #: main.c @@ -448,6 +461,16 @@ msgstr "" 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 "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "" @@ -509,7 +532,7 @@ msgid "Couldn't allocate second buffer" msgstr "" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" +msgid "Crash into the HardFault_Handler." msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -625,28 +648,18 @@ msgstr "" 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/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -819,13 +832,6 @@ msgstr "길이는 정수(int) 여야합니다" msgid "Length must be non-negative" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "" @@ -840,11 +846,11 @@ msgid "Maximum x value when mirrored is %d" msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" +msgid "MicroPython fatal error." msgstr "" #: shared-bindings/audiobusio/PDMIn.c @@ -913,6 +919,10 @@ msgstr "" msgid "No such file/directory" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1091,10 +1101,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" #: supervisor/shared/safe_mode.c @@ -1105,18 +1112,11 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"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 "" -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" - #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" msgstr "" @@ -1149,10 +1149,6 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -1232,6 +1228,10 @@ msgstr "" 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" @@ -1302,8 +1302,7 @@ msgid "" msgstr "" #: supervisor/shared/safe_mode.c -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" +msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" #: supervisor/shared/safe_mode.c diff --git a/locale/pl.po b/locale/pl.po index 8efab18675..60aac45a3f 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -24,6 +24,19 @@ msgstr "" "\n" "Kod wykonany. Czekam na przeładowanie.\n" +#: 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 "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr " Plik \"%q\"" @@ -293,8 +306,8 @@ msgid "Array values should be single bytes." msgstr "Wartości powinny być bajtami." #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" -msgstr "Próba alokacji pamięci na stercie gdy VM nie działa.\n" +msgid "Attempted heap allocation when MicroPython VM not running." +msgstr "" #: main.c msgid "Auto-reload is off.\n" @@ -447,6 +460,16 @@ msgstr "Nie można pisać bez nóżki MOSI." msgid "CharacteristicBuffer writing not provided" msgstr "Pisanie do CharacteristicBuffer niewspierane" +#: 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 "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Nie powiodło się ustawienie nóżki zegara" @@ -508,8 +531,8 @@ msgid "Couldn't allocate second buffer" msgstr "Nie udała się alokacja drugiego bufora" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" -msgstr "Katastrofa w HardFault_Handler.\n" +msgid "Crash into the HardFault_Handler." +msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -624,28 +647,18 @@ msgstr "" msgid "Failed to release mutex, err 0x%04x" msgstr "Nie udało się zwolnić blokady, błąd 0x%04x" +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + #: py/moduerrno.c msgid "File exists" msgstr "Plik istnieje" -#: ports/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "Nie udało się skasować flash" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "Nie udało się rozpocząć kasowania flash, błąd 0x%04x" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "Zapis do flash nie powiódł się" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "Nie udało się rozpocząć zapisu do flash, błąd 0x%04x" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "Uzyskana częstotliwość jest niemożliwa. Spauzowano." @@ -820,17 +833,6 @@ msgstr "Długość musi być całkowita" msgid "Length must be non-negative" msgstr "Długość musi być nieujemna" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" -"Ojej, wygląda na to, że CircuitPython natrafił na poważny problem!\n" -"Prosimy o zgłoszenie błędu pod adresem https://github.com/adafruit/" -"circuitpython/issues\n" -" z zawartością dysku CIRCUITPY oraz tym komunikatem:\n" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "Nie powiodło się ustawienie nóżki MISO." @@ -845,13 +847,12 @@ msgid "Maximum x value when mirrored is %d" msgstr "Największa wartość x przy odwróceniu to %d" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" -"Skok NLR MicroPythona nie powiódł się. Prawdopodobne skażenie pamięci.\n" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" -msgstr "Krytyczny błąd MicroPythona.\n" +msgid "MicroPython fatal error." +msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" @@ -919,6 +920,10 @@ msgstr "Brak miejsca" msgid "No such file/directory" msgstr "Brak pliku/katalogu" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1097,16 +1102,8 @@ msgstr "Strumień nie ma metod readinto() lub write()." #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" -"Sterta CircuitPythona jest skażona z powodu zbyt małego stosu.\n" -"Proszę zwiększyć limity wielkości stosu i nazisnąć reset (po odmontowaniu " -"CIRCUITPY).\n" -"Jeśli wielkość stosu nie była zmieniana, proszę zgłosić błąd zawierający " -"zawartość CIRCUITPY tutaj:\n" #: supervisor/shared/safe_mode.c msgid "" @@ -1116,22 +1113,10 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"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 "" -"Zasilanie mikrokontrolera gwałtownie spadło. Proszę upewnić się,\n" -"że zasilanie jest wystarczające dla całego obwodu in nacisnąć reset (po " -"odmontowaniu CIRCUITPY).\n" - -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" -"Przycisk reset został wciśnięty podczas startu CircuitPythona. Wciśnij go " -"ponownie aby wyjść z trybu bezpieczeństwa.\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -1165,10 +1150,6 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "Szerokość bitmapy musi być wielokrotnością szerokości kafelka" -#: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "By wyjść, proszę zresetować płytkę bez " - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Zbyt wiele kanałów." @@ -1247,6 +1228,10 @@ msgstr "Nieoczekiwany typ nrfx uuid." 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" @@ -1320,10 +1305,8 @@ msgstr "" "Aby zobaczyć wbudowane moduły, wpisz `help(\"modules\")`.\n" #: supervisor/shared/safe_mode.c -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" +msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" -"Uruchomiono w trybie bezpieczeństwa, gdyż nastąpiło coś nieoczekiwanego.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -2660,6 +2643,9 @@ msgstr "zerowy krok" #~ msgid "Address is not %d bytes long or is in wrong format" #~ msgstr "Adres nie ma długości %d bajtów lub zły format" +#~ msgid "Attempted heap allocation when MicroPython VM not running.\n" +#~ msgstr "Próba alokacji pamięci na stercie gdy VM nie działa.\n" + #~ msgid "Can't add services in Central mode" #~ msgstr "Nie można dodać serwisów w trybie Central" @@ -2681,6 +2667,9 @@ msgstr "zerowy krok" #~ msgid "Could not decode ble_uuid, err 0x%04x" #~ msgstr "Nie można zdekodować ble_uuid, błąd 0x%04x" +#~ msgid "Crash into the HardFault_Handler.\n" +#~ msgstr "Katastrofa w HardFault_Handler.\n" + #~ msgid "Data too large for the advertisement packet" #~ msgstr "Zbyt dużo danych pakietu rozgłoszeniowego" @@ -2763,6 +2752,15 @@ msgstr "zerowy krok" #~ msgid "Failed to write gatts value, err 0x%04x" #~ msgstr "Nie udało się zapisać gatts, błąd 0x%04x" +#~ msgid "Flash erase failed" +#~ msgstr "Nie udało się skasować flash" + +#~ msgid "Flash erase failed to start, err 0x%04x" +#~ msgstr "Nie udało się rozpocząć kasowania flash, błąd 0x%04x" + +#~ msgid "Flash write failed to start, err 0x%04x" +#~ msgstr "Nie udało się rozpocząć zapisu do flash, błąd 0x%04x" + #~ msgid "Invalid bit clock pin" #~ msgstr "Zła nóżka zegara" @@ -2772,6 +2770,23 @@ msgstr "zerowy krok" #~ msgid "Invalid data pin" #~ msgstr "Zła nóżka danych" +#~ msgid "" +#~ "Looks like our core CircuitPython code crashed hard. Whoops!\n" +#~ "Please file an issue at https://github.com/adafruit/circuitpython/issues\n" +#~ " with the contents of your CIRCUITPY drive and this message:\n" +#~ msgstr "" +#~ "Ojej, wygląda na to, że CircuitPython natrafił na poważny problem!\n" +#~ "Prosimy o zgłoszenie błędu pod adresem https://github.com/adafruit/" +#~ "circuitpython/issues\n" +#~ " z zawartością dysku CIRCUITPY oraz tym komunikatem:\n" + +#~ msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +#~ msgstr "" +#~ "Skok NLR MicroPythona nie powiódł się. Prawdopodobne skażenie pamięci.\n" + +#~ msgid "MicroPython fatal error.\n" +#~ msgstr "Krytyczny błąd MicroPythona.\n" + #~ msgid "Must be a Group subclass." #~ msgstr "Musi dziedziczyć z Group." @@ -2783,15 +2798,54 @@ msgstr "zerowy krok" #~ msgid "Soft device assert, id: 0x%08lX, pc: 0x%08lX" #~ msgstr "Soft device assert, id: 0x%08lX, pc: 0x%08lX" +#~ msgid "" +#~ "The CircuitPython heap was corrupted because the stack was too small.\n" +#~ "Please increase stack size limits and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ "If you didn't change the stack, then file an issue here with the contents " +#~ "of your CIRCUITPY drive:\n" +#~ msgstr "" +#~ "Sterta CircuitPythona jest skażona z powodu zbyt małego stosu.\n" +#~ "Proszę zwiększyć limity wielkości stosu i nazisnąć reset (po odmontowaniu " +#~ "CIRCUITPY).\n" +#~ "Jeśli wielkość stosu nie była zmieniana, proszę zgłosić błąd zawierający " +#~ "zawartość CIRCUITPY tutaj:\n" + +#~ msgid "" +#~ "The microcontroller's power dipped. Please make sure your power supply " +#~ "provides\n" +#~ "enough power for the whole circuit and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ msgstr "" +#~ "Zasilanie mikrokontrolera gwałtownie spadło. Proszę upewnić się,\n" +#~ "że zasilanie jest wystarczające dla całego obwodu in nacisnąć reset (po " +#~ "odmontowaniu CIRCUITPY).\n" + +#~ msgid "" +#~ "The reset button was pressed while booting CircuitPython. Press again to " +#~ "exit safe mode.\n" +#~ msgstr "" +#~ "Przycisk reset został wciśnięty podczas startu CircuitPythona. Wciśnij go " +#~ "ponownie aby wyjść z trybu bezpieczeństwa.\n" + #~ msgid "Tile indices must be 0 - 255" #~ msgstr "Indeks kafelka musi być pomiędzy 0 a 255 włącznie" +#~ msgid "To exit, please reset the board without " +#~ msgstr "By wyjść, proszę zresetować płytkę bez " + #~ msgid "UUID integer value not in range 0 to 0xffff" #~ msgstr "Wartość UUID poza zakresem 0 do 0xffff" #~ msgid "Voice index too high" #~ msgstr "Zbyt wysoki indeks głosu" +#~ msgid "" +#~ "You are running in safe mode which means something unanticipated " +#~ "happened.\n" +#~ msgstr "" +#~ "Uruchomiono w trybie bezpieczeństwa, gdyż nastąpiło coś nieoczekiwanego.\n" + #~ msgid "bad GATT role" #~ msgstr "zła rola GATT" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 1ca6b7d9a5..0aa2ac6308 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -23,6 +23,19 @@ msgid "" "Code done running. Waiting for 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 "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr " Arquivo \"%q\"" @@ -295,7 +308,7 @@ msgid "Array values should be single bytes." msgstr "" #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" +msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" #: main.c @@ -449,6 +462,16 @@ msgstr "Não é possível ler sem um pino MOSI" 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 "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Inicialização do pino de Clock falhou." @@ -511,7 +534,7 @@ msgid "Couldn't allocate second buffer" msgstr "Não pôde alocar segundo buffer" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" +msgid "Crash into the HardFault_Handler." msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -630,28 +653,18 @@ msgstr "" msgid "Failed to release mutex, err 0x%04x" msgstr "Não é possível ler o valor do atributo. status: 0x%02x" +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + #: py/moduerrno.c msgid "File exists" msgstr "Arquivo já existe" -#: ports/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -827,13 +840,6 @@ msgstr "Tamanho deve ser um int" msgid "Length must be non-negative" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "Inicialização do pino MISO falhou" @@ -848,11 +854,11 @@ msgid "Maximum x value when mirrored is %d" msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" +msgid "MicroPython fatal error." msgstr "" #: shared-bindings/audiobusio/PDMIn.c @@ -921,6 +927,10 @@ msgstr "" msgid "No such file/directory" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c #, fuzzy @@ -1104,10 +1114,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" #: supervisor/shared/safe_mode.c @@ -1118,18 +1125,11 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"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 "" -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" - #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" msgstr "" @@ -1162,10 +1162,6 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "" -#: supervisor/shared/safe_mode.c -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 msgid "Too many channels in sample." msgstr "Muitos canais na amostra." @@ -1244,6 +1240,10 @@ msgstr "" 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" @@ -1315,8 +1315,7 @@ msgid "" msgstr "" #: supervisor/shared/safe_mode.c -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" +msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" #: supervisor/shared/safe_mode.c @@ -2837,6 +2836,9 @@ msgstr "passo zero" #~ msgid "STA required" #~ msgstr "STA requerido" +#~ msgid "To exit, please reset the board without " +#~ msgstr "Para sair, por favor, reinicie a placa sem " + #~ msgid "UART(%d) does not exist" #~ msgstr "UART(%d) não existe" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 40966090d4..bd5b80a724 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -25,6 +25,19 @@ msgstr "" "\n" "Dàimǎ yǐ wánchéng yùnxíng. Zhèngzài děngdài chóngxīn jiāzài.\n" +#: 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 "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr " Wénjiàn \"%q\"" @@ -294,8 +307,8 @@ msgid "Array values should be single bytes." msgstr "Shùzǔ zhí yīnggāi shì dāngè zì jié." #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" -msgstr "MicroPython VM wèi yùnxíng shí chángshì duī fēnpèi.\n" +msgid "Attempted heap allocation when MicroPython VM not running." +msgstr "" #: main.c msgid "Auto-reload is off.\n" @@ -448,6 +461,16 @@ msgstr "Wúfǎ xiě rù MOSI de yǐn jiǎo." msgid "CharacteristicBuffer writing not provided" msgstr "Wèi tígōng zìfú huǎncún xiě rù" +#: 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 "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Shízhōng de yǐn jiǎo chūshǐhuà shībài." @@ -509,8 +532,8 @@ msgid "Couldn't allocate second buffer" msgstr "Wúfǎ fēnpèi dì èr gè huǎnchōng qū" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" -msgstr "Bēngkuì dào HardFault_Handler.\n" +msgid "Crash into the HardFault_Handler." +msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -625,28 +648,18 @@ msgstr "" msgid "Failed to release mutex, err 0x%04x" msgstr "Wúfǎ shìfàng mutex, err 0x%04x" +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + #: py/moduerrno.c msgid "File exists" msgstr "Wénjiàn cúnzài" -#: ports/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "Flash cā chú shībài" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "Flash cā chú shībài, err 0x%04x" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "Flash xiě rù shībài" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "Flash xiě rù shībài, err 0x%04x" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "Pínlǜ bǔhuò gāo yú nénglì. Bǔhuò zàntíng." @@ -821,17 +834,6 @@ msgstr "Chángdù bìxū shì yīgè zhěngshù" msgid "Length must be non-negative" msgstr "Chángdù bìxū shìfēi fùshù" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" -"Kàn lái wǒmen de héxīn CircuitPython dàimǎ bēngkuì dé hěn lìhài. Āi yōu!\n" -"Qǐng zài https://Github.Com/adafruit/circuitpython/issues\n" -"shàng tíjiāo yīgè wèntí, qízhōng bāohán nín de CIRCUITPY qūdòngqì de nèiróng " -"hé cǐ xiāoxī:\n" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "MISO yǐn jiǎo chūshǐhuà shībài." @@ -846,12 +848,12 @@ msgid "Maximum x value when mirrored is %d" msgstr "Jìngxiàng shí de zuìdà X zhí wèi%d" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" -msgstr "MicroPython NLR tiàoyuè shībài. Kěnéng nèicún fǔbài.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." +msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" -msgstr "MicroPython zhìmìng cuòwù.\n" +msgid "MicroPython fatal error." +msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" @@ -919,6 +921,10 @@ msgstr "Shèbèi shàng méiyǒu kònggé" msgid "No such file/directory" msgstr "Méiyǒu cǐ lèi wénjiàn/mùlù" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1101,16 +1107,8 @@ msgstr "Liú quēshǎo readinto() huò write() fāngfǎ." #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" -"Yóuyú duīzhàn tài xiǎo, huánliú Python rè sǔnhuài.\n" -"Qǐng zēngjiā duīzhàn chǐcùn xiànzhì, ránhòu chóngxīn shèzhì (zài dànchū " -"CIRCUITPY).\n" -"Rúguǒ nín méiyǒu gǎibiàn duīzhàn, qǐng zài cǐ chù tíchū yīgè wèntí, bìng zài " -"rù nín de CIRCUITPY qūdòngqì:\n" #: supervisor/shared/safe_mode.c msgid "" @@ -1122,22 +1120,10 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"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 "" -"Wēi kòngzhì qì de diànliàng bèi chōng chū. Qǐng quèbǎo nín de diànyuán wèi\n" -"zhěnggè diànlù tígōng zúgòu de diànyuán bìng àn xià fùwèi (zài dànchū " -"CIRCUITPY hòu).\n" - -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" -"Qǐdòng CircuitPython shí, chóng zhì ànniǔ bèi àn xià. Zàicì àn xià yǐ tuìchū " -"ānquán móshì\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -1171,10 +1157,6 @@ msgstr "Píng pū zhí chāochū fànwéi" msgid "Tile width must exactly divide bitmap width" msgstr "Píng pū kuāndù bìxū huàfēn wèi tú kuāndù" -#: supervisor/shared/safe_mode.c -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 msgid "Too many channels in sample." msgstr "Chōuyàng zhōng de píndào tài duō." @@ -1253,6 +1235,10 @@ msgstr "Yìwài de nrfx uuid lèixíng" 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" @@ -1328,11 +1314,8 @@ msgstr "" "Ruò yào liè chū nèizài de mókuài, qǐng qǐng zuò yǐxià `help(\"modules\")`.\n" #: supervisor/shared/safe_mode.c -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" +msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" -"Nǐ zhèngzài ānquán móshì xià yùnxíng, zhè yì wèi zhuó yìwài fāshēng de " -"shìqíng.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -2673,6 +2656,9 @@ msgstr "líng bù" #~ msgid "Address is not %d bytes long or is in wrong format" #~ msgstr "Dìzhǐ bùshì %d zì jié zhǎng, huòzhě géshì cuòwù" +#~ msgid "Attempted heap allocation when MicroPython VM not running.\n" +#~ msgstr "MicroPython VM wèi yùnxíng shí chángshì duī fēnpèi.\n" + #~ msgid "Can't add services in Central mode" #~ msgstr "Wúfǎ zài zhōngyāng móshì xià tiānjiā fúwù" @@ -2697,6 +2683,9 @@ msgstr "líng bù" #~ msgid "Could not decode ble_uuid, err 0x%04x" #~ msgstr "Wúfǎ jiěmǎ kě dú_uuid, err 0x%04x" +#~ msgid "Crash into the HardFault_Handler.\n" +#~ msgstr "Bēngkuì dào HardFault_Handler.\n" + #~ msgid "Data too large for the advertisement packet" #~ msgstr "Guǎnggào bāo de shùjù tài dà" @@ -2802,6 +2791,15 @@ msgstr "líng bù" #~ msgid "Failed to write gatts value, err 0x%04x" #~ msgstr "Xiě rù gatts zhí,err 0x%04x shībài" +#~ msgid "Flash erase failed" +#~ msgstr "Flash cā chú shībài" + +#~ msgid "Flash erase failed to start, err 0x%04x" +#~ msgstr "Flash cā chú shībài, err 0x%04x" + +#~ msgid "Flash write failed to start, err 0x%04x" +#~ msgstr "Flash xiě rù shībài, err 0x%04x" + #~ msgid "Invalid bit clock pin" #~ msgstr "Wúxiào de wèi shízhōng yǐn jiǎo" @@ -2811,6 +2809,22 @@ msgstr "líng bù" #~ msgid "Invalid data pin" #~ msgstr "Wúxiào de shùjù yǐn jiǎo" +#~ msgid "" +#~ "Looks like our core CircuitPython code crashed hard. Whoops!\n" +#~ "Please file an issue at https://github.com/adafruit/circuitpython/issues\n" +#~ " with the contents of your CIRCUITPY drive and this message:\n" +#~ msgstr "" +#~ "Kàn lái wǒmen de héxīn CircuitPython dàimǎ bēngkuì dé hěn lìhài. Āi yōu!\n" +#~ "Qǐng zài https://Github.Com/adafruit/circuitpython/issues\n" +#~ "shàng tíjiāo yīgè wèntí, qízhōng bāohán nín de CIRCUITPY qūdòngqì de " +#~ "nèiróng hé cǐ xiāoxī:\n" + +#~ msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +#~ msgstr "MicroPython NLR tiàoyuè shībài. Kěnéng nèicún fǔbài.\n" + +#~ msgid "MicroPython fatal error.\n" +#~ msgstr "MicroPython zhìmìng cuòwù.\n" + #~ msgid "Must be a Group subclass." #~ msgstr "Bìxū shì fēnzǔ zi lèi." @@ -2835,15 +2849,56 @@ msgstr "líng bù" #~ msgid "Soft device assert, id: 0x%08lX, pc: 0x%08lX" #~ msgstr "Ruǎn shèbèi wéihù, id: 0X%08lX, pc: 0X%08lX" +#~ msgid "" +#~ "The CircuitPython heap was corrupted because the stack was too small.\n" +#~ "Please increase stack size limits and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ "If you didn't change the stack, then file an issue here with the contents " +#~ "of your CIRCUITPY drive:\n" +#~ msgstr "" +#~ "Yóuyú duīzhàn tài xiǎo, huánliú Python rè sǔnhuài.\n" +#~ "Qǐng zēngjiā duīzhàn chǐcùn xiànzhì, ránhòu chóngxīn shèzhì (zài dànchū " +#~ "CIRCUITPY).\n" +#~ "Rúguǒ nín méiyǒu gǎibiàn duīzhàn, qǐng zài cǐ chù tíchū yīgè wèntí, bìng " +#~ "zài rù nín de CIRCUITPY qūdòngqì:\n" + +#~ msgid "" +#~ "The microcontroller's power dipped. Please make sure your power supply " +#~ "provides\n" +#~ "enough power for the whole circuit and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ msgstr "" +#~ "Wēi kòngzhì qì de diànliàng bèi chōng chū. Qǐng quèbǎo nín de diànyuán " +#~ "wèi\n" +#~ "zhěnggè diànlù tígōng zúgòu de diànyuán bìng àn xià fùwèi (zài dànchū " +#~ "CIRCUITPY hòu).\n" + +#~ msgid "" +#~ "The reset button was pressed while booting CircuitPython. Press again to " +#~ "exit safe mode.\n" +#~ msgstr "" +#~ "Qǐdòng CircuitPython shí, chóng zhì ànniǔ bèi àn xià. Zàicì àn xià yǐ " +#~ "tuìchū ānquán móshì\n" + #~ msgid "Tile indices must be 0 - 255" #~ msgstr "Píng pū zhǐshù bìxū wèi 0 - 255" +#~ 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 " + #~ msgid "UUID integer value not in range 0 to 0xffff" #~ msgstr "UUID zhěngshù zhí bùzài fànwéi 0 zhì 0xffff" #~ msgid "Voice index too high" #~ msgstr "Yǔyīn suǒyǐn tài gāo" +#~ msgid "" +#~ "You are running in safe mode which means something unanticipated " +#~ "happened.\n" +#~ msgstr "" +#~ "Nǐ zhèngzài ānquán móshì xià yùnxíng, zhè yì wèi zhuó yìwài fāshēng de " +#~ "shìqíng.\n" + #~ msgid "bad GATT role" #~ msgstr "zǒng xiédìng de bùliáng juésè" diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c index 9e3b864028..aba31e9c9e 100644 --- a/supervisor/shared/safe_mode.c +++ b/supervisor/shared/safe_mode.c @@ -96,48 +96,48 @@ void __attribute__((noinline,)) reset_into_safe_mode(safe_mode_t reason) { -#define FILE_AN_ISSUE translate("\r\nPlease file an issue with the contents of your CIRCUITPY drive at \nhttps://github.com/adafruit/circuitpython/issues\r\n") +#define FILE_AN_ISSUE translate("\nPlease file an issue with the contents of your CIRCUITPY drive at \nhttps://github.com/adafruit/circuitpython/issues\n") void print_safe_mode_message(safe_mode_t reason) { if (reason == NO_SAFE_MODE) { return; } - serial_write("\r\n"); + serial_write("\n"); // Output a user safe mode string if it's set. #ifdef BOARD_USER_SAFE_MODE if (reason == USER_SAFE_MODE) { serial_write_compressed(translate("You requested starting safe mode by ")); serial_write(BOARD_USER_SAFE_MODE_ACTION); - serial_write_compressed(translate("\r\nTo exit, please reset the board without ")); + serial_write_compressed(translate("\nTo exit, please reset the board without ")); serial_write(BOARD_USER_SAFE_MODE_ACTION); - serial_write("\r\n"); + serial_write("\n"); } else #endif switch (reason) { case MANUAL_SAFE_MODE: - serial_write_compressed(translate("CircuitPython is in safe mode because you pressed the reset button during boot. Press again to exit safe mode.\r\n")); + serial_write_compressed(translate("CircuitPython is in safe mode because you pressed the reset button during boot. Press again to exit safe mode.\n")); return; case PROGRAMMATIC_SAFE_MODE: - serial_write_compressed(translate("The `microcontroller` module was used to boot into safe mode. Press reset to exit safe mode.\r\n")); + serial_write_compressed(translate("The `microcontroller` module was used to boot into safe mode. Press reset to exit safe mode.\n")); return; default: break; } - serial_write_compressed(translate("You are in safe mode: something unanticipated happened.\r\n")); + serial_write_compressed(translate("You are in safe mode: something unanticipated happened.\n")); switch (reason) { case BROWNOUT: - serial_write_compressed(translate("The microcontroller's power dipped. Make sure your power supply provides\r\nenough power for the whole circuit and press reset (after ejecting CIRCUITPY).\r\n")); + serial_write_compressed(translate("The microcontroller's power dipped. Make sure your power supply provides\nenough power for the whole circuit and press reset (after ejecting CIRCUITPY).\n")); return; case HEAP_OVERWRITTEN: - serial_write_compressed(translate("The CircuitPython heap was corrupted because the stack was too small.\r\nPlease increase the stack size if you know how, or if not:")); + serial_write_compressed(translate("The CircuitPython heap was corrupted because the stack was too small.\nPlease increase the stack size if you know how, or if not:")); serial_write_compressed(FILE_AN_ISSUE); return; default: break; } - serial_write_compressed(translate("CircuitPython core code crashed hard. Whoops!\r\n")); + serial_write_compressed(translate("CircuitPython core code crashed hard. Whoops!\n")); switch (reason) { case HARD_CRASH: serial_write_compressed(translate("Crash into the HardFault_Handler.")); From e11fabd5e0979fa257a81d6025a0df0b6652b600 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 12 Dec 2019 14:57:23 -0500 Subject: [PATCH 184/189] moved nrf internal filesystem to just below bootloader --- ports/atmel-samd/mpconfigport.h | 10 +++++----- ports/nrf/boards/common.template.ld | 2 +- ports/nrf/mpconfigport.h | 28 +++++++++++++++++----------- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index a319c6199a..846e8db707 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -151,11 +151,11 @@ // Flash layout, starting at 0x00000000 // -// bootloader (8 or 16kB) -// firmware -// internal CIRCUITPY flash filesystem (optional) -// internal config, used to store crystalless clock calibration info (optional) -// microntroller.nvm (optional) +// - bootloader (8 or 16kB) +// - firmware +// - internal CIRCUITPY flash filesystem (optional) +// - internal config, used to store crystalless clock calibration info (optional) +// - microntroller.nvm (optional) // Define these regions starting up from the bottom of flash: diff --git a/ports/nrf/boards/common.template.ld b/ports/nrf/boards/common.template.ld index f267234924..931f95ee9e 100644 --- a/ports/nrf/boards/common.template.ld +++ b/ports/nrf/boards/common.template.ld @@ -11,9 +11,9 @@ MEMORY FLASH_SD (rx) : ORIGIN = ${SD_FLASH_START_ADDR}, LENGTH = ${SD_FLASH_SIZE} FLASH_ISR (rx) : ORIGIN = ${ISR_START_ADDR}, LENGTH = ${ISR_SIZE} FLASH_FIRMWARE (rx) : ORIGIN = ${CIRCUITPY_FIRMWARE_START_ADDR}, LENGTH = ${CIRCUITPY_FIRMWARE_SIZE} - FLASH_FATFS (r) : ORIGIN = ${CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR}, LENGTH = ${CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE} FLASH_BLE_CONFIG (r) : ORIGIN = ${CIRCUITPY_BLE_CONFIG_START_ADDR}, LENGTH = ${CIRCUITPY_BLE_CONFIG_SIZE} FLASH_NVM (r) : ORIGIN = ${CIRCUITPY_INTERNAL_NVM_START_ADDR}, LENGTH = ${CIRCUITPY_INTERNAL_NVM_SIZE} + FLASH_FATFS (r) : ORIGIN = ${CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR}, LENGTH = ${CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE} FLASH_BOOTLOADER (rx) : ORIGIN = ${BOOTLOADER_START_ADDR}, LENGTH = ${BOOTLOADER_SIZE} FLASH_BOOTLOADER_SETTINGS (r) : ORIGIN = ${BOOTLOADER_SETTINGS_START_ADDR}, LENGTH = ${BOOTLOADER_SETTINGS_SIZE} RAM (xrw) : ORIGIN = 0x20004000, LENGTH = 0x03C000 /* 240 KiB */ diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index 71bf6bc8f0..cb25870dc0 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -76,14 +76,16 @@ // Flash layout, starting at 0x00000000 // -// SoftDevice -// ISR -// firmware -// internal CIRCUITPY flash filesystem (optional) -// BLE config (bonding info, etc.) (optional) -// microcontroller.nvm (optional) -// bootloader (note the MBR at 0x0 redirects to the bootloader here, in high flash) -// bootloader settings +// - SoftDevice +// - ISR +// - firmware +// - BLE config (bonding info, etc.) (optional) +// - microcontroller.nvm (optional) +// - internal CIRCUITPY flash filesystem (optional) +// The flash filesystem is adjacent to the bootloader, so that its location will not change even if +// other regions change in size. +// - bootloader (note the MBR at 0x0 redirects to the bootloader here, in high flash) +// - bootloader settings // Define these regions starting up from the bottom of flash: @@ -105,14 +107,18 @@ #define BOOTLOADER_SETTINGS_START_ADDR (0x000FF000) #define BOOTLOADER_SETTINGS_SIZE (0x1000) // 4kiB -#define CIRCUITPY_INTERNAL_NVM_START_ADDR (BOOTLOADER_START_ADDR - CIRCUITPY_INTERNAL_NVM_SIZE) +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR (BOOTLOADER_START_ADDR - CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE) + +#if CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE > 0 && CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR != (BOOTLOADER_START_ADDR - 256*1024) +#warning Internal flash filesystem location has moved! +#endif + +#define CIRCUITPY_INTERNAL_NVM_START_ADDR (CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR - CIRCUITPY_INTERNAL_NVM_SIZE) // 32kiB for bonding, etc. #define CIRCUITPY_BLE_CONFIG_SIZE (32*1024) #define CIRCUITPY_BLE_CONFIG_START_ADDR (CIRCUITPY_INTERNAL_NVM_START_ADDR - CIRCUITPY_BLE_CONFIG_SIZE) -#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR (CIRCUITPY_BLE_CONFIG_START_ADDR - CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE) - // The firmware space is the space left over between the fixed lower and upper regions. #define CIRCUITPY_FIRMWARE_SIZE (CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR - CIRCUITPY_FIRMWARE_START_ADDR) From 9a3d45e7d0fd942201f4bb2102d9d5489bd7cb86 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 12 Dec 2019 13:46:51 -0800 Subject: [PATCH 185/189] Add extended, connectable and scannable error. Related to https://github.com/adafruit/Adafruit_CircuitPython_BLE/issues/44 --- shared-bindings/_bleio/Adapter.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 9772fa830d..5d3211b0c4 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -29,6 +29,7 @@ #include "py/objproperty.h" #include "py/runtime.h" +#include "shared-bindings/_bleio/__init__.h" #include "shared-bindings/_bleio/Address.h" #include "shared-bindings/_bleio/Adapter.h" @@ -185,7 +186,12 @@ STATIC mp_obj_t bleio_adapter_start_advertising(mp_uint_t n_args, const mp_obj_t ADV_INTERVAL_MIN_STRING, ADV_INTERVAL_MAX_STRING); } - common_hal_bleio_adapter_start_advertising(self, args[ARG_connectable].u_bool, interval, + bool connectable = args[ARG_connectable].u_bool; + if (data_bufinfo.len > 31 && connectable && scan_response_bufinfo.len > 0) { + mp_raise_bleio_BluetoothError(translate("Cannot have scan responses for extended, connectable advertisements.")); + } + + common_hal_bleio_adapter_start_advertising(self, connectable, interval, &data_bufinfo, &scan_response_bufinfo); return mp_const_none; From 51ba0ed2501ba2467e2b8da708bcc8ba6ab09a7c Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 12 Dec 2019 15:33:46 -0800 Subject: [PATCH 186/189] Update translations --- locale/ID.po | 6 +++++- locale/circuitpython.pot | 6 +++++- locale/de_DE.po | 6 +++++- locale/en_US.po | 6 +++++- locale/en_x_pirate.po | 6 +++++- locale/es.po | 6 +++++- locale/fil.po | 6 +++++- locale/fr.po | 6 +++++- locale/it_IT.po | 6 +++++- locale/ko.po | 6 +++++- locale/pl.po | 6 +++++- locale/pt_BR.po | 6 +++++- locale/zh_Latn_pinyin.po | 6 +++++- 13 files changed, 65 insertions(+), 13 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index c147a5f5f9..18773a2027 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 14:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -419,6 +419,10 @@ msgstr "Tidak bisa mendapatkan pull pada saat mode output" msgid "Cannot get temperature" msgstr "Tidak bisa mendapatkan temperatur. status: 0x%02x" +#: 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 "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index e21541d7e2..f4b67521ce 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 15:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -413,6 +413,10 @@ msgstr "" 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 "" diff --git a/locale/de_DE.po b/locale/de_DE.po index f1158b1b3a..36d2f266d7 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 14:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -417,6 +417,10 @@ msgstr "Pull up im Ausgabemodus nicht möglich" msgid "Cannot get temperature" msgstr "Kann Temperatur nicht holen" +#: 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 "Kann nicht beite Kanäle auf dem gleichen Pin ausgeben" diff --git a/locale/en_US.po b/locale/en_US.po index c6f342186f..7da32614f4 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 14:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -413,6 +413,10 @@ msgstr "" 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 "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index 54d246e2de..867618bd98 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 14:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -417,6 +417,10 @@ msgstr "" 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 "" diff --git a/locale/es.po b/locale/es.po index 7ced099be5..285d1d8515 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 14:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -419,6 +419,10 @@ msgstr "No puede ser pull mientras este en modo de salida" msgid "Cannot get temperature" msgstr "No se puede obtener la temperatura." +#: 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 "No se puede tener ambos canales en el mismo pin" diff --git a/locale/fil.po b/locale/fil.po index 16fac72244..6600ffb9a6 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 14:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -421,6 +421,10 @@ msgstr "Hindi makakakuha ng pull habang nasa output mode" msgid "Cannot get temperature" msgstr "Hindi makuha ang temperatura. status 0x%02x" +#: 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 "Hindi maaaring output ang mga parehong channel sa parehong pin" diff --git a/locale/fr.po b/locale/fr.po index 9762b5e7da..6437b8ba86 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 14:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -425,6 +425,10 @@ msgstr "Ne peut être tiré ('pull') en mode 'output'" msgid "Cannot get temperature" msgstr "Impossible de lire la température" +#: 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 "Les 2 canaux de sortie ne peuvent être sur la même broche" diff --git a/locale/it_IT.po b/locale/it_IT.po index 0a3c30d2bd..a659664a00 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 14:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -421,6 +421,10 @@ msgstr "non si può tirare quando nella modalita output" msgid "Cannot get temperature" msgstr "Impossibile leggere la temperatura. status: 0x%02x" +#: 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 "Impossibile dare in output entrambi i canal sullo stesso pin" diff --git a/locale/ko.po b/locale/ko.po index 78f0c756b1..c47c10a94d 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 14:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -417,6 +417,10 @@ msgstr "" 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 "" diff --git a/locale/pl.po b/locale/pl.po index 60aac45a3f..8d564c2431 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 14:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -416,6 +416,10 @@ msgstr "Nie ma podciągnięcia w trybie wyjścia" msgid "Cannot get temperature" msgstr "Nie można odczytać temperatury" +#: 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 "Nie można mieć obu kanałów na tej samej nóżce" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 0aa2ac6308..48cf9e77ef 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 14:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -418,6 +418,10 @@ msgstr "" msgid "Cannot get temperature" msgstr "Não pode obter a temperatura. status: 0x%02x" +#: 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 "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index bd5b80a724..63889a52d6 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 14:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -417,6 +417,10 @@ msgstr "Zài shūchū móshì xià wúfǎ huòqǔ lādòng" msgid "Cannot get temperature" msgstr "Wúfǎ huòqǔ wēndù" +#: 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 "Wúfǎ shūchū tóng yīgè yǐn jiǎo shàng de liǎng gè píndào" From a854a76819e4b871f9d0c4e059ca5c03f05dca76 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 13 Dec 2019 14:05:56 -0600 Subject: [PATCH 187/189] audiocore: The arguments to reset_buffer went missing In conversion I missed these arguments were being passed, but noticed it when an implausible value for audio_channel was sent to mp3's reset_buffer method. It's not clear whether there was any negative impact to this, but it should be fixed! --- shared-module/audiocore/__init__.c | 2 +- shared-module/audiocore/__init__.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/shared-module/audiocore/__init__.c b/shared-module/audiocore/__init__.c index 1553dbe961..ac9d41b60a 100644 --- a/shared-module/audiocore/__init__.c +++ b/shared-module/audiocore/__init__.c @@ -52,7 +52,7 @@ uint8_t audiosample_channel_count(mp_obj_t sample_obj) { void audiosample_reset_buffer(mp_obj_t sample_obj, bool single_channel, uint8_t audio_channel) { const audiosample_p_t *proto = mp_proto_get_or_throw(MP_QSTR_protocol_audiosample, sample_obj); - proto->reset_buffer(MP_OBJ_TO_PTR(sample_obj)); + proto->reset_buffer(MP_OBJ_TO_PTR(sample_obj), single_channel, audio_channel); } audioio_get_buffer_result_t audiosample_get_buffer(mp_obj_t sample_obj, diff --git a/shared-module/audiocore/__init__.h b/shared-module/audiocore/__init__.h index 38c1f5aeb1..7a56454b8a 100644 --- a/shared-module/audiocore/__init__.h +++ b/shared-module/audiocore/__init__.h @@ -42,7 +42,8 @@ typedef enum { typedef uint32_t (*audiosample_sample_rate_fun)(mp_obj_t); typedef uint8_t (*audiosample_bits_per_sample_fun)(mp_obj_t); typedef uint8_t (*audiosample_channel_count_fun)(mp_obj_t); -typedef void (*audiosample_reset_buffer_fun)(mp_obj_t); +typedef void (*audiosample_reset_buffer_fun)(mp_obj_t, + bool single_channel, uint8_t audio_channel); typedef audioio_get_buffer_result_t (*audiosample_get_buffer_fun)(mp_obj_t, bool single_channel, uint8_t channel, uint8_t** buffer, uint32_t* buffer_length); From bf9b7e7ece6186b2fb7716323fba8ef24315cb47 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 13 Dec 2019 14:07:00 -0600 Subject: [PATCH 188/189] MP3: skip ID3V2 metadata This was one reason that the "bartlebeats" mp3s would not play. --- shared-module/audiomp3/MP3File.c | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/shared-module/audiomp3/MP3File.c b/shared-module/audiomp3/MP3File.c index f4861da360..789d75e0f7 100644 --- a/shared-module/audiomp3/MP3File.c +++ b/shared-module/audiomp3/MP3File.c @@ -88,6 +88,39 @@ STATIC bool mp3file_update_inbuf(audiomp3_mp3file_obj_t* self) { #define BYTES_LEFT(self) (self->inbuf_length - self->inbuf_offset) #define CONSUME(self, n) (self->inbuf_offset += n) +// http://id3.org/d3v2.3.0 +// http://id3.org/id3v2.3.0 +STATIC void mp3file_skip_id3v2(audiomp3_mp3file_obj_t* self) { + mp3file_update_inbuf(self); + if (BYTES_LEFT(self) < 10) { + return; + } + uint8_t *data = READ_PTR(self); + if (!( + data[0] == 'I' && + data[1] == 'D' && + data[2] == '3' && + data[3] != 0xff && + data[4] != 0xff && + (data[5] & 0x1f) == 0 && + (data[6] & 0x80) == 0 && + (data[7] & 0x80) == 0 && + (data[8] & 0x80) == 0 && + (data[9] & 0x80) == 0)) { + return; + } + uint32_t size = (data[6] << 21) | (data[7] << 14) | (data[8] << 7) | (data[9]); + size += 10; // size excludes the "header" (but not the "extended header") + // First, deduct from size whatever is left in buffer + uint32_t to_consume = MIN(size, BYTES_LEFT(self)); + CONSUME(self, to_consume); + size -= to_consume; + + // Next, seek in the file after the header + f_lseek(&self->file->fp, f_tell(&self->file->fp) + size); + return; +} + /* If a sync word can be found, advance to it and return true. Otherwise, * return false. */ @@ -223,6 +256,7 @@ void audiomp3_mp3file_reset_buffer(audiomp3_mp3file_obj_t* self, self->eof = 0; self->other_channel = -1; mp3file_update_inbuf(self); + mp3file_skip_id3v2(self); mp3file_find_sync_word(self); } @@ -253,6 +287,7 @@ audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t* self->buffer_index = !self->buffer_index; int16_t *buffer = (int16_t *)(void *)self->buffers[self->buffer_index]; + mp3file_skip_id3v2(self); if (!mp3file_find_sync_word(self)) { return self->eof ? GET_BUFFER_DONE : GET_BUFFER_ERROR; } From 91a1706160aa653cb00c7910b0930df679bcdd21 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 13 Dec 2019 15:20:48 -0600 Subject: [PATCH 189/189] MP3: look harder for frame info Apparently sometimes, a proper "frame info" block is not found after a "sync word". Keep looking for one as needed, instead of giving up after one try. This was one reason that the "bartlebeats" mp3s would not play. --- shared-module/audiomp3/MP3File.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/shared-module/audiomp3/MP3File.c b/shared-module/audiomp3/MP3File.c index 789d75e0f7..0aa4f24a66 100644 --- a/shared-module/audiomp3/MP3File.c +++ b/shared-module/audiomp3/MP3File.c @@ -139,7 +139,15 @@ STATIC bool mp3file_find_sync_word(audiomp3_mp3file_obj_t* self) { } STATIC bool mp3file_get_next_frame_info(audiomp3_mp3file_obj_t* self, MP3FrameInfo* fi) { - int err = MP3GetNextFrameInfo(self->decoder, fi, READ_PTR(self)); + int err; + do { + err = MP3GetNextFrameInfo(self->decoder, fi, READ_PTR(self)); + if (err == ERR_MP3_NONE) { + break; + } + CONSUME(self, 1); + mp3file_find_sync_word(self); + } while (!self->eof); return err == ERR_MP3_NONE; }