Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Benjamin Shockley 2018-10-01 12:28:42 -05:00
commit 1f3a3fe5a0
79 changed files with 1933 additions and 586 deletions

View File

@ -5,6 +5,9 @@ compiler:
- gcc - gcc
git: git:
depth: 1 depth: 1
# Put a representative board from each port or sub-port near the top
# to determine more quickly whether that port is going to build or not.
env: env:
- TRAVIS_TEST=unix - TRAVIS_TEST=unix
- TRAVIS_TEST=docs - TRAVIS_TEST=docs
@ -12,27 +15,30 @@ env:
- TRAVIS_BOARD=feather_huzzah - TRAVIS_BOARD=feather_huzzah
- TRAVIS_BOARD=circuitplayground_express - TRAVIS_BOARD=circuitplayground_express
- TRAVIS_BOARD=pca10056 - TRAVIS_BOARD=pca10056
# The rest of the boards, in alphabetical order.
- TRAVIS_BOARD=trinket_m0 - TRAVIS_BOARD=trinket_m0
- TRAVIS_BOARD=feather_m4_express - TRAVIS_BOARD=feather_m4_express
- TRAVIS_BOARD=grandcentral_m4_express - TRAVIS_BOARD=grandcentral_m4_express
- TRAVIS_BOARD=feather_radiofruit_zigbee
- TRAVIS_BOARD=arduino_zero - TRAVIS_BOARD=arduino_zero
- TRAVIS_BOARD=circuitplayground_express_crickit - TRAVIS_BOARD=circuitplayground_express_crickit
- TRAVIS_BOARD=feather_m0_basic
- TRAVIS_BOARD=feather_m0_adalogger - TRAVIS_BOARD=feather_m0_adalogger
- TRAVIS_BOARD=feather_m0_rfm69 - TRAVIS_BOARD=feather_m0_basic
- TRAVIS_BOARD=feather_m0_rfm9x
- TRAVIS_BOARD=feather_m0_express - TRAVIS_BOARD=feather_m0_express
- TRAVIS_BOARD=feather_m0_express_crickit - TRAVIS_BOARD=feather_m0_express_crickit
- TRAVIS_BOARD=feather_m0_rfm69
- TRAVIS_BOARD=feather_m0_rfm9x
- TRAVIS_BOARD=feather_nrf52832
- TRAVIS_BOARD=feather_nrf52840_express
- TRAVIS_BOARD=feather_radiofruit_zigbee
- TRAVIS_BOARD=gemma_m0
- TRAVIS_BOARD=hallowing_m0_express
- TRAVIS_BOARD=itsybitsy_m0_express - TRAVIS_BOARD=itsybitsy_m0_express
- TRAVIS_BOARD=itsybitsy_m4_express - TRAVIS_BOARD=itsybitsy_m4_express
- TRAVIS_BOARD=metro_m0_express - TRAVIS_BOARD=metro_m0_express
- TRAVIS_BOARD=metro_m4_express - TRAVIS_BOARD=metro_m4_express
- TRAVIS_BOARD=pca10059
- TRAVIS_BOARD=pirkey_m0 - TRAVIS_BOARD=pirkey_m0
- TRAVIS_BOARD=gemma_m0 - TRAVIS_BOARD=trellis_m4_express
- TRAVIS_BOARD=hallowing_m0_express
- TRAVIS_BOARD=feather_nrf52832
- TRAVIS_BOARD=feather_nrf52840_express
addons: addons:
artifacts: artifacts:
@ -56,13 +62,13 @@ before_script:
- ([[ -z "$TRAVIS_BOARD" || $TRAVIS_BOARD = "feather_huzzah" ]] || (wget https://s3.amazonaws.com/adafruit-circuit-python/gcc-arm-embedded_7-2018q2-1~trusty1_amd64.deb && sudo dpkg -i gcc-arm-embedded*_amd64.deb)) - ([[ -z "$TRAVIS_BOARD" || $TRAVIS_BOARD = "feather_huzzah" ]] || (wget https://s3.amazonaws.com/adafruit-circuit-python/gcc-arm-embedded_7-2018q2-1~trusty1_amd64.deb && sudo dpkg -i gcc-arm-embedded*_amd64.deb))
# For nrf builds # For nrf builds
- ([[ $TRAVIS_BOARD != "feather_nrf52832" && $TRAVIS_BOARD != "feather_nrf52840_express" && $TRAVIS_BOARD != "pca10056" ]] || sudo ports/nrf/drivers/bluetooth/download_ble_stack.sh) - ([[ $TRAVIS_BOARD != "feather_nrf52832" && $TRAVIS_BOARD != "feather_nrf52840_express" && $TRAVIS_BOARD != "pca10056" && $TRAVIS_BOARD != "pca10059" ]] || sudo ports/nrf/drivers/bluetooth/download_ble_stack.sh)
# For huzzah builds # For huzzah builds
- if [[ $TRAVIS_BOARD = "feather_huzzah" ]]; then wget https://github.com/jepler/esp-open-sdk/releases/download/2018-06-10/xtensa-lx106-elf-standalone.tar.gz && tar xavf xtensa-lx106-elf-standalone.tar.gz; PATH=$(readlink -f xtensa-lx106-elf/bin):$PATH; fi - if [[ $TRAVIS_BOARD = "feather_huzzah" ]]; then wget https://github.com/jepler/esp-open-sdk/releases/download/2018-06-10/xtensa-lx106-elf-standalone.tar.gz && tar xavf xtensa-lx106-elf-standalone.tar.gz; PATH=$(readlink -f xtensa-lx106-elf/bin):$PATH; fi
# For coverage testing (upgrade is used to get latest urllib3 version) # For coverage testing (upgrade is used to get latest urllib3 version)
- ([[ -z "$TRAVIS_TEST" ]] || sudo apt-get install -y python3-pip) - ([[ -z "$TRAVIS_TEST" ]] || sudo apt-get install -y python3-pip)
- ([[ -z "$TRAVIS_TEST" ]] || sudo pip install --upgrade cpp-coveralls) - ([[ -z "$TRAVIS_TEST" ]] || sudo pip install --upgrade cpp-coveralls)
- ([[ $TRAVIS_TEST != "docs" ]] || sudo pip install Sphinx sphinx-rtd-theme recommonmark) - ([[ $TRAVIS_TEST != "docs" ]] || sudo pip install 'Sphinx<1.8.0' sphinx-rtd-theme recommonmark)
- ([[ $TRAVIS_TEST != "translations" ]] || sudo pip3 install polib) - ([[ $TRAVIS_TEST != "translations" ]] || sudo pip3 install polib)
- gcc --version - gcc --version
- ([[ -z "$TRAVIS_BOARD" || $TRAVIS_BOARD = "feather_huzzah" ]] || arm-none-eabi-gcc --version) - ([[ -z "$TRAVIS_BOARD" || $TRAVIS_BOARD = "feather_huzzah" ]] || arm-none-eabi-gcc --version)

View File

@ -35,6 +35,7 @@
#if MICROPY_PY_UZLIB #if MICROPY_PY_UZLIB
#define UZLIB_CONF_PARANOID_CHECKS (1)
#include "../../lib/uzlib/src/tinf.h" #include "../../lib/uzlib/src/tinf.h"
#if 0 // print debugging info #if 0 // print debugging info
@ -50,7 +51,7 @@ typedef struct _mp_obj_decompio_t {
bool eof; bool eof;
} mp_obj_decompio_t; } mp_obj_decompio_t;
STATIC unsigned char read_src_stream(TINF_DATA *data) { STATIC int read_src_stream(TINF_DATA *data) {
byte *p = (void*)data; byte *p = (void*)data;
p -= offsetof(mp_obj_decompio_t, decomp); p -= offsetof(mp_obj_decompio_t, decomp);
mp_obj_decompio_t *self = (mp_obj_decompio_t*)p; mp_obj_decompio_t *self = (mp_obj_decompio_t*)p;
@ -112,7 +113,7 @@ STATIC mp_uint_t decompio_read(mp_obj_t o_in, void *buf, mp_uint_t size, int *er
} }
o->decomp.dest = buf; o->decomp.dest = buf;
o->decomp.destSize = size; o->decomp.dest_limit = (unsigned char*)buf+size;
int st = uzlib_uncompress_chksum(&o->decomp); int st = uzlib_uncompress_chksum(&o->decomp);
if (st == TINF_DONE) { if (st == TINF_DONE) {
o->eof = true; o->eof = true;
@ -157,10 +158,10 @@ STATIC mp_obj_t mod_uzlib_decompress(size_t n_args, const mp_obj_t *args) {
byte *dest_buf = m_new(byte, dest_buf_size); byte *dest_buf = m_new(byte, dest_buf_size);
decomp->dest = dest_buf; decomp->dest = dest_buf;
decomp->destSize = dest_buf_size; decomp->dest_limit = dest_buf+dest_buf_size;
DEBUG_printf("uzlib: Initial out buffer: " UINT_FMT " bytes\n", decomp->destSize); DEBUG_printf("uzlib: Initial out buffer: " UINT_FMT " bytes\n", decomp->destSize);
decomp->source = bufinfo.buf; decomp->source = bufinfo.buf;
decomp->source_limit = (unsigned char *)bufinfo.buf + bufinfo.len;
int st; int st;
bool is_zlib = true; bool is_zlib = true;
@ -187,7 +188,7 @@ STATIC mp_obj_t mod_uzlib_decompress(size_t n_args, const mp_obj_t *args) {
dest_buf = m_renew(byte, dest_buf, dest_buf_size, dest_buf_size + 256); dest_buf = m_renew(byte, dest_buf, dest_buf_size, dest_buf_size + 256);
dest_buf_size += 256; dest_buf_size += 256;
decomp->dest = dest_buf + offset; decomp->dest = dest_buf + offset;
decomp->destSize = 256; decomp->dest_limit = dest_buf + offset + 256;
} }
mp_uint_t final_sz = decomp->dest - dest_buf; mp_uint_t final_sz = decomp->dest - dest_buf;
@ -218,6 +219,7 @@ const mp_obj_module_t mp_module_uzlib = {
// Source files #include'd here to make sure they're compiled in // Source files #include'd here to make sure they're compiled in
// only if module is enabled by config setting. // only if module is enabled by config setting.
#pragma GCC diagnostic ignored "-Wsign-compare"
#include "../../lib/uzlib/src/tinflate.c" #include "../../lib/uzlib/src/tinflate.c"
#include "../../lib/uzlib/src/tinfzlib.c" #include "../../lib/uzlib/src/tinfzlib.c"
#include "../../lib/uzlib/src/tinfgzip.c" #include "../../lib/uzlib/src/tinfgzip.c"

@ -1 +1 @@
Subproject commit 27176508e188c0900877e810be34198cd88dcb63 Subproject commit f966da0fab121e910ea74f037f074538a2e6dbbb

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-09-06 14:55-0700\n" "POT-Creation-Date: 2018-09-21 12:23-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -123,7 +123,7 @@ msgstr ""
msgid "queue overflow" msgid "queue overflow"
msgstr "" msgstr ""
#: extmod/moduzlib.c:97 #: extmod/moduzlib.c:98
msgid "compression header" msgid "compression header"
msgstr "" msgstr ""
@ -214,7 +214,7 @@ msgstr ""
msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgstr "" msgstr ""
#: main.c:415 #: main.c:416
msgid "soft reboot\n" msgid "soft reboot\n"
msgstr "" msgstr ""
@ -231,15 +231,15 @@ msgstr ""
msgid "calibration is out of range" msgid "calibration is out of range"
msgstr "" msgstr ""
#: ports/atmel-samd/board_busses.c:39 ports/nrf/board_busses.c:39 #: ports/atmel-samd/board_busses.c:59 ports/nrf/board_busses.c:39
msgid "No default I2C bus" msgid "No default I2C bus"
msgstr "" msgstr ""
#: ports/atmel-samd/board_busses.c:64 ports/nrf/board_busses.c:64 #: ports/atmel-samd/board_busses.c:85 ports/nrf/board_busses.c:64
msgid "No default SPI bus" msgid "No default SPI bus"
msgstr "" msgstr ""
#: ports/atmel-samd/board_busses.c:91 ports/nrf/board_busses.c:91 #: ports/atmel-samd/board_busses.c:112 ports/nrf/board_busses.c:91
msgid "No default UART bus" msgid "No default UART bus"
msgstr "" msgstr ""
@ -291,12 +291,12 @@ msgid "Too many channels in sample."
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:305 #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:305
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:326 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:339
msgid "No DMA channel found" msgid "No DMA channel found"
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:308 #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:308
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:328 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:341
msgid "Unable to allocate buffers for signed conversion" msgid "Unable to allocate buffers for signed conversion"
msgstr "" msgstr ""
@ -338,16 +338,21 @@ msgstr ""
msgid "Cannot output both channels on the same pin" msgid "Cannot output both channels on the same pin"
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:173 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:176
#: ports/atmel-samd/common-hal/pulseio/PWMOut.c:186 #: ports/atmel-samd/common-hal/pulseio/PWMOut.c:189
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c:110 #: ports/atmel-samd/common-hal/pulseio/PulseOut.c:110
msgid "All timers in use" msgid "All timers in use"
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:215 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:218
msgid "All event channels in use" msgid "All event channels in use"
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:297
#, c-format
msgid "Sample rate too high. It must be less than %d"
msgstr ""
#: ports/atmel-samd/common-hal/busio/I2C.c:71 #: ports/atmel-samd/common-hal/busio/I2C.c:71
msgid "Not enough pins available" msgid "Not enough pins available"
msgstr "" msgstr ""
@ -356,7 +361,7 @@ msgstr ""
#: ports/atmel-samd/common-hal/busio/SPI.c:132 #: ports/atmel-samd/common-hal/busio/SPI.c:132
#: ports/atmel-samd/common-hal/busio/UART.c:119 #: ports/atmel-samd/common-hal/busio/UART.c:119
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c:45 #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c:45
#: ports/nrf/common-hal/busio/I2C.c:58 #: ports/nrf/common-hal/busio/I2C.c:77
msgid "Invalid pins" msgid "Invalid pins"
msgstr "" msgstr ""
@ -376,24 +381,24 @@ msgstr ""
msgid "tx and rx cannot both be None" msgid "tx and rx cannot both be None"
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/busio/UART.c:139 #: ports/atmel-samd/common-hal/busio/UART.c:145
msgid "Failed to allocate RX buffer" msgid "Failed to allocate RX buffer"
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/busio/UART.c:147 #: ports/atmel-samd/common-hal/busio/UART.c:153
msgid "Could not initialize UART" msgid "Could not initialize UART"
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/busio/UART.c:234 #: ports/atmel-samd/common-hal/busio/UART.c:240
msgid "No RX pin" msgid "No RX pin"
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/busio/UART.c:288 #: ports/atmel-samd/common-hal/busio/UART.c:294
msgid "No TX pin" msgid "No TX pin"
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c:170 #: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c:170
#: ports/nrf/common-hal/digitalio/DigitalInOut.c:153 #: ports/nrf/common-hal/digitalio/DigitalInOut.c:142
msgid "Cannot get pull while in output mode" msgid "Cannot get pull while in output mode"
msgstr "" msgstr ""
@ -403,12 +408,12 @@ msgid "Cannot reset into bootloader because no bootloader is present."
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/pulseio/PWMOut.c:120 #: ports/atmel-samd/common-hal/pulseio/PWMOut.c:120
#: ports/atmel-samd/common-hal/pulseio/PWMOut.c:366 #: ports/atmel-samd/common-hal/pulseio/PWMOut.c:369
#: ports/nrf/common-hal/pulseio/PWMOut.c:227 #: ports/nrf/common-hal/pulseio/PWMOut.c:227
msgid "Invalid PWM frequency" msgid "Invalid PWM frequency"
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/pulseio/PWMOut.c:184 #: ports/atmel-samd/common-hal/pulseio/PWMOut.c:187
msgid "All timers for this pin are in use" msgid "All timers for this pin are in use"
msgstr "" msgstr ""
@ -685,11 +690,23 @@ msgstr ""
msgid "AnalogOut functionality not supported" msgid "AnalogOut functionality not supported"
msgstr "" msgstr ""
#: ports/nrf/common-hal/busio/I2C.c:91
msgid "All I2C peripherals are in use"
msgstr ""
#: ports/nrf/common-hal/busio/SPI.c:109
msgid "All SPI peripherals are in use"
msgstr ""
#: ports/nrf/common-hal/busio/SPI.c:170
msgid "Baud rate too high for this SPI peripheral"
msgstr ""
#: ports/nrf/common-hal/busio/UART.c:43 ports/nrf/common-hal/busio/UART.c:47 #: ports/nrf/common-hal/busio/UART.c:43 ports/nrf/common-hal/busio/UART.c:47
#: ports/nrf/common-hal/busio/UART.c:51 ports/nrf/common-hal/busio/UART.c:60 #: ports/nrf/common-hal/busio/UART.c:51 ports/nrf/common-hal/busio/UART.c:60
#: ports/nrf/common-hal/busio/UART.c:66 ports/nrf/common-hal/busio/UART.c:71 #: ports/nrf/common-hal/busio/UART.c:66 ports/nrf/common-hal/busio/UART.c:71
#: ports/nrf/common-hal/busio/UART.c:76 ports/nrf/common-hal/busio/UART.c:81 #: ports/nrf/common-hal/busio/UART.c:76 ports/nrf/common-hal/busio/UART.c:81
#: ports/nrf/common-hal/busio/UART.c:86 #: ports/nrf/common-hal/busio/UART.c:86 ports/nrf/common-hal/busio/UART.c:90
msgid "busio.UART not yet implemented" msgid "busio.UART not yet implemented"
msgstr "" msgstr ""
@ -1960,6 +1977,7 @@ msgid "buffer must be a bytes-like object"
msgstr "" msgstr ""
#: shared-bindings/audioio/WaveFile.c:78 #: shared-bindings/audioio/WaveFile.c:78
#: shared-bindings/displayio/OnDiskBitmap.c:85
msgid "file must be a file opened in byte mode" msgid "file must be a file opened in byte mode"
msgstr "" msgstr ""
@ -1992,11 +2010,11 @@ msgstr ""
msgid "Function requires lock." msgid "Function requires lock."
msgstr "" msgstr ""
#: shared-bindings/busio/UART.c:98 #: shared-bindings/busio/UART.c:102
msgid "bits must be 7, 8 or 9" msgid "bits must be 7, 8 or 9"
msgstr "" msgstr ""
#: shared-bindings/busio/UART.c:110 #: shared-bindings/busio/UART.c:114
msgid "stop must be 1 or 2" msgid "stop must be 1 or 2"
msgstr "" msgstr ""
@ -2034,6 +2052,10 @@ msgstr ""
msgid "row data must be a buffer" msgid "row data must be a buffer"
msgstr "" msgstr ""
#: shared-bindings/displayio/ColorConverter.c:72
msgid "color should be an int"
msgstr ""
#: shared-bindings/displayio/FourWire.c:55 #: shared-bindings/displayio/FourWire.c:55
#: shared-bindings/displayio/FourWire.c:64 #: shared-bindings/displayio/FourWire.c:64
msgid "displayio is a work in progress" msgid "displayio is a work in progress"
@ -2064,16 +2086,16 @@ msgstr ""
msgid "palette_index should be an int" msgid "palette_index should be an int"
msgstr "" msgstr ""
#: shared-bindings/displayio/Sprite.c:45 #: shared-bindings/displayio/Sprite.c:48
msgid "position must be 2-tuple" msgid "position must be 2-tuple"
msgstr "" msgstr ""
#: shared-bindings/displayio/Sprite.c:87 #: shared-bindings/displayio/Sprite.c:97
msgid "unsupported bitmap type" msgid "unsupported bitmap type"
msgstr "" msgstr ""
#: shared-bindings/displayio/Sprite.c:152 #: shared-bindings/displayio/Sprite.c:162
msgid "palette must be displayio.Palette" msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter"
msgstr "" msgstr ""
#: shared-bindings/gamepad/GamePad.c:100 #: shared-bindings/gamepad/GamePad.c:100
@ -2302,6 +2324,24 @@ msgstr ""
msgid "Group full" msgid "Group full"
msgstr "" msgstr ""
#: shared-module/displayio/Group.c:48
msgid "Group empty"
msgstr ""
#: shared-module/displayio/OnDiskBitmap.c:49
msgid "Invalid BMP file"
msgstr ""
#: shared-module/displayio/OnDiskBitmap.c:59
#, c-format
msgid "Only Windows format, uncompressed BMP supported %d"
msgstr ""
#: shared-module/displayio/OnDiskBitmap.c:64
#, c-format
msgid "Only true color (24 bpp or higher) BMP supported %x"
msgstr ""
#: shared-module/struct/__init__.c:39 #: shared-module/struct/__init__.c:39
msgid "'S' and 'O' are not supported format types" msgid "'S' and 'O' are not supported format types"
msgstr "" msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-09-06 14:55-0700\n" "POT-Creation-Date: 2018-09-21 12:23-0400\n"
"PO-Revision-Date: 2018-07-27 11:55-0700\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n"
"Last-Translator: Sebastian Plamauer\n" "Last-Translator: Sebastian Plamauer\n"
"Language-Team: \n" "Language-Team: \n"
@ -123,7 +123,7 @@ msgstr "ungültiges cert"
msgid "queue overflow" msgid "queue overflow"
msgstr "Warteschlangenüberlauf" msgstr "Warteschlangenüberlauf"
#: extmod/moduzlib.c:97 #: extmod/moduzlib.c:98
msgid "compression header" msgid "compression header"
msgstr "kompression header" msgstr "kompression header"
@ -223,7 +223,7 @@ msgstr ""
"Drücke eine Taste um dich mit der REPL zu verbinden. Drücke Strg-D zum neu " "Drücke eine Taste um dich mit der REPL zu verbinden. Drücke Strg-D zum neu "
"laden" "laden"
#: main.c:415 #: main.c:416
msgid "soft reboot\n" msgid "soft reboot\n"
msgstr "weicher reboot\n" msgstr "weicher reboot\n"
@ -240,15 +240,15 @@ msgstr "Kalibrierung ist Schreibgeschützt"
msgid "calibration is out of range" msgid "calibration is out of range"
msgstr "Kalibrierung ist außerhalb der Reichweite" msgstr "Kalibrierung ist außerhalb der Reichweite"
#: ports/atmel-samd/board_busses.c:39 ports/nrf/board_busses.c:39 #: ports/atmel-samd/board_busses.c:59 ports/nrf/board_busses.c:39
msgid "No default I2C bus" msgid "No default I2C bus"
msgstr "Kein Standard I2C Bus" msgstr "Kein Standard I2C Bus"
#: ports/atmel-samd/board_busses.c:64 ports/nrf/board_busses.c:64 #: ports/atmel-samd/board_busses.c:85 ports/nrf/board_busses.c:64
msgid "No default SPI bus" msgid "No default SPI bus"
msgstr "Kein Standard SPI Bus" msgstr "Kein Standard SPI Bus"
#: ports/atmel-samd/board_busses.c:91 ports/nrf/board_busses.c:91 #: ports/atmel-samd/board_busses.c:112 ports/nrf/board_busses.c:91
msgid "No default UART bus" msgid "No default UART bus"
msgstr "Kein Standard UART Bus" msgstr "Kein Standard UART Bus"
@ -300,12 +300,12 @@ msgid "Too many channels in sample."
msgstr "Zu viele Kanäle im sample" msgstr "Zu viele Kanäle im sample"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:305 #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:305
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:326 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:339
msgid "No DMA channel found" msgid "No DMA channel found"
msgstr "Kein DMA Kanal gefunden" msgstr "Kein DMA Kanal gefunden"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:308 #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:308
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:328 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:341
msgid "Unable to allocate buffers for signed conversion" msgid "Unable to allocate buffers for signed conversion"
msgstr "Konnte keine Buffer für Vorzeichenumwandlung allozieren" msgstr "Konnte keine Buffer für Vorzeichenumwandlung allozieren"
@ -347,16 +347,21 @@ msgstr "Ungültiger Pin für rechten Kanal"
msgid "Cannot output both channels on the same pin" msgid "Cannot output both channels on the same pin"
msgstr "Kann nicht beite Kanäle auf dem gleichen Pin ausgeben" msgstr "Kann nicht beite Kanäle auf dem gleichen Pin ausgeben"
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:173 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:176
#: ports/atmel-samd/common-hal/pulseio/PWMOut.c:186 #: ports/atmel-samd/common-hal/pulseio/PWMOut.c:189
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c:110 #: ports/atmel-samd/common-hal/pulseio/PulseOut.c:110
msgid "All timers in use" msgid "All timers in use"
msgstr "Alle timer werden benutzt" msgstr "Alle timer werden benutzt"
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:215 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:218
msgid "All event channels in use" msgid "All event channels in use"
msgstr "Alle event Kanälre werden benutzt" msgstr "Alle event Kanälre werden benutzt"
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:297
#, c-format
msgid "Sample rate too high. It must be less than %d"
msgstr ""
#: ports/atmel-samd/common-hal/busio/I2C.c:71 #: ports/atmel-samd/common-hal/busio/I2C.c:71
msgid "Not enough pins available" msgid "Not enough pins available"
msgstr "Nicht genug Pins vorhanden" msgstr "Nicht genug Pins vorhanden"
@ -365,7 +370,7 @@ msgstr "Nicht genug Pins vorhanden"
#: ports/atmel-samd/common-hal/busio/SPI.c:132 #: ports/atmel-samd/common-hal/busio/SPI.c:132
#: ports/atmel-samd/common-hal/busio/UART.c:119 #: ports/atmel-samd/common-hal/busio/UART.c:119
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c:45 #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c:45
#: ports/nrf/common-hal/busio/I2C.c:58 #: ports/nrf/common-hal/busio/I2C.c:77
msgid "Invalid pins" msgid "Invalid pins"
msgstr "Ungültige Pins" msgstr "Ungültige Pins"
@ -385,24 +390,24 @@ msgstr "bytes mit merh als 8 bits werden nicht unterstützt"
msgid "tx and rx cannot both be None" msgid "tx and rx cannot both be None"
msgstr "tx und rx können nicht beide None sein" msgstr "tx und rx können nicht beide None sein"
#: ports/atmel-samd/common-hal/busio/UART.c:139 #: ports/atmel-samd/common-hal/busio/UART.c:145
msgid "Failed to allocate RX buffer" msgid "Failed to allocate RX buffer"
msgstr "Konnte keinen RX Buffer allozieren" msgstr "Konnte keinen RX Buffer allozieren"
#: ports/atmel-samd/common-hal/busio/UART.c:147 #: ports/atmel-samd/common-hal/busio/UART.c:153
msgid "Could not initialize UART" msgid "Could not initialize UART"
msgstr "Konnte UART nicht initialisieren" msgstr "Konnte UART nicht initialisieren"
#: ports/atmel-samd/common-hal/busio/UART.c:234 #: ports/atmel-samd/common-hal/busio/UART.c:240
msgid "No RX pin" msgid "No RX pin"
msgstr "Kein RX Pin" msgstr "Kein RX Pin"
#: ports/atmel-samd/common-hal/busio/UART.c:288 #: ports/atmel-samd/common-hal/busio/UART.c:294
msgid "No TX pin" msgid "No TX pin"
msgstr "Kein TX Pin" msgstr "Kein TX Pin"
#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c:170 #: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c:170
#: ports/nrf/common-hal/digitalio/DigitalInOut.c:153 #: ports/nrf/common-hal/digitalio/DigitalInOut.c:142
msgid "Cannot get pull while in output mode" msgid "Cannot get pull while in output mode"
msgstr "Pull up im Ausgabemodus nicht möglich" msgstr "Pull up im Ausgabemodus nicht möglich"
@ -412,12 +417,12 @@ msgid "Cannot reset into bootloader because no bootloader is present."
msgstr "Reset zum bootloader nicht möglich da bootloader nicht vorhanden" msgstr "Reset zum bootloader nicht möglich da bootloader nicht vorhanden"
#: ports/atmel-samd/common-hal/pulseio/PWMOut.c:120 #: ports/atmel-samd/common-hal/pulseio/PWMOut.c:120
#: ports/atmel-samd/common-hal/pulseio/PWMOut.c:366 #: ports/atmel-samd/common-hal/pulseio/PWMOut.c:369
#: ports/nrf/common-hal/pulseio/PWMOut.c:227 #: ports/nrf/common-hal/pulseio/PWMOut.c:227
msgid "Invalid PWM frequency" msgid "Invalid PWM frequency"
msgstr "Ungültige PWM Frequenz" msgstr "Ungültige PWM Frequenz"
#: ports/atmel-samd/common-hal/pulseio/PWMOut.c:184 #: ports/atmel-samd/common-hal/pulseio/PWMOut.c:187
msgid "All timers for this pin are in use" msgid "All timers for this pin are in use"
msgstr "Alle timer für diesen Pin werden benutzt" msgstr "Alle timer für diesen Pin werden benutzt"
@ -694,11 +699,25 @@ msgstr ""
msgid "AnalogOut functionality not supported" msgid "AnalogOut functionality not supported"
msgstr "" msgstr ""
#: ports/nrf/common-hal/busio/I2C.c:91
#, fuzzy
msgid "All I2C peripherals are in use"
msgstr "Alle timer werden benutzt"
#: ports/nrf/common-hal/busio/SPI.c:109
#, fuzzy
msgid "All SPI peripherals are in use"
msgstr "Alle timer werden benutzt"
#: ports/nrf/common-hal/busio/SPI.c:170
msgid "Baud rate too high for this SPI peripheral"
msgstr ""
#: ports/nrf/common-hal/busio/UART.c:43 ports/nrf/common-hal/busio/UART.c:47 #: ports/nrf/common-hal/busio/UART.c:43 ports/nrf/common-hal/busio/UART.c:47
#: ports/nrf/common-hal/busio/UART.c:51 ports/nrf/common-hal/busio/UART.c:60 #: ports/nrf/common-hal/busio/UART.c:51 ports/nrf/common-hal/busio/UART.c:60
#: ports/nrf/common-hal/busio/UART.c:66 ports/nrf/common-hal/busio/UART.c:71 #: ports/nrf/common-hal/busio/UART.c:66 ports/nrf/common-hal/busio/UART.c:71
#: ports/nrf/common-hal/busio/UART.c:76 ports/nrf/common-hal/busio/UART.c:81 #: ports/nrf/common-hal/busio/UART.c:76 ports/nrf/common-hal/busio/UART.c:81
#: ports/nrf/common-hal/busio/UART.c:86 #: ports/nrf/common-hal/busio/UART.c:86 ports/nrf/common-hal/busio/UART.c:90
msgid "busio.UART not yet implemented" msgid "busio.UART not yet implemented"
msgstr "" msgstr ""
@ -1969,6 +1988,7 @@ msgid "buffer must be a bytes-like object"
msgstr "" msgstr ""
#: shared-bindings/audioio/WaveFile.c:78 #: shared-bindings/audioio/WaveFile.c:78
#: shared-bindings/displayio/OnDiskBitmap.c:85
msgid "file must be a file opened in byte mode" msgid "file must be a file opened in byte mode"
msgstr "" msgstr ""
@ -2001,11 +2021,11 @@ msgstr ""
msgid "Function requires lock." msgid "Function requires lock."
msgstr "" msgstr ""
#: shared-bindings/busio/UART.c:98 #: shared-bindings/busio/UART.c:102
msgid "bits must be 7, 8 or 9" msgid "bits must be 7, 8 or 9"
msgstr "" msgstr ""
#: shared-bindings/busio/UART.c:110 #: shared-bindings/busio/UART.c:114
msgid "stop must be 1 or 2" msgid "stop must be 1 or 2"
msgstr "" msgstr ""
@ -2043,6 +2063,10 @@ msgstr ""
msgid "row data must be a buffer" msgid "row data must be a buffer"
msgstr "" msgstr ""
#: shared-bindings/displayio/ColorConverter.c:72
msgid "color should be an int"
msgstr ""
#: shared-bindings/displayio/FourWire.c:55 #: shared-bindings/displayio/FourWire.c:55
#: shared-bindings/displayio/FourWire.c:64 #: shared-bindings/displayio/FourWire.c:64
msgid "displayio is a work in progress" msgid "displayio is a work in progress"
@ -2073,17 +2097,17 @@ msgstr ""
msgid "palette_index should be an int" msgid "palette_index should be an int"
msgstr "" msgstr ""
#: shared-bindings/displayio/Sprite.c:45 #: shared-bindings/displayio/Sprite.c:48
msgid "position must be 2-tuple" msgid "position must be 2-tuple"
msgstr "" msgstr ""
#: shared-bindings/displayio/Sprite.c:87 #: shared-bindings/displayio/Sprite.c:97
#, fuzzy #, fuzzy
msgid "unsupported bitmap type" msgid "unsupported bitmap type"
msgstr "Baudrate wird nicht unterstütz" msgstr "Baudrate wird nicht unterstütz"
#: shared-bindings/displayio/Sprite.c:152 #: shared-bindings/displayio/Sprite.c:162
msgid "palette must be displayio.Palette" msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter"
msgstr "" msgstr ""
#: shared-bindings/gamepad/GamePad.c:100 #: shared-bindings/gamepad/GamePad.c:100
@ -2312,6 +2336,25 @@ msgstr ""
msgid "Group full" msgid "Group full"
msgstr "" msgstr ""
#: shared-module/displayio/Group.c:48
msgid "Group empty"
msgstr ""
#: shared-module/displayio/OnDiskBitmap.c:49
#, fuzzy
msgid "Invalid BMP file"
msgstr "Ungültiger Pin"
#: shared-module/displayio/OnDiskBitmap.c:59
#, c-format
msgid "Only Windows format, uncompressed BMP supported %d"
msgstr ""
#: shared-module/displayio/OnDiskBitmap.c:64
#, c-format
msgid "Only true color (24 bpp or higher) BMP supported %x"
msgstr ""
#: shared-module/struct/__init__.c:39 #: shared-module/struct/__init__.c:39
msgid "'S' and 'O' are not supported format types" msgid "'S' and 'O' are not supported format types"
msgstr "" msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-09-06 14:55-0700\n" "POT-Creation-Date: 2018-09-21 12:23-0400\n"
"PO-Revision-Date: 2018-07-27 11:55-0700\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -123,7 +123,7 @@ msgstr ""
msgid "queue overflow" msgid "queue overflow"
msgstr "" msgstr ""
#: extmod/moduzlib.c:97 #: extmod/moduzlib.c:98
msgid "compression header" msgid "compression header"
msgstr "" msgstr ""
@ -214,7 +214,7 @@ msgstr ""
msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgstr "" msgstr ""
#: main.c:415 #: main.c:416
msgid "soft reboot\n" msgid "soft reboot\n"
msgstr "" msgstr ""
@ -231,15 +231,15 @@ msgstr ""
msgid "calibration is out of range" msgid "calibration is out of range"
msgstr "" msgstr ""
#: ports/atmel-samd/board_busses.c:39 ports/nrf/board_busses.c:39 #: ports/atmel-samd/board_busses.c:59 ports/nrf/board_busses.c:39
msgid "No default I2C bus" msgid "No default I2C bus"
msgstr "" msgstr ""
#: ports/atmel-samd/board_busses.c:64 ports/nrf/board_busses.c:64 #: ports/atmel-samd/board_busses.c:85 ports/nrf/board_busses.c:64
msgid "No default SPI bus" msgid "No default SPI bus"
msgstr "" msgstr ""
#: ports/atmel-samd/board_busses.c:91 ports/nrf/board_busses.c:91 #: ports/atmel-samd/board_busses.c:112 ports/nrf/board_busses.c:91
msgid "No default UART bus" msgid "No default UART bus"
msgstr "" msgstr ""
@ -291,12 +291,12 @@ msgid "Too many channels in sample."
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:305 #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:305
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:326 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:339
msgid "No DMA channel found" msgid "No DMA channel found"
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:308 #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:308
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:328 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:341
msgid "Unable to allocate buffers for signed conversion" msgid "Unable to allocate buffers for signed conversion"
msgstr "" msgstr ""
@ -338,16 +338,21 @@ msgstr ""
msgid "Cannot output both channels on the same pin" msgid "Cannot output both channels on the same pin"
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:173 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:176
#: ports/atmel-samd/common-hal/pulseio/PWMOut.c:186 #: ports/atmel-samd/common-hal/pulseio/PWMOut.c:189
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c:110 #: ports/atmel-samd/common-hal/pulseio/PulseOut.c:110
msgid "All timers in use" msgid "All timers in use"
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:215 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:218
msgid "All event channels in use" msgid "All event channels in use"
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:297
#, c-format
msgid "Sample rate too high. It must be less than %d"
msgstr ""
#: ports/atmel-samd/common-hal/busio/I2C.c:71 #: ports/atmel-samd/common-hal/busio/I2C.c:71
msgid "Not enough pins available" msgid "Not enough pins available"
msgstr "" msgstr ""
@ -356,7 +361,7 @@ msgstr ""
#: ports/atmel-samd/common-hal/busio/SPI.c:132 #: ports/atmel-samd/common-hal/busio/SPI.c:132
#: ports/atmel-samd/common-hal/busio/UART.c:119 #: ports/atmel-samd/common-hal/busio/UART.c:119
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c:45 #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c:45
#: ports/nrf/common-hal/busio/I2C.c:58 #: ports/nrf/common-hal/busio/I2C.c:77
msgid "Invalid pins" msgid "Invalid pins"
msgstr "" msgstr ""
@ -376,24 +381,24 @@ msgstr ""
msgid "tx and rx cannot both be None" msgid "tx and rx cannot both be None"
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/busio/UART.c:139 #: ports/atmel-samd/common-hal/busio/UART.c:145
msgid "Failed to allocate RX buffer" msgid "Failed to allocate RX buffer"
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/busio/UART.c:147 #: ports/atmel-samd/common-hal/busio/UART.c:153
msgid "Could not initialize UART" msgid "Could not initialize UART"
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/busio/UART.c:234 #: ports/atmel-samd/common-hal/busio/UART.c:240
msgid "No RX pin" msgid "No RX pin"
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/busio/UART.c:288 #: ports/atmel-samd/common-hal/busio/UART.c:294
msgid "No TX pin" msgid "No TX pin"
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c:170 #: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c:170
#: ports/nrf/common-hal/digitalio/DigitalInOut.c:153 #: ports/nrf/common-hal/digitalio/DigitalInOut.c:142
msgid "Cannot get pull while in output mode" msgid "Cannot get pull while in output mode"
msgstr "" msgstr ""
@ -403,12 +408,12 @@ msgid "Cannot reset into bootloader because no bootloader is present."
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/pulseio/PWMOut.c:120 #: ports/atmel-samd/common-hal/pulseio/PWMOut.c:120
#: ports/atmel-samd/common-hal/pulseio/PWMOut.c:366 #: ports/atmel-samd/common-hal/pulseio/PWMOut.c:369
#: ports/nrf/common-hal/pulseio/PWMOut.c:227 #: ports/nrf/common-hal/pulseio/PWMOut.c:227
msgid "Invalid PWM frequency" msgid "Invalid PWM frequency"
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/pulseio/PWMOut.c:184 #: ports/atmel-samd/common-hal/pulseio/PWMOut.c:187
msgid "All timers for this pin are in use" msgid "All timers for this pin are in use"
msgstr "" msgstr ""
@ -685,11 +690,23 @@ msgstr ""
msgid "AnalogOut functionality not supported" msgid "AnalogOut functionality not supported"
msgstr "" msgstr ""
#: ports/nrf/common-hal/busio/I2C.c:91
msgid "All I2C peripherals are in use"
msgstr ""
#: ports/nrf/common-hal/busio/SPI.c:109
msgid "All SPI peripherals are in use"
msgstr ""
#: ports/nrf/common-hal/busio/SPI.c:170
msgid "Baud rate too high for this SPI peripheral"
msgstr ""
#: ports/nrf/common-hal/busio/UART.c:43 ports/nrf/common-hal/busio/UART.c:47 #: ports/nrf/common-hal/busio/UART.c:43 ports/nrf/common-hal/busio/UART.c:47
#: ports/nrf/common-hal/busio/UART.c:51 ports/nrf/common-hal/busio/UART.c:60 #: ports/nrf/common-hal/busio/UART.c:51 ports/nrf/common-hal/busio/UART.c:60
#: ports/nrf/common-hal/busio/UART.c:66 ports/nrf/common-hal/busio/UART.c:71 #: ports/nrf/common-hal/busio/UART.c:66 ports/nrf/common-hal/busio/UART.c:71
#: ports/nrf/common-hal/busio/UART.c:76 ports/nrf/common-hal/busio/UART.c:81 #: ports/nrf/common-hal/busio/UART.c:76 ports/nrf/common-hal/busio/UART.c:81
#: ports/nrf/common-hal/busio/UART.c:86 #: ports/nrf/common-hal/busio/UART.c:86 ports/nrf/common-hal/busio/UART.c:90
msgid "busio.UART not yet implemented" msgid "busio.UART not yet implemented"
msgstr "" msgstr ""
@ -1960,6 +1977,7 @@ msgid "buffer must be a bytes-like object"
msgstr "" msgstr ""
#: shared-bindings/audioio/WaveFile.c:78 #: shared-bindings/audioio/WaveFile.c:78
#: shared-bindings/displayio/OnDiskBitmap.c:85
msgid "file must be a file opened in byte mode" msgid "file must be a file opened in byte mode"
msgstr "" msgstr ""
@ -1992,11 +2010,11 @@ msgstr ""
msgid "Function requires lock." msgid "Function requires lock."
msgstr "" msgstr ""
#: shared-bindings/busio/UART.c:98 #: shared-bindings/busio/UART.c:102
msgid "bits must be 7, 8 or 9" msgid "bits must be 7, 8 or 9"
msgstr "" msgstr ""
#: shared-bindings/busio/UART.c:110 #: shared-bindings/busio/UART.c:114
msgid "stop must be 1 or 2" msgid "stop must be 1 or 2"
msgstr "" msgstr ""
@ -2034,6 +2052,10 @@ msgstr ""
msgid "row data must be a buffer" msgid "row data must be a buffer"
msgstr "" msgstr ""
#: shared-bindings/displayio/ColorConverter.c:72
msgid "color should be an int"
msgstr ""
#: shared-bindings/displayio/FourWire.c:55 #: shared-bindings/displayio/FourWire.c:55
#: shared-bindings/displayio/FourWire.c:64 #: shared-bindings/displayio/FourWire.c:64
msgid "displayio is a work in progress" msgid "displayio is a work in progress"
@ -2064,16 +2086,16 @@ msgstr ""
msgid "palette_index should be an int" msgid "palette_index should be an int"
msgstr "" msgstr ""
#: shared-bindings/displayio/Sprite.c:45 #: shared-bindings/displayio/Sprite.c:48
msgid "position must be 2-tuple" msgid "position must be 2-tuple"
msgstr "" msgstr ""
#: shared-bindings/displayio/Sprite.c:87 #: shared-bindings/displayio/Sprite.c:97
msgid "unsupported bitmap type" msgid "unsupported bitmap type"
msgstr "" msgstr ""
#: shared-bindings/displayio/Sprite.c:152 #: shared-bindings/displayio/Sprite.c:162
msgid "palette must be displayio.Palette" msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter"
msgstr "" msgstr ""
#: shared-bindings/gamepad/GamePad.c:100 #: shared-bindings/gamepad/GamePad.c:100
@ -2302,6 +2324,24 @@ msgstr ""
msgid "Group full" msgid "Group full"
msgstr "" msgstr ""
#: shared-module/displayio/Group.c:48
msgid "Group empty"
msgstr ""
#: shared-module/displayio/OnDiskBitmap.c:49
msgid "Invalid BMP file"
msgstr ""
#: shared-module/displayio/OnDiskBitmap.c:59
#, c-format
msgid "Only Windows format, uncompressed BMP supported %d"
msgstr ""
#: shared-module/displayio/OnDiskBitmap.c:64
#, c-format
msgid "Only true color (24 bpp or higher) BMP supported %x"
msgstr ""
#: shared-module/struct/__init__.c:39 #: shared-module/struct/__init__.c:39
msgid "'S' and 'O' are not supported format types" msgid "'S' and 'O' are not supported format types"
msgstr "" msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-09-06 14:55-0700\n" "POT-Creation-Date: 2018-09-21 12:23-0400\n"
"PO-Revision-Date: 2018-08-24 22:56-0500\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -123,7 +123,7 @@ msgstr "certificado inválido"
msgid "queue overflow" msgid "queue overflow"
msgstr "desborde de queue" msgstr "desborde de queue"
#: extmod/moduzlib.c:97 #: extmod/moduzlib.c:98
msgid "compression header" msgid "compression header"
msgstr "encabezado de compresión" msgstr "encabezado de compresión"
@ -229,47 +229,47 @@ msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgstr "" msgstr ""
"Presiona cualquier tecla para entrar al REPL. Usa CTRL-D para recargar." "Presiona cualquier tecla para entrar al REPL. Usa CTRL-D para recargar."
#: main.c:415 #: main.c:416
msgid "soft reboot\n" msgid "soft reboot\n"
msgstr "reinicio suave\n" msgstr "reinicio suave\n"
#: ports/atmel-samd/audio_dma.c:285 #: ports/atmel-samd/audio_dma.c:285
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c:361 #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c:361
msgid "All sync event channels in use" msgid "All sync event channels in use"
msgstr "" msgstr "Todos los sync event channels están siendo utilizados"
#: ports/atmel-samd/bindings/samd/Clock.c:135 #: ports/atmel-samd/bindings/samd/Clock.c:135
msgid "calibration is read only" msgid "calibration is read only"
msgstr "" msgstr "calibration es de solo lectura"
#: ports/atmel-samd/bindings/samd/Clock.c:137 #: ports/atmel-samd/bindings/samd/Clock.c:137
msgid "calibration is out of range" msgid "calibration is out of range"
msgstr "" msgstr "calibration esta fuera de rango"
#: ports/atmel-samd/board_busses.c:39 ports/nrf/board_busses.c:39 #: ports/atmel-samd/board_busses.c:59 ports/nrf/board_busses.c:39
msgid "No default I2C bus" msgid "No default I2C bus"
msgstr "" msgstr "Sin bus I2C por default"
#: ports/atmel-samd/board_busses.c:64 ports/nrf/board_busses.c:64 #: ports/atmel-samd/board_busses.c:85 ports/nrf/board_busses.c:64
msgid "No default SPI bus" msgid "No default SPI bus"
msgstr "" msgstr "Sin bus SPI por default"
#: ports/atmel-samd/board_busses.c:91 ports/nrf/board_busses.c:91 #: ports/atmel-samd/board_busses.c:112 ports/nrf/board_busses.c:91
msgid "No default UART bus" msgid "No default UART bus"
msgstr "" msgstr "Sin bus UART por default"
#: ports/atmel-samd/common-hal/analogio/AnalogIn.c:63 #: ports/atmel-samd/common-hal/analogio/AnalogIn.c:63
#: ports/nrf/common-hal/analogio/AnalogIn.c:39 #: ports/nrf/common-hal/analogio/AnalogIn.c:39
msgid "Pin does not have ADC capabilities" msgid "Pin does not have ADC capabilities"
msgstr "" msgstr "pin no tiene capacidades ADC"
#: ports/atmel-samd/common-hal/analogio/AnalogOut.c:49 #: ports/atmel-samd/common-hal/analogio/AnalogOut.c:49
msgid "No DAC on chip" msgid "No DAC on chip"
msgstr "" msgstr "El chip no tiene DAC"
#: ports/atmel-samd/common-hal/analogio/AnalogOut.c:56 #: ports/atmel-samd/common-hal/analogio/AnalogOut.c:56
msgid "AnalogOut not supported on given pin" msgid "AnalogOut not supported on given pin"
msgstr "AnalogOut no es soportado por el pin dado" msgstr "El pin proporcionado no soporta AnalogOut"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:147 #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:147
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:150 #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:150
@ -277,25 +277,24 @@ msgid "Invalid bit clock pin"
msgstr "Pin bit clock inválido" msgstr "Pin bit clock inválido"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:153 #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:153
#, fuzzy
msgid "Bit clock and word select must share a clock unit" msgid "Bit clock and word select must share a clock unit"
msgstr "Bit clock y Word select deben compartir la unidad de reloj" msgstr "Bit clock y Word select deben compartir la unidad de reloj"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:156 #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:156
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c:130 #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c:130
msgid "Invalid data pin" msgid "Invalid data pin"
msgstr "" msgstr "Pin de datos inválido"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:169 #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:169
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:174 #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:174
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c:145 #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c:145
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c:150 #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c:150
msgid "Serializer in use" msgid "Serializer in use"
msgstr "" msgstr "Serializer está siendo utilizado"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:230 #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:230
msgid "Clock unit in use" msgid "Clock unit in use"
msgstr "" msgstr "Clock unit está siendo utilizado"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:240 #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:240
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c:172 #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c:172
@ -304,21 +303,21 @@ msgstr "No se pudo encontrar un GCLK disponible"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:254 #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:254
msgid "Too many channels in sample." msgid "Too many channels in sample."
msgstr "" msgstr "Demasiados canales en sample"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:305 #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:305
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:326 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:339
msgid "No DMA channel found" msgid "No DMA channel found"
msgstr "" msgstr "No se encontró el canal DMA"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:308 #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:308
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:328 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:341
msgid "Unable to allocate buffers for signed conversion" msgid "Unable to allocate buffers for signed conversion"
msgstr "No se pudieron asignar buffers para la conversión con signo" msgstr "No se pudieron asignar buffers para la conversión con signo"
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c:109 #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c:109
msgid "Invalid clock pin" msgid "Invalid clock pin"
msgstr "pin clock inválido" msgstr "Pin clock inválido"
#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c:134 #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c:134
msgid "Only 8 or 16 bit mono with " msgid "Only 8 or 16 bit mono with "
@ -330,7 +329,7 @@ msgstr "velocidad de muestreo fuera de rango"
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:69 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:69
msgid "DAC already in use" msgid "DAC already in use"
msgstr "" msgstr "DAC ya está siendo utilizado"
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:73 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:73
msgid "Right channel unsupported" msgid "Right channel unsupported"
@ -354,15 +353,20 @@ msgstr ""
msgid "Cannot output both channels on the same pin" msgid "Cannot output both channels on the same pin"
msgstr "No es posible utilizar el mismo pin para ambos canales" msgstr "No es posible utilizar el mismo pin para ambos canales"
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:173 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:176
#: ports/atmel-samd/common-hal/pulseio/PWMOut.c:186 #: ports/atmel-samd/common-hal/pulseio/PWMOut.c:189
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c:110 #: ports/atmel-samd/common-hal/pulseio/PulseOut.c:110
msgid "All timers in use" msgid "All timers in use"
msgstr "Todos los timers estan siendo utilizados" msgstr "Todos los timers están siendo utilizados"
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:215 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:218
msgid "All event channels in use" msgid "All event channels in use"
msgstr "Todos los canales de eventos estan siendo utilizados" msgstr "Todos los canales de eventos están siendo utilizados"
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:297
#, c-format
msgid "Sample rate too high. It must be less than %d"
msgstr ""
#: ports/atmel-samd/common-hal/busio/I2C.c:71 #: ports/atmel-samd/common-hal/busio/I2C.c:71
msgid "Not enough pins available" msgid "Not enough pins available"
@ -372,7 +376,7 @@ msgstr "No hay suficientes pines disponibles"
#: ports/atmel-samd/common-hal/busio/SPI.c:132 #: ports/atmel-samd/common-hal/busio/SPI.c:132
#: ports/atmel-samd/common-hal/busio/UART.c:119 #: ports/atmel-samd/common-hal/busio/UART.c:119
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c:45 #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c:45
#: ports/nrf/common-hal/busio/I2C.c:58 #: ports/nrf/common-hal/busio/I2C.c:77
msgid "Invalid pins" msgid "Invalid pins"
msgstr "pines inválidos" msgstr "pines inválidos"
@ -392,24 +396,24 @@ msgstr "bytes > 8 bits no son soportados"
msgid "tx and rx cannot both be None" msgid "tx and rx cannot both be None"
msgstr "tx y rx no pueden ser ambos None" msgstr "tx y rx no pueden ser ambos None"
#: ports/atmel-samd/common-hal/busio/UART.c:139 #: ports/atmel-samd/common-hal/busio/UART.c:145
msgid "Failed to allocate RX buffer" msgid "Failed to allocate RX buffer"
msgstr "Fallo la asignación del buffer RX" msgstr "Fallo la asignación del buffer RX"
#: ports/atmel-samd/common-hal/busio/UART.c:147 #: ports/atmel-samd/common-hal/busio/UART.c:153
msgid "Could not initialize UART" msgid "Could not initialize UART"
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/busio/UART.c:234 #: ports/atmel-samd/common-hal/busio/UART.c:240
msgid "No RX pin" msgid "No RX pin"
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/busio/UART.c:288 #: ports/atmel-samd/common-hal/busio/UART.c:294
msgid "No TX pin" msgid "No TX pin"
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c:170 #: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c:170
#: ports/nrf/common-hal/digitalio/DigitalInOut.c:153 #: ports/nrf/common-hal/digitalio/DigitalInOut.c:142
msgid "Cannot get pull while in output mode" msgid "Cannot get pull while in output mode"
msgstr "" msgstr ""
@ -419,14 +423,14 @@ msgid "Cannot reset into bootloader because no bootloader is present."
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/pulseio/PWMOut.c:120 #: ports/atmel-samd/common-hal/pulseio/PWMOut.c:120
#: ports/atmel-samd/common-hal/pulseio/PWMOut.c:366 #: ports/atmel-samd/common-hal/pulseio/PWMOut.c:369
#: ports/nrf/common-hal/pulseio/PWMOut.c:227 #: ports/nrf/common-hal/pulseio/PWMOut.c:227
msgid "Invalid PWM frequency" msgid "Invalid PWM frequency"
msgstr "" msgstr ""
#: ports/atmel-samd/common-hal/pulseio/PWMOut.c:184 #: ports/atmel-samd/common-hal/pulseio/PWMOut.c:187
msgid "All timers for this pin are in use" msgid "All timers for this pin are in use"
msgstr "Todos los timers para este pin están siendo utilizado" msgstr "Todos los timers para este pin están siendo utilizados"
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c:110 #: ports/atmel-samd/common-hal/pulseio/PulseIn.c:110
msgid "No hardware support on pin" msgid "No hardware support on pin"
@ -434,7 +438,7 @@ msgstr ""
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c:113 #: ports/atmel-samd/common-hal/pulseio/PulseIn.c:113
msgid "EXTINT channel already in use" msgid "EXTINT channel already in use"
msgstr "El canal EXTINT ya esta siendo usado" msgstr "El canal EXTINT ya está siendo utilizado"
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c:118 #: ports/atmel-samd/common-hal/pulseio/PulseIn.c:118
#: ports/esp8266/common-hal/pulseio/PulseIn.c:86 #: ports/esp8266/common-hal/pulseio/PulseIn.c:86
@ -461,9 +465,8 @@ msgid "Both pins must support hardware interrupts"
msgstr "Ambos pines deben soportar interrupciones por hardware" msgstr "Ambos pines deben soportar interrupciones por hardware"
#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c:46 #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c:46
#, fuzzy
msgid "A hardware interrupt channel is already in use" msgid "A hardware interrupt channel is already in use"
msgstr "El canal EXTINT ya esta siendo usado" msgstr "El canal EXTINT ya está siendo utilizado"
#: ports/atmel-samd/common-hal/rtc/RTC.c:101 #: ports/atmel-samd/common-hal/rtc/RTC.c:101
msgid "calibration value out of range +/-127" msgid "calibration value out of range +/-127"
@ -703,11 +706,23 @@ msgstr ""
msgid "AnalogOut functionality not supported" msgid "AnalogOut functionality not supported"
msgstr "" msgstr ""
#: ports/nrf/common-hal/busio/I2C.c:91
msgid "All I2C peripherals are in use"
msgstr "Todos los timers están siendo utilizados"
#: ports/nrf/common-hal/busio/SPI.c:109
msgid "All SPI peripherals are in use"
msgstr "Todos los timers están siendo utilizados"
#: ports/nrf/common-hal/busio/SPI.c:170
msgid "Baud rate too high for this SPI peripheral"
msgstr ""
#: ports/nrf/common-hal/busio/UART.c:43 ports/nrf/common-hal/busio/UART.c:47 #: ports/nrf/common-hal/busio/UART.c:43 ports/nrf/common-hal/busio/UART.c:47
#: ports/nrf/common-hal/busio/UART.c:51 ports/nrf/common-hal/busio/UART.c:60 #: ports/nrf/common-hal/busio/UART.c:51 ports/nrf/common-hal/busio/UART.c:60
#: ports/nrf/common-hal/busio/UART.c:66 ports/nrf/common-hal/busio/UART.c:71 #: ports/nrf/common-hal/busio/UART.c:66 ports/nrf/common-hal/busio/UART.c:71
#: ports/nrf/common-hal/busio/UART.c:76 ports/nrf/common-hal/busio/UART.c:81 #: ports/nrf/common-hal/busio/UART.c:76 ports/nrf/common-hal/busio/UART.c:81
#: ports/nrf/common-hal/busio/UART.c:86 #: ports/nrf/common-hal/busio/UART.c:86 ports/nrf/common-hal/busio/UART.c:90
msgid "busio.UART not yet implemented" msgid "busio.UART not yet implemented"
msgstr "" msgstr ""
@ -2005,6 +2020,7 @@ msgid "buffer must be a bytes-like object"
msgstr "" msgstr ""
#: shared-bindings/audioio/WaveFile.c:78 #: shared-bindings/audioio/WaveFile.c:78
#: shared-bindings/displayio/OnDiskBitmap.c:85
msgid "file must be a file opened in byte mode" msgid "file must be a file opened in byte mode"
msgstr "" msgstr ""
@ -2037,11 +2053,11 @@ msgstr ""
msgid "Function requires lock." msgid "Function requires lock."
msgstr "" msgstr ""
#: shared-bindings/busio/UART.c:98 #: shared-bindings/busio/UART.c:102
msgid "bits must be 7, 8 or 9" msgid "bits must be 7, 8 or 9"
msgstr "" msgstr ""
#: shared-bindings/busio/UART.c:110 #: shared-bindings/busio/UART.c:114
msgid "stop must be 1 or 2" msgid "stop must be 1 or 2"
msgstr "" msgstr ""
@ -2080,6 +2096,10 @@ msgstr ""
msgid "row data must be a buffer" msgid "row data must be a buffer"
msgstr "" msgstr ""
#: shared-bindings/displayio/ColorConverter.c:72
msgid "color should be an int"
msgstr ""
#: shared-bindings/displayio/FourWire.c:55 #: shared-bindings/displayio/FourWire.c:55
#: shared-bindings/displayio/FourWire.c:64 #: shared-bindings/displayio/FourWire.c:64
msgid "displayio is a work in progress" msgid "displayio is a work in progress"
@ -2110,16 +2130,16 @@ msgstr ""
msgid "palette_index should be an int" msgid "palette_index should be an int"
msgstr "" msgstr ""
#: shared-bindings/displayio/Sprite.c:45 #: shared-bindings/displayio/Sprite.c:48
msgid "position must be 2-tuple" msgid "position must be 2-tuple"
msgstr "" msgstr ""
#: shared-bindings/displayio/Sprite.c:87 #: shared-bindings/displayio/Sprite.c:97
msgid "unsupported bitmap type" msgid "unsupported bitmap type"
msgstr "" msgstr ""
#: shared-bindings/displayio/Sprite.c:152 #: shared-bindings/displayio/Sprite.c:162
msgid "palette must be displayio.Palette" msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter"
msgstr "" msgstr ""
#: shared-bindings/gamepad/GamePad.c:100 #: shared-bindings/gamepad/GamePad.c:100
@ -2150,7 +2170,7 @@ msgstr ""
#: shared-bindings/microcontroller/Pin.c:100 #: shared-bindings/microcontroller/Pin.c:100
msgid "%q in use" msgid "%q in use"
msgstr "" msgstr "%q está siendo utilizado"
#: shared-bindings/microcontroller/__init__.c:126 #: shared-bindings/microcontroller/__init__.c:126
msgid "Invalid run mode." msgid "Invalid run mode."
@ -2349,6 +2369,26 @@ msgstr ""
msgid "Group full" msgid "Group full"
msgstr "" msgstr ""
#: shared-module/displayio/Group.c:48
#, fuzzy
msgid "Group empty"
msgstr "heap vacío"
#: shared-module/displayio/OnDiskBitmap.c:49
#, fuzzy
msgid "Invalid BMP file"
msgstr "pin inválido"
#: shared-module/displayio/OnDiskBitmap.c:59
#, c-format
msgid "Only Windows format, uncompressed BMP supported %d"
msgstr ""
#: shared-module/displayio/OnDiskBitmap.c:64
#, c-format
msgid "Only true color (24 bpp or higher) BMP supported %x"
msgstr ""
#: shared-module/struct/__init__.c:39 #: shared-module/struct/__init__.c:39
msgid "'S' and 'O' are not supported format types" msgid "'S' and 'O' are not supported format types"
msgstr "" msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-09-06 14:55-0700\n" "POT-Creation-Date: 2018-09-21 12:23-0400\n"
"PO-Revision-Date: 2018-08-30 23:04-0700\n" "PO-Revision-Date: 2018-08-30 23:04-0700\n"
"Last-Translator: Timothy <me@timothygarcia.ca>\n" "Last-Translator: Timothy <me@timothygarcia.ca>\n"
"Language-Team: fil\n" "Language-Team: fil\n"
@ -123,7 +123,7 @@ msgstr "mali ang cert"
msgid "queue overflow" msgid "queue overflow"
msgstr "puno na ang pila (overflow)" msgstr "puno na ang pila (overflow)"
#: extmod/moduzlib.c:97 #: extmod/moduzlib.c:98
msgid "compression header" msgid "compression header"
msgstr "compression header" msgstr "compression header"
@ -226,7 +226,7 @@ msgstr ""
"Pindutin ang anumang key upang ipasok ang REPL. Gamitin ang CTRL-D upang i-" "Pindutin ang anumang key upang ipasok ang REPL. Gamitin ang CTRL-D upang i-"
"reload." "reload."
#: main.c:415 #: main.c:416
msgid "soft reboot\n" msgid "soft reboot\n"
msgstr "malambot na reboot\n" msgstr "malambot na reboot\n"
@ -243,15 +243,15 @@ msgstr "pagkakalibrate ay basahin lamang"
msgid "calibration is out of range" msgid "calibration is out of range"
msgstr "kalibrasion ay wala sa sakop" msgstr "kalibrasion ay wala sa sakop"
#: ports/atmel-samd/board_busses.c:39 ports/nrf/board_busses.c:39 #: ports/atmel-samd/board_busses.c:59 ports/nrf/board_busses.c:39
msgid "No default I2C bus" msgid "No default I2C bus"
msgstr "Walang default na I2C bus" msgstr "Walang default na I2C bus"
#: ports/atmel-samd/board_busses.c:64 ports/nrf/board_busses.c:64 #: ports/atmel-samd/board_busses.c:85 ports/nrf/board_busses.c:64
msgid "No default SPI bus" msgid "No default SPI bus"
msgstr "Walang default SPI bus" msgstr "Walang default SPI bus"
#: ports/atmel-samd/board_busses.c:91 ports/nrf/board_busses.c:91 #: ports/atmel-samd/board_busses.c:112 ports/nrf/board_busses.c:91
msgid "No default UART bus" msgid "No default UART bus"
msgstr "Walang default UART bus" msgstr "Walang default UART bus"
@ -303,12 +303,12 @@ msgid "Too many channels in sample."
msgstr "Sobra ang channels sa sample." msgstr "Sobra ang channels sa sample."
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:305 #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:305
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:326 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:339
msgid "No DMA channel found" msgid "No DMA channel found"
msgstr "Walang DMA channel na mahanap" msgstr "Walang DMA channel na mahanap"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:308 #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:308
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:328 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:341
msgid "Unable to allocate buffers for signed conversion" msgid "Unable to allocate buffers for signed conversion"
msgstr "Hindi ma-allocate ang buffers para sa naka-sign na conversion" msgstr "Hindi ma-allocate ang buffers para sa naka-sign na conversion"
@ -350,16 +350,21 @@ msgstr "Mali ang pin para sa kanang channel"
msgid "Cannot output both channels on the same pin" msgid "Cannot output both channels on the same pin"
msgstr "Hindi maaaring output ang mga parehong channel sa parehong pin" msgstr "Hindi maaaring output ang mga parehong channel sa parehong pin"
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:173 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:176
#: ports/atmel-samd/common-hal/pulseio/PWMOut.c:186 #: ports/atmel-samd/common-hal/pulseio/PWMOut.c:189
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c:110 #: ports/atmel-samd/common-hal/pulseio/PulseOut.c:110
msgid "All timers in use" msgid "All timers in use"
msgstr "Lahat ng timer ginagamit" msgstr "Lahat ng timer ginagamit"
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:215 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:218
msgid "All event channels in use" msgid "All event channels in use"
msgstr "Lahat ng event channels ginagamit" msgstr "Lahat ng event channels ginagamit"
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:297
#, c-format
msgid "Sample rate too high. It must be less than %d"
msgstr ""
#: ports/atmel-samd/common-hal/busio/I2C.c:71 #: ports/atmel-samd/common-hal/busio/I2C.c:71
msgid "Not enough pins available" msgid "Not enough pins available"
msgstr "Hindi sapat ang magagamit na pins" msgstr "Hindi sapat ang magagamit na pins"
@ -368,7 +373,7 @@ msgstr "Hindi sapat ang magagamit na pins"
#: ports/atmel-samd/common-hal/busio/SPI.c:132 #: ports/atmel-samd/common-hal/busio/SPI.c:132
#: ports/atmel-samd/common-hal/busio/UART.c:119 #: ports/atmel-samd/common-hal/busio/UART.c:119
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c:45 #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c:45
#: ports/nrf/common-hal/busio/I2C.c:58 #: ports/nrf/common-hal/busio/I2C.c:77
msgid "Invalid pins" msgid "Invalid pins"
msgstr "Mali ang pins" msgstr "Mali ang pins"
@ -388,24 +393,24 @@ msgstr "hindi sinusuportahan ang bytes > 8 bits"
msgid "tx and rx cannot both be None" msgid "tx and rx cannot both be None"
msgstr "tx at rx hindi pwedeng parehas na None" msgstr "tx at rx hindi pwedeng parehas na None"
#: ports/atmel-samd/common-hal/busio/UART.c:139 #: ports/atmel-samd/common-hal/busio/UART.c:145
msgid "Failed to allocate RX buffer" msgid "Failed to allocate RX buffer"
msgstr "Nabigong ilaan ang RX buffer" msgstr "Nabigong ilaan ang RX buffer"
#: ports/atmel-samd/common-hal/busio/UART.c:147 #: ports/atmel-samd/common-hal/busio/UART.c:153
msgid "Could not initialize UART" msgid "Could not initialize UART"
msgstr "Hindi ma-initialize ang UART" msgstr "Hindi ma-initialize ang UART"
#: ports/atmel-samd/common-hal/busio/UART.c:234 #: ports/atmel-samd/common-hal/busio/UART.c:240
msgid "No RX pin" msgid "No RX pin"
msgstr "Walang RX pin" msgstr "Walang RX pin"
#: ports/atmel-samd/common-hal/busio/UART.c:288 #: ports/atmel-samd/common-hal/busio/UART.c:294
msgid "No TX pin" msgid "No TX pin"
msgstr "Walang TX pin" msgstr "Walang TX pin"
#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c:170 #: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c:170
#: ports/nrf/common-hal/digitalio/DigitalInOut.c:153 #: ports/nrf/common-hal/digitalio/DigitalInOut.c:142
msgid "Cannot get pull while in output mode" msgid "Cannot get pull while in output mode"
msgstr "Hindi makakakuha ng pull habang nasa output mode" msgstr "Hindi makakakuha ng pull habang nasa output mode"
@ -415,12 +420,12 @@ msgid "Cannot reset into bootloader because no bootloader is present."
msgstr "Hindi ma-reset sa bootloader dahil walang bootloader." msgstr "Hindi ma-reset sa bootloader dahil walang bootloader."
#: ports/atmel-samd/common-hal/pulseio/PWMOut.c:120 #: ports/atmel-samd/common-hal/pulseio/PWMOut.c:120
#: ports/atmel-samd/common-hal/pulseio/PWMOut.c:366 #: ports/atmel-samd/common-hal/pulseio/PWMOut.c:369
#: ports/nrf/common-hal/pulseio/PWMOut.c:227 #: ports/nrf/common-hal/pulseio/PWMOut.c:227
msgid "Invalid PWM frequency" msgid "Invalid PWM frequency"
msgstr "Mali ang PWM frequency" msgstr "Mali ang PWM frequency"
#: ports/atmel-samd/common-hal/pulseio/PWMOut.c:184 #: ports/atmel-samd/common-hal/pulseio/PWMOut.c:187
msgid "All timers for this pin are in use" msgid "All timers for this pin are in use"
msgstr "Lahat ng timers para sa pin na ito ay ginagamit" msgstr "Lahat ng timers para sa pin na ito ay ginagamit"
@ -700,11 +705,25 @@ msgstr "hindi alam na config param"
msgid "AnalogOut functionality not supported" msgid "AnalogOut functionality not supported"
msgstr "Hindi supportado ang AnalogOut" msgstr "Hindi supportado ang AnalogOut"
#: ports/nrf/common-hal/busio/I2C.c:91
#, fuzzy
msgid "All I2C peripherals are in use"
msgstr "Lahat ng timer ginagamit"
#: ports/nrf/common-hal/busio/SPI.c:109
#, fuzzy
msgid "All SPI peripherals are in use"
msgstr "Lahat ng timer ginagamit"
#: ports/nrf/common-hal/busio/SPI.c:170
msgid "Baud rate too high for this SPI peripheral"
msgstr ""
#: ports/nrf/common-hal/busio/UART.c:43 ports/nrf/common-hal/busio/UART.c:47 #: ports/nrf/common-hal/busio/UART.c:43 ports/nrf/common-hal/busio/UART.c:47
#: ports/nrf/common-hal/busio/UART.c:51 ports/nrf/common-hal/busio/UART.c:60 #: ports/nrf/common-hal/busio/UART.c:51 ports/nrf/common-hal/busio/UART.c:60
#: ports/nrf/common-hal/busio/UART.c:66 ports/nrf/common-hal/busio/UART.c:71 #: ports/nrf/common-hal/busio/UART.c:66 ports/nrf/common-hal/busio/UART.c:71
#: ports/nrf/common-hal/busio/UART.c:76 ports/nrf/common-hal/busio/UART.c:81 #: ports/nrf/common-hal/busio/UART.c:76 ports/nrf/common-hal/busio/UART.c:81
#: ports/nrf/common-hal/busio/UART.c:86 #: ports/nrf/common-hal/busio/UART.c:86 ports/nrf/common-hal/busio/UART.c:90
msgid "busio.UART not yet implemented" msgid "busio.UART not yet implemented"
msgstr "hindi pa implemented ang busio.UART" msgstr "hindi pa implemented ang busio.UART"
@ -1998,6 +2017,7 @@ msgid "buffer must be a bytes-like object"
msgstr "buffer ay dapat bytes-like object" msgstr "buffer ay dapat bytes-like object"
#: shared-bindings/audioio/WaveFile.c:78 #: shared-bindings/audioio/WaveFile.c:78
#: shared-bindings/displayio/OnDiskBitmap.c:85
msgid "file must be a file opened in byte mode" msgid "file must be a file opened in byte mode"
msgstr "file ay dapat buksan sa byte mode" msgstr "file ay dapat buksan sa byte mode"
@ -2030,11 +2050,11 @@ msgstr "aarehas na haba dapat ang buffer slices"
msgid "Function requires lock." msgid "Function requires lock."
msgstr "Kailangan ng lock ang function." msgstr "Kailangan ng lock ang function."
#: shared-bindings/busio/UART.c:98 #: shared-bindings/busio/UART.c:102
msgid "bits must be 7, 8 or 9" msgid "bits must be 7, 8 or 9"
msgstr "bits ay dapat 7, 8 o 9" msgstr "bits ay dapat 7, 8 o 9"
#: shared-bindings/busio/UART.c:110 #: shared-bindings/busio/UART.c:114
msgid "stop must be 1 or 2" msgid "stop must be 1 or 2"
msgstr "stop dapat 1 o 2" msgstr "stop dapat 1 o 2"
@ -2077,6 +2097,11 @@ msgstr ""
msgid "row data must be a buffer" msgid "row data must be a buffer"
msgstr "constant ay dapat na integer" msgstr "constant ay dapat na integer"
#: shared-bindings/displayio/ColorConverter.c:72
#, fuzzy
msgid "color should be an int"
msgstr "Haba ay dapat int"
#: shared-bindings/displayio/FourWire.c:55 #: shared-bindings/displayio/FourWire.c:55
#: shared-bindings/displayio/FourWire.c:64 #: shared-bindings/displayio/FourWire.c:64
msgid "displayio is a work in progress" msgid "displayio is a work in progress"
@ -2113,20 +2138,19 @@ msgstr "buffer ay dapat bytes-like object"
msgid "palette_index should be an int" msgid "palette_index should be an int"
msgstr "" msgstr ""
#: shared-bindings/displayio/Sprite.c:45 #: shared-bindings/displayio/Sprite.c:48
#, fuzzy #, fuzzy
msgid "position must be 2-tuple" msgid "position must be 2-tuple"
msgstr "stop dapat 1 o 2" msgstr "stop dapat 1 o 2"
#: shared-bindings/displayio/Sprite.c:87 #: shared-bindings/displayio/Sprite.c:97
#, fuzzy #, fuzzy
msgid "unsupported bitmap type" msgid "unsupported bitmap type"
msgstr "Hindi supportadong baudrate" msgstr "Hindi supportadong baudrate"
#: shared-bindings/displayio/Sprite.c:152 #: shared-bindings/displayio/Sprite.c:162
#, fuzzy msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter"
msgid "palette must be displayio.Palette" msgstr ""
msgstr "ang palette ay dapat 32 bytes ang haba"
#: shared-bindings/gamepad/GamePad.c:100 #: shared-bindings/gamepad/GamePad.c:100
msgid "too many arguments" msgid "too many arguments"
@ -2357,6 +2381,26 @@ msgstr ""
msgid "Group full" msgid "Group full"
msgstr "" msgstr ""
#: shared-module/displayio/Group.c:48
#, fuzzy
msgid "Group empty"
msgstr "walang laman"
#: shared-module/displayio/OnDiskBitmap.c:49
#, fuzzy
msgid "Invalid BMP file"
msgstr "Mali ang file"
#: shared-module/displayio/OnDiskBitmap.c:59
#, c-format
msgid "Only Windows format, uncompressed BMP supported %d"
msgstr ""
#: shared-module/displayio/OnDiskBitmap.c:64
#, c-format
msgid "Only true color (24 bpp or higher) BMP supported %x"
msgstr ""
#: shared-module/struct/__init__.c:39 #: shared-module/struct/__init__.c:39
msgid "'S' and 'O' are not supported format types" msgid "'S' and 'O' are not supported format types"
msgstr "Ang 'S' at 'O' ay hindi suportadong uri ng format" msgstr "Ang 'S' at 'O' ay hindi suportadong uri ng format"
@ -2364,3 +2408,7 @@ msgstr "Ang 'S' at 'O' ay hindi suportadong uri ng format"
#: shared-module/struct/__init__.c:83 #: shared-module/struct/__init__.c:83
msgid "too many arguments provided with the given format" msgid "too many arguments provided with the given format"
msgstr "masyadong maraming mga argumento na ibinigay sa ibinigay na format" msgstr "masyadong maraming mga argumento na ibinigay sa ibinigay na format"
#, fuzzy
#~ msgid "palette must be displayio.Palette"
#~ msgstr "ang palette ay dapat 32 bytes ang haba"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 0.1\n" "Project-Id-Version: 0.1\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-09-06 14:55-0700\n" "POT-Creation-Date: 2018-09-21 12:23-0400\n"
"PO-Revision-Date: 2018-08-14 11:01+0200\n" "PO-Revision-Date: 2018-08-14 11:01+0200\n"
"Last-Translator: Pierrick Couturier <arofarn@arofarn.info>\n" "Last-Translator: Pierrick Couturier <arofarn@arofarn.info>\n"
"Language-Team: fr\n" "Language-Team: fr\n"
@ -122,7 +122,7 @@ msgstr "certificat invalide"
msgid "queue overflow" msgid "queue overflow"
msgstr "dépassement de file" msgstr "dépassement de file"
#: extmod/moduzlib.c:97 #: extmod/moduzlib.c:98
msgid "compression header" msgid "compression header"
msgstr "entête de compression" msgstr "entête de compression"
@ -221,7 +221,7 @@ msgstr ""
msgid "Press any key to enter the REPL. Use CTRL-D to reload." msgid "Press any key to enter the REPL. Use CTRL-D to reload."
msgstr "Appuyez sur une touche pour entrer sur REPL ou CTRL-D pour recharger." msgstr "Appuyez sur une touche pour entrer sur REPL ou CTRL-D pour recharger."
#: main.c:415 #: main.c:416
msgid "soft reboot\n" msgid "soft reboot\n"
msgstr "redémarrage logiciel\n" msgstr "redémarrage logiciel\n"
@ -238,15 +238,15 @@ msgstr "la calibration est en lecture seule"
msgid "calibration is out of range" msgid "calibration is out of range"
msgstr "la calibration est hors gamme" msgstr "la calibration est hors gamme"
#: ports/atmel-samd/board_busses.c:39 ports/nrf/board_busses.c:39 #: ports/atmel-samd/board_busses.c:59 ports/nrf/board_busses.c:39
msgid "No default I2C bus" msgid "No default I2C bus"
msgstr "Pas de bus I2C par défaut" msgstr "Pas de bus I2C par défaut"
#: ports/atmel-samd/board_busses.c:64 ports/nrf/board_busses.c:64 #: ports/atmel-samd/board_busses.c:85 ports/nrf/board_busses.c:64
msgid "No default SPI bus" msgid "No default SPI bus"
msgstr "Pas de bus SPI par défaut" msgstr "Pas de bus SPI par défaut"
#: ports/atmel-samd/board_busses.c:91 ports/nrf/board_busses.c:91 #: ports/atmel-samd/board_busses.c:112 ports/nrf/board_busses.c:91
msgid "No default UART bus" msgid "No default UART bus"
msgstr "Pas de bus UART par défaut" msgstr "Pas de bus UART par défaut"
@ -298,12 +298,12 @@ msgid "Too many channels in sample."
msgstr "Trop de canaux dans l'échantillon." msgstr "Trop de canaux dans l'échantillon."
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:305 #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:305
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:326 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:339
msgid "No DMA channel found" msgid "No DMA channel found"
msgstr "Aucun canal DMA trouvé" msgstr "Aucun canal DMA trouvé"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:308 #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c:308
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:328 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:341
msgid "Unable to allocate buffers for signed conversion" msgid "Unable to allocate buffers for signed conversion"
msgstr "Impossible d'allouer des tampons pour une conversion signée" msgstr "Impossible d'allouer des tampons pour une conversion signée"
@ -345,16 +345,21 @@ msgstr "Broche invalide pour le canal droit"
msgid "Cannot output both channels on the same pin" msgid "Cannot output both channels on the same pin"
msgstr "On ne peut mettre les deux canaux sur la même broche" msgstr "On ne peut mettre les deux canaux sur la même broche"
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:173 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:176
#: ports/atmel-samd/common-hal/pulseio/PWMOut.c:186 #: ports/atmel-samd/common-hal/pulseio/PWMOut.c:189
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c:110 #: ports/atmel-samd/common-hal/pulseio/PulseOut.c:110
msgid "All timers in use" msgid "All timers in use"
msgstr "Tous les timers sont utilisés" msgstr "Tous les timers sont utilisés"
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:215 #: ports/atmel-samd/common-hal/audioio/AudioOut.c:218
msgid "All event channels in use" msgid "All event channels in use"
msgstr "Tous les canaux d'événements sont utilisés" msgstr "Tous les canaux d'événements sont utilisés"
#: ports/atmel-samd/common-hal/audioio/AudioOut.c:297
#, c-format
msgid "Sample rate too high. It must be less than %d"
msgstr ""
#: ports/atmel-samd/common-hal/busio/I2C.c:71 #: ports/atmel-samd/common-hal/busio/I2C.c:71
msgid "Not enough pins available" msgid "Not enough pins available"
msgstr "Pas assez de broches disponibles" msgstr "Pas assez de broches disponibles"
@ -363,7 +368,7 @@ msgstr "Pas assez de broches disponibles"
#: ports/atmel-samd/common-hal/busio/SPI.c:132 #: ports/atmel-samd/common-hal/busio/SPI.c:132
#: ports/atmel-samd/common-hal/busio/UART.c:119 #: ports/atmel-samd/common-hal/busio/UART.c:119
#: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c:45 #: ports/atmel-samd/common-hal/i2cslave/I2CSlave.c:45
#: ports/nrf/common-hal/busio/I2C.c:58 #: ports/nrf/common-hal/busio/I2C.c:77
msgid "Invalid pins" msgid "Invalid pins"
msgstr "Broche invalide" msgstr "Broche invalide"
@ -383,24 +388,24 @@ msgstr "octets > 8 bits non supporté"
msgid "tx and rx cannot both be None" msgid "tx and rx cannot both be None"
msgstr "TX et RX ne peuvent être None tous les deux" msgstr "TX et RX ne peuvent être None tous les deux"
#: ports/atmel-samd/common-hal/busio/UART.c:139 #: ports/atmel-samd/common-hal/busio/UART.c:145
msgid "Failed to allocate RX buffer" msgid "Failed to allocate RX buffer"
msgstr "Echec de l'allocation du tampon RX" msgstr "Echec de l'allocation du tampon RX"
#: ports/atmel-samd/common-hal/busio/UART.c:147 #: ports/atmel-samd/common-hal/busio/UART.c:153
msgid "Could not initialize UART" msgid "Could not initialize UART"
msgstr "L'UART n'a pu être initialisé" msgstr "L'UART n'a pu être initialisé"
#: ports/atmel-samd/common-hal/busio/UART.c:234 #: ports/atmel-samd/common-hal/busio/UART.c:240
msgid "No RX pin" msgid "No RX pin"
msgstr "Pas de broche RX" msgstr "Pas de broche RX"
#: ports/atmel-samd/common-hal/busio/UART.c:288 #: ports/atmel-samd/common-hal/busio/UART.c:294
msgid "No TX pin" msgid "No TX pin"
msgstr "Pas de broche TX" msgstr "Pas de broche TX"
#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c:170 #: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c:170
#: ports/nrf/common-hal/digitalio/DigitalInOut.c:153 #: ports/nrf/common-hal/digitalio/DigitalInOut.c:142
msgid "Cannot get pull while in output mode" msgid "Cannot get pull while in output mode"
msgstr "Ne peux être tirer ('pull') en mode 'output'" msgstr "Ne peux être tirer ('pull') en mode 'output'"
@ -411,12 +416,12 @@ msgstr ""
"Ne peut être redémarré vers le bootloader car il n'y a pas de bootloader." "Ne peut être redémarré vers le bootloader car il n'y a pas de bootloader."
#: ports/atmel-samd/common-hal/pulseio/PWMOut.c:120 #: ports/atmel-samd/common-hal/pulseio/PWMOut.c:120
#: ports/atmel-samd/common-hal/pulseio/PWMOut.c:366 #: ports/atmel-samd/common-hal/pulseio/PWMOut.c:369
#: ports/nrf/common-hal/pulseio/PWMOut.c:227 #: ports/nrf/common-hal/pulseio/PWMOut.c:227
msgid "Invalid PWM frequency" msgid "Invalid PWM frequency"
msgstr "Fréquence de PWM invalide" msgstr "Fréquence de PWM invalide"
#: ports/atmel-samd/common-hal/pulseio/PWMOut.c:184 #: ports/atmel-samd/common-hal/pulseio/PWMOut.c:187
msgid "All timers for this pin are in use" msgid "All timers for this pin are in use"
msgstr "Tous les timers pour cette broche sont utilisés" msgstr "Tous les timers pour cette broche sont utilisés"
@ -696,11 +701,25 @@ msgstr "paramètre de config. inconnu"
msgid "AnalogOut functionality not supported" msgid "AnalogOut functionality not supported"
msgstr "AnalogOut non supporté" msgstr "AnalogOut non supporté"
#: ports/nrf/common-hal/busio/I2C.c:91
#, fuzzy
msgid "All I2C peripherals are in use"
msgstr "Tous les timers sont utilisés"
#: ports/nrf/common-hal/busio/SPI.c:109
#, fuzzy
msgid "All SPI peripherals are in use"
msgstr "Tous les timers sont utilisés"
#: ports/nrf/common-hal/busio/SPI.c:170
msgid "Baud rate too high for this SPI peripheral"
msgstr ""
#: ports/nrf/common-hal/busio/UART.c:43 ports/nrf/common-hal/busio/UART.c:47 #: ports/nrf/common-hal/busio/UART.c:43 ports/nrf/common-hal/busio/UART.c:47
#: ports/nrf/common-hal/busio/UART.c:51 ports/nrf/common-hal/busio/UART.c:60 #: ports/nrf/common-hal/busio/UART.c:51 ports/nrf/common-hal/busio/UART.c:60
#: ports/nrf/common-hal/busio/UART.c:66 ports/nrf/common-hal/busio/UART.c:71 #: ports/nrf/common-hal/busio/UART.c:66 ports/nrf/common-hal/busio/UART.c:71
#: ports/nrf/common-hal/busio/UART.c:76 ports/nrf/common-hal/busio/UART.c:81 #: ports/nrf/common-hal/busio/UART.c:76 ports/nrf/common-hal/busio/UART.c:81
#: ports/nrf/common-hal/busio/UART.c:86 #: ports/nrf/common-hal/busio/UART.c:86 ports/nrf/common-hal/busio/UART.c:90
msgid "busio.UART not yet implemented" msgid "busio.UART not yet implemented"
msgstr "busio.UART pas encore implémenté" msgstr "busio.UART pas encore implémenté"
@ -1989,6 +2008,7 @@ msgid "buffer must be a bytes-like object"
msgstr "le tampon doit être un objet bytes-like" msgstr "le tampon doit être un objet bytes-like"
#: shared-bindings/audioio/WaveFile.c:78 #: shared-bindings/audioio/WaveFile.c:78
#: shared-bindings/displayio/OnDiskBitmap.c:85
msgid "file must be a file opened in byte mode" msgid "file must be a file opened in byte mode"
msgstr "le fichier doit être un fichier ouvert en mode byte" msgstr "le fichier doit être un fichier ouvert en mode byte"
@ -2021,11 +2041,11 @@ msgstr "les slices de tampon doivent être de longueurs égales"
msgid "Function requires lock." msgid "Function requires lock."
msgstr "La fonction nécessite un verrou." msgstr "La fonction nécessite un verrou."
#: shared-bindings/busio/UART.c:98 #: shared-bindings/busio/UART.c:102
msgid "bits must be 7, 8 or 9" msgid "bits must be 7, 8 or 9"
msgstr "bits doivent être 7, 8 ou 9" msgstr "bits doivent être 7, 8 ou 9"
#: shared-bindings/busio/UART.c:110 #: shared-bindings/busio/UART.c:114
msgid "stop must be 1 or 2" msgid "stop must be 1 or 2"
msgstr "stop doit être 1 ou 2" msgstr "stop doit être 1 ou 2"
@ -2068,6 +2088,11 @@ msgstr ""
msgid "row data must be a buffer" msgid "row data must be a buffer"
msgstr "les constantes doivent être des entiers" msgstr "les constantes doivent être des entiers"
#: shared-bindings/displayio/ColorConverter.c:72
#, fuzzy
msgid "color should be an int"
msgstr "La longueur doit être entière"
#: shared-bindings/displayio/FourWire.c:55 #: shared-bindings/displayio/FourWire.c:55
#: shared-bindings/displayio/FourWire.c:64 #: shared-bindings/displayio/FourWire.c:64
msgid "displayio is a work in progress" msgid "displayio is a work in progress"
@ -2105,20 +2130,19 @@ msgstr "le tampon doit être un objet bytes-like"
msgid "palette_index should be an int" msgid "palette_index should be an int"
msgstr "Les valeurs du tableau doivent être des octets simples 'bytes'" msgstr "Les valeurs du tableau doivent être des octets simples 'bytes'"
#: shared-bindings/displayio/Sprite.c:45 #: shared-bindings/displayio/Sprite.c:48
#, fuzzy #, fuzzy
msgid "position must be 2-tuple" msgid "position must be 2-tuple"
msgstr "stop doit être 1 ou 2" msgstr "stop doit être 1 ou 2"
#: shared-bindings/displayio/Sprite.c:87 #: shared-bindings/displayio/Sprite.c:97
#, fuzzy #, fuzzy
msgid "unsupported bitmap type" msgid "unsupported bitmap type"
msgstr "Débit non supporté" msgstr "Débit non supporté"
#: shared-bindings/displayio/Sprite.c:152 #: shared-bindings/displayio/Sprite.c:162
#, fuzzy msgid "pixel_shader must be displayio.Palette or displayio.ColorConverter"
msgid "palette must be displayio.Palette" msgstr ""
msgstr "la palette doit être longue de 32 octets"
#: shared-bindings/gamepad/GamePad.c:100 #: shared-bindings/gamepad/GamePad.c:100
msgid "too many arguments" msgid "too many arguments"
@ -2353,6 +2377,26 @@ msgstr ""
msgid "Group full" msgid "Group full"
msgstr "" msgstr ""
#: shared-module/displayio/Group.c:48
#, fuzzy
msgid "Group empty"
msgstr "vide"
#: shared-module/displayio/OnDiskBitmap.c:49
#, fuzzy
msgid "Invalid BMP file"
msgstr "Fichier invalide"
#: shared-module/displayio/OnDiskBitmap.c:59
#, c-format
msgid "Only Windows format, uncompressed BMP supported %d"
msgstr ""
#: shared-module/displayio/OnDiskBitmap.c:64
#, c-format
msgid "Only true color (24 bpp or higher) BMP supported %x"
msgstr ""
#: shared-module/struct/__init__.c:39 #: shared-module/struct/__init__.c:39
msgid "'S' and 'O' are not supported format types" msgid "'S' and 'O' are not supported format types"
msgstr "'S' et 'O' ne sont pas des types de format supportés" msgstr "'S' et 'O' ne sont pas des types de format supportés"
@ -2364,3 +2408,7 @@ msgstr "trop d'arguments fournis avec ce format"
#, fuzzy #, fuzzy
#~ msgid "value_size must be power of two" #~ msgid "value_size must be power of two"
#~ msgstr "'len' doit être un multiple de 4" #~ msgstr "'len' doit être un multiple de 4"
#, fuzzy
#~ msgid "palette must be displayio.Palette"
#~ msgstr "la palette doit être longue de 32 octets"

View File

@ -113,7 +113,7 @@ else
# -finline-limit=80 or so is similar to not having it on. # -finline-limit=80 or so is similar to not having it on.
# There is no simple default value, though. # There is no simple default value, though.
ifdef INTERNAL_FLASH_FILESYSTEM ifdef INTERNAL_FLASH_FILESYSTEM
CFLAGS += -finline-limit=55 CFLAGS += -finline-limit=50
endif endif
ifdef CFLAGS_INLINE_LIMIT ifdef CFLAGS_INLINE_LIMIT
CFLAGS += -finline-limit=$(CFLAGS_INLINE_LIMIT) CFLAGS += -finline-limit=$(CFLAGS_INLINE_LIMIT)
@ -384,7 +384,9 @@ SRC_SHARED_MODULE = \
busio/OneWire.c \ busio/OneWire.c \
displayio/__init__.c \ displayio/__init__.c \
displayio/Bitmap.c \ displayio/Bitmap.c \
displayio/ColorConverter.c \
displayio/Group.c \ displayio/Group.c \
displayio/OnDiskBitmap.c \
displayio/Palette.c \ displayio/Palette.c \
displayio/Sprite.c \ displayio/Sprite.c \
gamepad/__init__.c \ gamepad/__init__.c \

View File

@ -385,7 +385,7 @@
// <i> Select the clock source for DAC. // <i> Select the clock source for DAC.
#ifndef CONF_GCLK_DAC_SRC #ifndef CONF_GCLK_DAC_SRC
#define CONF_GCLK_DAC_SRC GCLK_CLKCTRL_GEN_GCLK1_Val #define CONF_GCLK_DAC_SRC GCLK_CLKCTRL_GEN_GCLK0_Val
#endif #endif
/** /**
@ -393,7 +393,7 @@
* \brief DAC's Clock frequency * \brief DAC's Clock frequency
*/ */
#ifndef CONF_GCLK_DAC_FREQUENCY #ifndef CONF_GCLK_DAC_FREQUENCY
#define CONF_GCLK_DAC_FREQUENCY 320000 #define CONF_GCLK_DAC_FREQUENCY 48000000
#endif #endif
// <y> USB Clock Source // <y> USB Clock Source

View File

@ -34,81 +34,96 @@
#include "samd/pins.h" #include "samd/pins.h"
#include "py/runtime.h" #include "py/runtime.h"
#if !defined(DEFAULT_I2C_BUS_SDA) || !defined(DEFAULT_I2C_BUS_SCL) #define BOARD_I2C (defined(DEFAULT_I2C_BUS_SDA) && defined(DEFAULT_I2C_BUS_SCL))
STATIC mp_obj_t board_i2c(void) { #define BOARD_SPI (defined(DEFAULT_SPI_BUS_SCK) && defined(DEFAULT_SPI_BUS_MISO) && defined(DEFAULT_SPI_BUS_MOSI))
mp_raise_NotImplementedError(translate("No default I2C bus")); #define BOARD_UART (defined(DEFAULT_UART_BUS_RX) && defined(DEFAULT_UART_BUS_TX))
return NULL;
#if BOARD_I2C
STATIC mp_obj_t i2c_singleton = NULL;
STATIC mp_obj_t board_i2c(void) {
if (i2c_singleton == NULL) {
busio_i2c_obj_t *self = m_new_obj(busio_i2c_obj_t);
self->base.type = &busio_i2c_type;
assert_pin_free(DEFAULT_I2C_BUS_SDA);
assert_pin_free(DEFAULT_I2C_BUS_SCL);
common_hal_busio_i2c_construct(self, DEFAULT_I2C_BUS_SCL, DEFAULT_I2C_BUS_SDA, 400000, 0);
i2c_singleton = (mp_obj_t)self;
} }
return i2c_singleton;
}
#else #else
STATIC mp_obj_t i2c_singleton = NULL; STATIC mp_obj_t board_i2c(void) {
mp_raise_NotImplementedError(translate("No default I2C bus"));
STATIC mp_obj_t board_i2c(void) { return NULL;
}
if (i2c_singleton == NULL) {
busio_i2c_obj_t *self = m_new_obj(busio_i2c_obj_t);
self->base.type = &busio_i2c_type;
assert_pin_free(DEFAULT_I2C_BUS_SDA);
assert_pin_free(DEFAULT_I2C_BUS_SCL);
common_hal_busio_i2c_construct(self, DEFAULT_I2C_BUS_SCL, DEFAULT_I2C_BUS_SDA, 400000, 0);
i2c_singleton = (mp_obj_t)self;
}
return i2c_singleton;
}
#endif #endif
MP_DEFINE_CONST_FUN_OBJ_0(board_i2c_obj, board_i2c); MP_DEFINE_CONST_FUN_OBJ_0(board_i2c_obj, board_i2c);
#if !defined(DEFAULT_SPI_BUS_SCK) || !defined(DEFAULT_SPI_BUS_MISO) || !defined(DEFAULT_SPI_BUS_MOSI) #if BOARD_SPI
STATIC mp_obj_t board_spi(void) { STATIC mp_obj_t spi_singleton = NULL;
mp_raise_NotImplementedError(translate("No default SPI bus"));
return NULL; STATIC mp_obj_t board_spi(void) {
if (spi_singleton == NULL) {
busio_spi_obj_t *self = m_new_obj(busio_spi_obj_t);
self->base.type = &busio_spi_type;
assert_pin_free(DEFAULT_SPI_BUS_SCK);
assert_pin_free(DEFAULT_SPI_BUS_MOSI);
assert_pin_free(DEFAULT_SPI_BUS_MISO);
const mcu_pin_obj_t* clock = MP_OBJ_TO_PTR(DEFAULT_SPI_BUS_SCK);
const mcu_pin_obj_t* mosi = MP_OBJ_TO_PTR(DEFAULT_SPI_BUS_MOSI);
const mcu_pin_obj_t* miso = MP_OBJ_TO_PTR(DEFAULT_SPI_BUS_MISO);
common_hal_busio_spi_construct(self, clock, mosi, miso);
spi_singleton = (mp_obj_t)self;
} }
return spi_singleton;
}
#else #else
STATIC mp_obj_t spi_singleton = NULL; STATIC mp_obj_t board_spi(void) {
mp_raise_NotImplementedError(translate("No default SPI bus"));
STATIC mp_obj_t board_spi(void) { return NULL;
}
if (spi_singleton == NULL) {
busio_spi_obj_t *self = m_new_obj(busio_spi_obj_t);
self->base.type = &busio_spi_type;
assert_pin_free(DEFAULT_SPI_BUS_SCK);
assert_pin_free(DEFAULT_SPI_BUS_MOSI);
assert_pin_free(DEFAULT_SPI_BUS_MISO);
const mcu_pin_obj_t* clock = MP_OBJ_TO_PTR(DEFAULT_SPI_BUS_SCK);
const mcu_pin_obj_t* mosi = MP_OBJ_TO_PTR(DEFAULT_SPI_BUS_MOSI);
const mcu_pin_obj_t* miso = MP_OBJ_TO_PTR(DEFAULT_SPI_BUS_MISO);
common_hal_busio_spi_construct(self, clock, mosi, miso);
spi_singleton = (mp_obj_t)self;
}
return spi_singleton;
}
#endif #endif
MP_DEFINE_CONST_FUN_OBJ_0(board_spi_obj, board_spi); MP_DEFINE_CONST_FUN_OBJ_0(board_spi_obj, board_spi);
#if !defined(DEFAULT_UART_BUS_RX) || !defined(DEFAULT_UART_BUS_TX) #if BOARD_UART
STATIC mp_obj_t board_uart(void) { STATIC mp_obj_t uart_singleton = NULL;
mp_raise_NotImplementedError(translate("No default UART bus"));
return NULL; STATIC mp_obj_t board_uart(void) {
if (uart_singleton == NULL) {
busio_uart_obj_t *self = m_new_obj(busio_uart_obj_t);
self->base.type = &busio_uart_type;
assert_pin_free(DEFAULT_UART_BUS_RX);
assert_pin_free(DEFAULT_UART_BUS_TX);
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);
uart_singleton = (mp_obj_t)self;
} }
return uart_singleton;
}
#else #else
STATIC mp_obj_t uart_singleton = NULL; STATIC mp_obj_t board_uart(void) {
mp_raise_NotImplementedError(translate("No default UART bus"));
STATIC mp_obj_t board_uart(void) { return NULL;
if (uart_singleton == NULL) { }
busio_uart_obj_t *self = m_new_obj(busio_uart_obj_t);
self->base.type = &busio_uart_type;
assert_pin_free(DEFAULT_UART_BUS_RX);
assert_pin_free(DEFAULT_UART_BUS_TX);
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);
uart_singleton = (mp_obj_t)self;
}
return uart_singleton;
}
#endif #endif
MP_DEFINE_CONST_FUN_OBJ_0(board_uart_obj, board_uart); MP_DEFINE_CONST_FUN_OBJ_0(board_uart_obj, board_uart);
void reset_board_busses(void) {
#if BOARD_I2C
i2c_singleton = NULL;
#endif
#if BOARD_SPI
spi_singleton = NULL;
#endif
#if BOARD_UART
uart_singleton = NULL;
#endif
}

View File

@ -36,4 +36,6 @@ extern mp_obj_fun_builtin_fixed_t board_spi_obj;
void board_uart(void); void board_uart(void);
extern mp_obj_fun_builtin_fixed_t board_uart_obj; extern mp_obj_fun_builtin_fixed_t board_uart_obj;
void reset_board_busses(void);
#endif // MICROPY_INCLUDED_ATMEL_SAMD_BOARD_BUSSES_H #endif // MICROPY_INCLUDED_ATMEL_SAMD_BOARD_BUSSES_H

View File

@ -27,6 +27,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) },
{ MP_ROM_QSTR(MP_QSTR_GREEN_LED), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_GREEN_LED), MP_ROM_PTR(&pin_PA06) },
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) },
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) },
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) },

View File

@ -21,6 +21,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) }, { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) },
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) },
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) },
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) },
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) },

View File

@ -21,6 +21,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) }, { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) },
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) },
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) },
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) },
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) },

View File

@ -21,6 +21,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) }, { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) },
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) },
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) },
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) },
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) },

View File

@ -21,6 +21,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) }, { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) },
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) },
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) },
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) },
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) },

View File

@ -21,6 +21,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) }, { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) },
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) },
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) },
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) },
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) },

View File

@ -21,6 +21,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) }, { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) },
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) },
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) },
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) },
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) },

View File

@ -42,5 +42,6 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_CLKM), MP_ROM_PTR(&pin_PC16) }, { MP_ROM_QSTR(MP_QSTR_CLKM), MP_ROM_PTR(&pin_PC16) },
{ MP_ROM_QSTR(MP_QSTR_RF_SCK), MP_ROM_PTR(&pin_PC18) }, { MP_ROM_QSTR(MP_QSTR_RF_SCK), MP_ROM_PTR(&pin_PC18) },
{ MP_ROM_QSTR(MP_QSTR_RF_MISO), MP_ROM_PTR(&pin_PC19) }, { MP_ROM_QSTR(MP_QSTR_RF_MISO), MP_ROM_PTR(&pin_PC19) },
{ MP_ROM_QSTR(MP_QSTR_RESETN), MP_ROM_PTR(&pin_PB15) },
}; };
MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);

View File

@ -62,4 +62,4 @@
#define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1 #define IGNORE_PIN_PA25 1
#define CIRCUITPY_DISPLAYIO #define CIRCUITPY_DISPLAYIO (1)

View File

@ -42,8 +42,12 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA22) },
{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA23) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA23) },
{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA08) },
{ MP_ROM_QSTR(MP_QSTR_EXTERNAL_NEOPIXEL), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_EXTERNAL_NEOPIXEL), MP_ROM_PTR(&pin_PA08) },
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA12) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA12) },
{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA11) },
{ MP_ROM_QSTR(MP_QSTR_SENSE), MP_ROM_PTR(&pin_PA11) }, { MP_ROM_QSTR(MP_QSTR_SENSE), MP_ROM_PTR(&pin_PA11) },
{ MP_ROM_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(&pin_PA00) },

View File

@ -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"
#include "hal/include/hal_gpio.h"
void board_init(void) {
}
bool board_requests_safe_mode(void) {
return false;
}
void reset_board(void) {
}

View File

@ -0,0 +1,40 @@
#define MICROPY_HW_BOARD_NAME "Adafruit Trellis M4 Express"
#define MICROPY_HW_MCU_NAME "samd51g19"
#define CIRCUITPY_MCU_FAMILY samd51
// This is for Rev A
#define MICROPY_HW_APA102_MOSI (&pin_PA01)
#define MICROPY_HW_APA102_SCK (&pin_PA00)
#define CIRCUITPY_BITBANG_APA102
// These are pins not to reset.
// QSPI Data pins & DotStar pins
#define MICROPY_PORT_A (PORT_PA00 | PORT_PA01 | PORT_PA08 | PORT_PA09 | PORT_PA10 | PORT_PA11)
// QSPI CS, and QSPI SCK
#define MICROPY_PORT_B (PORT_PB10 | PORT_PB11)
#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)
#include "external_flash/devices.h"
#define EXTERNAL_FLASH_DEVICE_COUNT 1
#define EXTERNAL_FLASH_DEVICES GD25Q64C
#include "external_flash/external_flash.h"
#define DEFAULT_I2C_BUS_SCL (&pin_PB08)
#define DEFAULT_I2C_BUS_SDA (&pin_PB09)
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1

View File

@ -0,0 +1,11 @@
LD_FILE = boards/samd51x19-bootloader-external-flash.ld
USB_VID = 0x239A
USB_PID = 0x8030
USB_PRODUCT = "Trellis M4 Express"
USB_MANUFACTURER = "Adafruit Industries LLC"
QSPI_FLASH_FILESYSTEM = 1
LONGINT_IMPL = MPZ
CHIP_VARIANT = SAMD51G19A
CHIP_FAMILY = samd51

View File

@ -0,0 +1,44 @@
#include "shared-bindings/board/__init__.h"
#include "board_busses.h"
// This mapping only includes functional names because pins broken
// out on connectors are labeled with their MCU name available from
// microcontroller.pin.
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA04) }, // INT pin
{ MP_OBJ_NEW_QSTR(MP_QSTR_MICOUT), MP_ROM_PTR(&pin_PA06) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MICIN), MP_ROM_PTR(&pin_PA07) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB08) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB09) },
// Key Grid columns
{ MP_OBJ_NEW_QSTR(MP_QSTR_COL0), MP_ROM_PTR(&pin_PA14) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_COL1), MP_ROM_PTR(&pin_PA15) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_COL2), MP_ROM_PTR(&pin_PA16) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_COL3), MP_ROM_PTR(&pin_PA17) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_COL4), MP_ROM_PTR(&pin_PA20) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_COL5), MP_ROM_PTR(&pin_PA21) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_COL6), MP_ROM_PTR(&pin_PA22) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_COL7), MP_ROM_PTR(&pin_PA23) },
// Key Grid rows
{ MP_OBJ_NEW_QSTR(MP_QSTR_ROW0), MP_ROM_PTR(&pin_PA18) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_ROW1), MP_ROM_PTR(&pin_PA19) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_ROW2), MP_ROM_PTR(&pin_PB22) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_ROW3), MP_ROM_PTR(&pin_PB23) },
// IRQ/GPIO pin
{ MP_OBJ_NEW_QSTR(MP_QSTR_INT), MP_ROM_PTR(&pin_PA04) },
// NeoPixels
{ MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA27) },
{ MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_PA01) },
{ MP_ROM_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_PA00) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);

View File

@ -110,13 +110,14 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self,
_pm_enable_bus_clock(PM_BUS_APBC, DAC); _pm_enable_bus_clock(PM_BUS_APBC, DAC);
#endif #endif
// SAMD21: This clock should be <= 12 MHz, per datasheet section 47.6.3. // SAMD51: This clock should be <= 12 MHz, per datasheet section 47.6.3.
// SAMD51: This clock should be <= 350kHz, per datasheet table 37-6. // SAMD21: This clock is 48mhz despite the datasheet saying it must only be <= 350kHz, per
// datasheet table 37-6. It's incorrect because the max output rate is 350ksps and is only
// achieved when the GCLK is more than 8mhz.
_gclk_enable_channel(DAC_GCLK_ID, CONF_GCLK_DAC_SRC); _gclk_enable_channel(DAC_GCLK_ID, CONF_GCLK_DAC_SRC);
DAC->CTRLA.bit.SWRST = 1;
DAC->CTRLA.bit.SWRST = 1; while (DAC->CTRLA.bit.SWRST == 1) {}
while (DAC->CTRLA.bit.SWRST == 1) {}
bool channel0_enabled = true; bool channel0_enabled = true;
#ifdef SAMD51 #ifdef SAMD51
@ -127,9 +128,11 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t* self,
if (channel0_enabled) { if (channel0_enabled) {
#ifdef SAMD21 #ifdef SAMD21
DAC->EVCTRL.reg |= DAC_EVCTRL_STARTEI; DAC->EVCTRL.reg |= DAC_EVCTRL_STARTEI;
// We disable the voltage pump because we always run at 3.3v.
DAC->CTRLB.reg = DAC_CTRLB_REFSEL_AVCC | DAC->CTRLB.reg = DAC_CTRLB_REFSEL_AVCC |
DAC_CTRLB_LEFTADJ | DAC_CTRLB_LEFTADJ |
DAC_CTRLB_EOEN; DAC_CTRLB_EOEN |
DAC_CTRLB_VPD;
#endif #endif
#ifdef SAMD51 #ifdef SAMD51
DAC->EVCTRL.reg |= DAC_EVCTRL_STARTEI0; DAC->EVCTRL.reg |= DAC_EVCTRL_STARTEI0;
@ -283,6 +286,16 @@ void common_hal_audioio_audioout_play(audioio_audioout_obj_t* self,
common_hal_audioio_audioout_stop(self); common_hal_audioio_audioout_stop(self);
} }
audio_dma_result result = AUDIO_DMA_OK; audio_dma_result result = AUDIO_DMA_OK;
uint32_t sample_rate = audiosample_sample_rate(sample);
#ifdef SAMD21
uint32_t max_sample_rate = 350000;
#endif
#ifdef SAMD51
uint32_t max_sample_rate = 1000000;
#endif
if (sample_rate > max_sample_rate) {
mp_raise_ValueError_varg(translate("Sample rate too high. It must be less than %d"), max_sample_rate);
}
#ifdef SAMD21 #ifdef SAMD21
result = audio_dma_setup_playback(&self->left_dma, sample, loop, true, 0, result = audio_dma_setup_playback(&self->left_dma, sample, loop, true, 0,
false /* output unsigned */, false /* output unsigned */,

View File

@ -133,7 +133,13 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self,
if (rx && receiver_buffer_size > 0) { if (rx && receiver_buffer_size > 0) {
self->buffer_length = receiver_buffer_size; self->buffer_length = receiver_buffer_size;
self->buffer = (uint8_t *) gc_alloc(self->buffer_length * sizeof(uint8_t), false, false); // Initially allocate the UART's buffer in the long-lived part of the
// heap. UARTs are generally long-lived objects, but the "make long-
// lived" machinery is incapable of moving internal pointers like
// self->buffer, so do it manually. (However, as long as internal
// pointers like this are NOT moved, allocating the buffer
// in the long-lived pool is not strictly necessary)
self->buffer = (uint8_t *) gc_alloc(self->buffer_length * sizeof(uint8_t), false, true);
if (self->buffer == NULL) { if (self->buffer == NULL) {
common_hal_busio_uart_deinit(self); common_hal_busio_uart_deinit(self);
mp_raise_msg(&mp_type_MemoryError, translate("Failed to allocate RX buffer")); mp_raise_msg(&mp_type_MemoryError, translate("Failed to allocate RX buffer"));
@ -268,7 +274,7 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t
#ifdef MICROPY_VM_HOOK_LOOP #ifdef MICROPY_VM_HOOK_LOOP
MICROPY_VM_HOOK_LOOP MICROPY_VM_HOOK_LOOP
#endif #endif
// If we are zero timeout, make sure we don't loop again (in the event // If we are zero timeout, make sure we don't loop again (in the event
// we read in under 1ms) // we read in under 1ms)
if (self->timeout_ms == 0) if (self->timeout_ms == 0)
break; break;
@ -344,7 +350,18 @@ void common_hal_busio_uart_set_baudrate(busio_uart_obj_t *self, uint32_t baudrat
} }
uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) {
return self->buffer_size; // This assignment is only here because the usart_async routines take a *const argument.
struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc;
struct usart_async_status async_status;
usart_async_get_status(usart_desc_p, &async_status);
return async_status.rxcnt;
}
void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) {
// This assignment is only here because the usart_async routines take a *const argument.
struct usart_async_descriptor * const usart_desc_p = (struct usart_async_descriptor * const) &self->usart_desc;
usart_async_flush_rx_buffer(usart_desc_p);
} }
bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) { bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) {

View File

@ -42,10 +42,6 @@ typedef struct {
bool rx_error; bool rx_error;
uint32_t baudrate; uint32_t baudrate;
uint32_t timeout_ms; uint32_t timeout_ms;
// Index of the oldest received character.
uint32_t buffer_start;
// Index of the next available spot to store a character.
uint32_t buffer_size;
uint32_t buffer_length; uint32_t buffer_length;
uint8_t* buffer; uint8_t* buffer;
} busio_uart_obj_t; } busio_uart_obj_t;

View File

@ -109,16 +109,16 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout,
asm("nop; nop;"); asm("nop; nop;");
#endif #endif
#ifdef SAMD51 #ifdef SAMD51
delay_cycles(3); delay_cycles(2);
#endif #endif
if(p & bitMask) { if((p & bitMask) != 0) {
// This is the high delay unique to a one bit. // This is the high delay unique to a one bit.
// For the SK6812 its 0.3us // For the SK6812 its 0.3us
#ifdef SAMD21 #ifdef SAMD21
asm("nop; nop; nop; nop; nop; nop; nop;"); asm("nop; nop; nop; nop; nop; nop; nop;");
#endif #endif
#ifdef SAMD51 #ifdef SAMD51
delay_cycles(11); delay_cycles(3);
#endif #endif
*clr = pinMask; *clr = pinMask;
} else { } else {
@ -129,7 +129,7 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout,
asm("nop; nop;"); asm("nop; nop;");
#endif #endif
#ifdef SAMD51 #ifdef SAMD51
delay_cycles(3); delay_cycles(2);
#endif #endif
} }
if((bitMask >>= 1) != 0) { if((bitMask >>= 1) != 0) {
@ -140,7 +140,7 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout,
asm("nop; nop; nop; nop; nop;"); asm("nop; nop; nop; nop; nop;");
#endif #endif
#ifdef SAMD51 #ifdef SAMD51
delay_cycles(20); delay_cycles(4);
#endif #endif
} else { } else {
if(ptr >= end) break; if(ptr >= end) break;
@ -151,7 +151,7 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout,
// above operations take. // above operations take.
// For the SK6812 its 0.6us +- 0.15us // For the SK6812 its 0.6us +- 0.15us
#ifdef SAMD51 #ifdef SAMD51
delay_cycles(15); delay_cycles(3);
#endif #endif
} }
} }

View File

@ -52,10 +52,10 @@ uint8_t tcc_refcount[TCC_INST_NUM];
// This bitmask keeps track of which channels of a TCC are currently claimed. // This bitmask keeps track of which channels of a TCC are currently claimed.
#ifdef SAMD21 #ifdef SAMD21
uint8_t tcc_channels[3] = {0xf0, 0xfc, 0xfc}; uint8_t tcc_channels[3]; // Set by pwmout_reset() to {0xf0, 0xfc, 0xfc} initially.
#endif #endif
#ifdef SAMD51 #ifdef SAMD51
uint8_t tcc_channels[5] = {0xc0, 0xf0, 0xf8, 0xfc, 0xfc}; uint8_t tcc_channels[5]; // Set by pwmout_reset() to {0xc0, 0xf0, 0xf8, 0xfc, 0xfc} initially.
#endif #endif
void pwmout_reset(void) { void pwmout_reset(void) {
@ -76,7 +76,7 @@ void pwmout_reset(void) {
for (uint8_t j = 0; j < tcc_cc_num[i]; j++) { for (uint8_t j = 0; j < tcc_cc_num[i]; j++) {
mask <<= 1; mask <<= 1;
} }
tcc_channels[i] = 0xf0; tcc_channels[i] = mask;
tccs[i]->CTRLA.bit.SWRST = 1; tccs[i]->CTRLA.bit.SWRST = 1;
} }
Tc *tcs[TC_INST_NUM] = TC_INSTS; Tc *tcs[TC_INST_NUM] = TC_INSTS;
@ -123,7 +123,7 @@ void common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self,
// Figure out which timer we are using. // Figure out which timer we are using.
// First see if a tcc is already going with the frequency we want and our // First see if a tcc is already going with the frequency we want and our
// channel is unused. tc's don't have neough channels to share. // channel is unused. tc's don't have enough channels to share.
const pin_timer_t* timer = NULL; const pin_timer_t* timer = NULL;
uint8_t mux_position = 0; uint8_t mux_position = 0;
if (!variable_frequency) { if (!variable_frequency) {
@ -140,6 +140,9 @@ void common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self,
if (tcc->CTRLA.bit.ENABLE == 1 && channel_ok(t)) { if (tcc->CTRLA.bit.ENABLE == 1 && channel_ok(t)) {
timer = t; timer = t;
mux_position = j; mux_position = j;
// Claim channel.
tcc_channels[timer->index] |= (1 << tcc_channel(timer));
} }
} }
} }

View File

@ -61,6 +61,7 @@
#include "samd/external_interrupts.h" #include "samd/external_interrupts.h"
#include "samd/dma.h" #include "samd/dma.h"
#include "shared-bindings/rtc/__init__.h" #include "shared-bindings/rtc/__init__.h"
#include "board_busses.h"
#include "tick.h" #include "tick.h"
#include "usb.h" #include "usb.h"
@ -278,6 +279,8 @@ void reset_port(void) {
reset_all_pins(); reset_all_pins();
reset_board_busses();
// Output clocks for debugging. // Output clocks for debugging.
// not supported by SAMD51G; uncomment for SAMD51J or update for 51G // not supported by SAMD51G; uncomment for SAMD51J or update for 51G
// #ifdef SAMD51 // #ifdef SAMD51

View File

@ -288,7 +288,7 @@ void usb_write(const char* buffer, uint32_t len) {
return; return;
} }
uint8_t * output_buffer; uint8_t * output_buffer;
uint8_t output_len; uint32_t output_len;
while (len > 0) { while (len > 0) {
while (usb_transmitting) {} while (usb_transmitting) {}
output_buffer = (uint8_t *) buffer; output_buffer = (uint8_t *) buffer;

View File

@ -138,6 +138,9 @@ uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) {
return 0; return 0;
} }
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) { bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) {
return true; return true;
} }

View File

@ -118,7 +118,10 @@ SRC_C += \
lib/utils/sys_stdio_mphal.c \ lib/utils/sys_stdio_mphal.c \
nrfx/hal/nrf_nvmc.c \ nrfx/hal/nrf_nvmc.c \
nrfx/mdk/system_$(MCU_SUB_VARIANT).c \ nrfx/mdk/system_$(MCU_SUB_VARIANT).c \
peripherals/nrf/cache.c \
peripherals/nrf/clocks.c \
peripherals/nrf/$(MCU_CHIP)/pins.c \ peripherals/nrf/$(MCU_CHIP)/pins.c \
peripherals/nrf/$(MCU_CHIP)/power.c \
supervisor/shared/memory.c supervisor/shared/memory.c
DRIVERS_SRC_C += $(addprefix modules/,\ DRIVERS_SRC_C += $(addprefix modules/,\

View File

@ -31,41 +31,12 @@
#include "boards/board.h" #include "boards/board.h"
// Must match temp register in bootloader
#define BOOTLOADER_VERSION_REGISTER NRF_TIMER2->CC[0]
uint32_t bootloaderVersion = 0;
void board_init(void) { void board_init(void) {
// Retrieve bootloader version
bootloaderVersion = BOOTLOADER_VERSION_REGISTER;
} }
// Check the status of the two buttons on CircuitPlayground Express. If both are
// pressed, then boot into user safe mode.
bool board_requests_safe_mode(void) { bool board_requests_safe_mode(void) {
// gpio_set_pin_function(PIN_PA14, GPIO_PIN_FUNCTION_OFF);
// gpio_set_pin_direction(PIN_PA14, GPIO_DIRECTION_IN);
// gpio_set_pin_pull_mode(PIN_PA14, GPIO_PULL_DOWN);
//
// gpio_set_pin_function(PIN_PA28, GPIO_PIN_FUNCTION_OFF);
// gpio_set_pin_direction(PIN_PA28, GPIO_DIRECTION_IN);
// gpio_set_pin_pull_mode(PIN_PA28, GPIO_PULL_DOWN);
// bool safe_mode = gpio_get_pin_level(PIN_PA14) &&
// gpio_get_pin_level(PIN_PA28);
// reset_pin_number(PIN_PA14);
// reset_pin_number(PIN_PA28);
// return safe_mode;
return false; return false;
} }
void reset_board(void) { void reset_board(void) {
// uint8_t empty[30];
// memset(empty, 0, 30);
// digitalio_digitalinout_obj_t neopixel_pin;
// common_hal_digitalio_digitalinout_construct(&neopixel_pin, &pin_PB23);
// common_hal_digitalio_digitalinout_switch_to_output(&neopixel_pin, false,
// DRIVE_MODE_PUSH_PULL);
// common_hal_neopixel_write(&neopixel_pin, empty, 30);
// common_hal_digitalio_digitalinout_deinit(&neopixel_pin);
} }

View File

@ -29,6 +29,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_P0_31) }, { MP_ROM_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_P0_31) },
{ MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_P0_31) }, { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_P0_31) },
{ MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_P0_31) },
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_P0_07) }, { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_P0_07) },
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_P0_11) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_P0_11) },

View File

@ -24,15 +24,11 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include <string.h>
#include <stdbool.h>
#include "nrf.h"
#include "boards/board.h" #include "boards/board.h"
#include "usb.h"
void board_init(void) { void board_init(void) {
usb_init();
} }
bool board_requests_safe_mode(void) { bool board_requests_safe_mode(void) {

View File

@ -32,7 +32,6 @@
#include "boards/board.h" #include "boards/board.h"
void board_init(void) { void board_init(void) {
} }
bool board_requests_safe_mode(void) { bool board_requests_safe_mode(void) {

View File

@ -24,18 +24,10 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include <string.h>
#include <stdbool.h>
#include "boards/board.h" #include "boards/board.h"
#include "nrfx.h"
#include "usb.h" #include "usb.h"
void board_init(void) { void board_init(void) {
// Clock
NRF_CLOCK->LFCLKSRC = (uint32_t)((CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos) & CLOCK_LFCLKSRC_SRC_Msk);
NRF_CLOCK->TASKS_LFCLKSTART = 1UL;
usb_init(); usb_init();
} }
@ -46,8 +38,3 @@ bool board_requests_safe_mode(void) {
void reset_board(void) { void reset_board(void) {
} }

View File

@ -31,11 +31,6 @@
#include "usb.h" #include "usb.h"
void board_init(void) { void board_init(void) {
// Clock
NRF_CLOCK->LFCLKSRC = (uint32_t)((CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos) & CLOCK_LFCLKSRC_SRC_Msk);
NRF_CLOCK->TASKS_LFCLKSTART = 1UL;
usb_init(); usb_init();
} }
@ -46,8 +41,3 @@ bool board_requests_safe_mode(void) {
void reset_board(void) { void reset_board(void) {
} }

View File

@ -34,8 +34,31 @@
#include "nrfx_twim.h" #include "nrfx_twim.h"
#include "nrf_gpio.h" #include "nrf_gpio.h"
#define INST_NO 0 #include "nrfx_spim.h"
#define MAX_XFER_SIZE ((1U << NRFX_CONCAT_3(TWIM, INST_NO, _EASYDMA_MAXCNT_SIZE)) - 1) #include "nrf_gpio.h"
STATIC twim_peripheral_t twim_peripherals[] = {
#if NRFX_CHECK(NRFX_TWIM0_ENABLED)
// SPIM0 and TWIM0 share an address.
{ .twim = NRFX_TWIM_INSTANCE(0),
.in_use = false,
.max_xfer_size = TWIM0_EASYDMA_MAXCNT_SIZE,
},
#endif
#if NRFX_CHECK(NRFX_TWIM1_ENABLED)
// SPIM1 and TWIM1 share an address.
{ .twim = NRFX_TWIM_INSTANCE(1),
.in_use = false,
.max_xfer_size = TWIM1_EASYDMA_MAXCNT_SIZE,
},
#endif
};
void i2c_reset(void) {
for (size_t i = 0 ; i < MP_ARRAY_SIZE(twim_peripherals); i++) {
twim_peripherals[i].in_use = false;
}
}
static uint8_t twi_error_to_mp(const nrfx_err_t err) { static uint8_t twi_error_to_mp(const nrfx_err_t err) {
switch (err) { switch (err) {
@ -54,11 +77,23 @@ static uint8_t twi_error_to_mp(const nrfx_err_t err) {
} }
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) { 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) {
if (scl->number == sda->number) if (scl->number == sda->number) {
mp_raise_ValueError(translate("Invalid pins")); mp_raise_ValueError(translate("Invalid pins"));
}
const nrfx_twim_t instance = NRFX_TWIM_INSTANCE(INST_NO); // Find a free instance.
self->twim = instance; self->twim_peripheral = NULL;
for (size_t i = 0 ; i < MP_ARRAY_SIZE(twim_peripherals); i++) {
if (!twim_peripherals[i].in_use) {
self->twim_peripheral = &twim_peripherals[i];
self->twim_peripheral->in_use = true;
break;
}
}
if (self->twim_peripheral == NULL) {
mp_raise_ValueError(translate("All I2C peripherals are in use"));
}
nrfx_twim_config_t config = NRFX_TWIM_DEFAULT_CONFIG; nrfx_twim_config_t config = NRFX_TWIM_DEFAULT_CONFIG;
config.scl = scl->number; config.scl = scl->number;
@ -76,12 +111,12 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, const mcu_pin_obj_t *
claim_pin(sda); claim_pin(sda);
claim_pin(scl); claim_pin(scl);
nrfx_err_t err = nrfx_twim_init(&self->twim, &config, NULL, NULL); nrfx_err_t err = nrfx_twim_init(&self->twim_peripheral->twim, &config, NULL, NULL);
// A soft reset doesn't uninit the driver so we might end up with a invalid state // A soft reset doesn't uninit the driver so we might end up with a invalid state
if (err == NRFX_ERROR_INVALID_STATE) { if (err == NRFX_ERROR_INVALID_STATE) {
nrfx_twim_uninit(&self->twim); nrfx_twim_uninit(&self->twim_peripheral->twim);
err = nrfx_twim_init(&self->twim, &config, NULL, NULL); err = nrfx_twim_init(&self->twim_peripheral->twim, &config, NULL, NULL);
} }
if (err != NRFX_SUCCESS) { if (err != NRFX_SUCCESS) {
@ -99,20 +134,22 @@ void common_hal_busio_i2c_deinit(busio_i2c_obj_t *self) {
if (common_hal_busio_i2c_deinited(self)) if (common_hal_busio_i2c_deinited(self))
return; return;
nrfx_twim_uninit(&self->twim); nrfx_twim_uninit(&self->twim_peripheral->twim);
reset_pin_number(self->sda_pin_number); reset_pin_number(self->sda_pin_number);
reset_pin_number(self->scl_pin_number); reset_pin_number(self->scl_pin_number);
self->sda_pin_number = NO_PIN; self->sda_pin_number = NO_PIN;
self->scl_pin_number = NO_PIN; self->scl_pin_number = NO_PIN;
self->twim_peripheral->in_use = false;
} }
// nrfx_twim_tx doesn't support 0-length data so we fall back to the hal API // nrfx_twim_tx doesn't support 0-length data so we fall back to the hal API
bool common_hal_busio_i2c_probe(busio_i2c_obj_t *self, uint8_t addr) { bool common_hal_busio_i2c_probe(busio_i2c_obj_t *self, uint8_t addr) {
NRF_TWIM_Type *reg = self->twim.p_twim; NRF_TWIM_Type *reg = self->twim_peripheral->twim.p_twim;
bool found = true; bool found = true;
nrfx_twim_enable(&self->twim); nrfx_twim_enable(&self->twim_peripheral->twim);
nrf_twim_address_set(reg, addr); nrf_twim_address_set(reg, addr);
nrf_twim_tx_buffer_set(reg, NULL, 0); nrf_twim_tx_buffer_set(reg, NULL, 0);
@ -135,19 +172,19 @@ bool common_hal_busio_i2c_probe(busio_i2c_obj_t *self, uint8_t addr) {
found = false; found = false;
} }
nrfx_twim_disable(&self->twim); nrfx_twim_disable(&self->twim_peripheral->twim);
return found; return found;
} }
bool common_hal_busio_i2c_try_lock(busio_i2c_obj_t *self) { bool common_hal_busio_i2c_try_lock(busio_i2c_obj_t *self) {
bool grabbed_lock = false; bool grabbed_lock = false;
// CRITICAL_SECTION_ENTER() // NRFX_CRITICAL_SECTION_ENTER();
if (!self->has_lock) { if (!self->has_lock) {
grabbed_lock = true; grabbed_lock = true;
self->has_lock = true; self->has_lock = true;
} }
// CRITICAL_SECTION_LEAVE(); // NRFX_CRITICAL_SECTION_EXIT();
return grabbed_lock; return grabbed_lock;
} }
@ -163,22 +200,23 @@ uint8_t common_hal_busio_i2c_write(busio_i2c_obj_t *self, uint16_t addr, const u
if(len == 0) if(len == 0)
return common_hal_busio_i2c_probe(self, addr) ? 0 : MP_ENODEV; return common_hal_busio_i2c_probe(self, addr) ? 0 : MP_ENODEV;
const uint32_t parts = len / MAX_XFER_SIZE; const uint32_t max_xfer_size = self->twim_peripheral->max_xfer_size;
const uint32_t remainder = len % MAX_XFER_SIZE; const uint32_t parts = len / max_xfer_size;
const uint32_t remainder = len % max_xfer_size;
nrfx_err_t err = NRFX_SUCCESS; nrfx_err_t err = NRFX_SUCCESS;
nrfx_twim_enable(&self->twim); nrfx_twim_enable(&self->twim_peripheral->twim);
for (uint32_t i = 0; i < parts; ++i) { for (uint32_t i = 0; i < parts; ++i) {
err = nrfx_twim_tx(&self->twim, addr, data + i * MAX_XFER_SIZE, MAX_XFER_SIZE, !stopBit); err = nrfx_twim_tx(&self->twim_peripheral->twim, addr, data + i * max_xfer_size, max_xfer_size, !stopBit);
if (err != NRFX_SUCCESS) if (err != NRFX_SUCCESS)
break; break;
} }
if ((remainder > 0) && (err == NRFX_SUCCESS)) if ((remainder > 0) && (err == NRFX_SUCCESS))
err = nrfx_twim_tx(&self->twim, addr, data + parts * MAX_XFER_SIZE, remainder, !stopBit); err = nrfx_twim_tx(&self->twim_peripheral->twim, addr, data + parts * max_xfer_size, remainder, !stopBit);
nrfx_twim_disable(&self->twim); nrfx_twim_disable(&self->twim_peripheral->twim);
return twi_error_to_mp(err); return twi_error_to_mp(err);
} }
@ -187,22 +225,23 @@ uint8_t common_hal_busio_i2c_read(busio_i2c_obj_t *self, uint16_t addr, uint8_t
if(len == 0) if(len == 0)
return 0; return 0;
const uint32_t parts = len / MAX_XFER_SIZE; const uint32_t max_xfer_size = self->twim_peripheral->max_xfer_size;
const uint32_t remainder = len % MAX_XFER_SIZE; const uint32_t parts = len / max_xfer_size;
const uint32_t remainder = len % max_xfer_size;
nrfx_err_t err = NRFX_SUCCESS; nrfx_err_t err = NRFX_SUCCESS;
nrfx_twim_enable(&self->twim); nrfx_twim_enable(&self->twim_peripheral->twim);
for (uint32_t i = 0; i < parts; ++i) { for (uint32_t i = 0; i < parts; ++i) {
err = nrfx_twim_rx(&self->twim, addr, data + i * MAX_XFER_SIZE, MAX_XFER_SIZE); err = nrfx_twim_rx(&self->twim_peripheral->twim, addr, data + i * max_xfer_size, max_xfer_size);
if (err != NRFX_SUCCESS) if (err != NRFX_SUCCESS)
break; break;
} }
if ((remainder > 0) && (err == NRFX_SUCCESS)) if ((remainder > 0) && (err == NRFX_SUCCESS))
err = nrfx_twim_rx(&self->twim, addr, data + parts * MAX_XFER_SIZE, remainder); err = nrfx_twim_rx(&self->twim_peripheral->twim, addr, data + parts * max_xfer_size, remainder);
nrfx_twim_disable(&self->twim); nrfx_twim_disable(&self->twim_peripheral->twim);
return twi_error_to_mp(err); return twi_error_to_mp(err);
} }

View File

@ -32,11 +32,19 @@
#include "py/obj.h" #include "py/obj.h"
typedef struct { typedef struct {
mp_obj_base_t base;
nrfx_twim_t twim; nrfx_twim_t twim;
bool in_use;
uint8_t max_xfer_size;
} twim_peripheral_t;
typedef struct {
mp_obj_base_t base;
twim_peripheral_t* twim_peripheral;
bool has_lock; bool has_lock;
uint8_t scl_pin_number; uint8_t scl_pin_number;
uint8_t sda_pin_number; uint8_t sda_pin_number;
} busio_i2c_obj_t; } busio_i2c_obj_t;
void i2c_reset(void);
#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_BUSIO_I2C_H #endif // MICROPY_INCLUDED_NRF_COMMON_HAL_BUSIO_I2C_H

View File

@ -27,40 +27,71 @@
#include "nrfx_spim.h" #include "nrfx_spim.h"
#include "nrf_gpio.h" #include "nrf_gpio.h"
#if NRFX_SPIM3_ENABLED STATIC spim_peripheral_t spim_peripherals[] = {
#define INST_NO 3 #if NRFX_CHECK(NRFX_SPIM3_ENABLED)
#else // SPIM3 exists only on nRF52840 and supports 32MHz max. All other SPIM's are only 8MHz max.
#define INST_NO 2 // Allocate SPIM3 first.
{ .spim = NRFX_SPIM_INSTANCE(3),
.max_frequency_MHz = 32,
.max_xfer_size = SPIM3_EASYDMA_MAXCNT_SIZE,
},
#endif #endif
#if NRFX_CHECK(NRFX_SPIM2_ENABLED)
// SPIM2 is not shared with a TWIM, so allocate before the shared ones.
{ .spim = NRFX_SPIM_INSTANCE(2),
.max_frequency_MHz = 8,
.max_xfer_size = SPIM2_EASYDMA_MAXCNT_SIZE,
},
#endif
#if NRFX_CHECK(NRFX_SPIM1_ENABLED)
// SPIM1 and TWIM1 share an address.
{ .spim = NRFX_SPIM_INSTANCE(1),
.max_frequency_MHz = 8,
.max_xfer_size = SPIM1_EASYDMA_MAXCNT_SIZE,
},
#endif
#if NRFX_CHECK(NRFX_SPIM0_ENABLED)
// SPIM0 and TWIM0 share an address.
{ .spim = NRFX_SPIM_INSTANCE(0),
.max_frequency_MHz = 8,
.max_xfer_size = SPIM0_EASYDMA_MAXCNT_SIZE,
},
#endif
};
#define MAX_XFER_SIZE ((1U << NRFX_CONCAT_3(SPIM, INST_NO, _EASYDMA_MAXCNT_SIZE)) - 1) void spi_reset(void) {
for (size_t i = 0 ; i < MP_ARRAY_SIZE(spim_peripherals); i++) {
nrfx_spim_uninit(&spim_peripherals[i].spim);
}
}
// Convert frequency to clock-speed-dependent value // Convert frequency to clock-speed-dependent value
static nrf_spim_frequency_t baudrate_to_spim_frequency(const uint32_t baudrate) { static nrf_spim_frequency_t baudrate_to_spim_frequency(const uint32_t baudrate) {
if (baudrate <= 125000) if (baudrate <= 125000) {
return NRF_SPIM_FREQ_125K; return NRF_SPIM_FREQ_125K;
}
if (baudrate <= 250000) if (baudrate <= 250000) {
return NRF_SPIM_FREQ_250K; return NRF_SPIM_FREQ_250K;
}
if (baudrate <= 500000) if (baudrate <= 500000) {
return NRF_SPIM_FREQ_500K; return NRF_SPIM_FREQ_500K;
}
if (baudrate <= 1000000) if (baudrate <= 1000000) {
return NRF_SPIM_FREQ_1M; return NRF_SPIM_FREQ_1M;
}
if (baudrate <= 2000000) if (baudrate <= 2000000) {
return NRF_SPIM_FREQ_2M; return NRF_SPIM_FREQ_2M;
}
if (baudrate <= 4000000) if (baudrate <= 4000000) {
return NRF_SPIM_FREQ_4M; return NRF_SPIM_FREQ_4M;
}
if (baudrate <= 8000000) if (baudrate <= 8000000) {
return NRF_SPIM_FREQ_8M; return NRF_SPIM_FREQ_8M;
}
#ifdef SPIM_FREQUENCY_FREQUENCY_M16 #ifdef SPIM_FREQUENCY_FREQUENCY_M16
if (baudrate <= 16000000) if (baudrate <= 16000000) {
return NRF_SPIM_FREQ_16M; return NRF_SPIM_FREQ_16M;
}
#endif #endif
#ifdef SPIM_FREQUENCY_FREQUENCY_M32 #ifdef SPIM_FREQUENCY_FREQUENCY_M32
@ -71,8 +102,18 @@ static nrf_spim_frequency_t baudrate_to_spim_frequency(const uint32_t baudrate)
} }
void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t * clock, const mcu_pin_obj_t * mosi, const mcu_pin_obj_t * miso) { void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t * clock, const mcu_pin_obj_t * mosi, const mcu_pin_obj_t * miso) {
const nrfx_spim_t instance = NRFX_SPIM_INSTANCE(INST_NO); // Find a free instance.
self->spim = instance; self->spim_peripheral = NULL;
for (size_t i = 0 ; i < MP_ARRAY_SIZE(spim_peripherals); i++) {
if ((spim_peripherals[i].spim.p_reg->ENABLE & SPIM_ENABLE_ENABLE_Msk) == 0) {
self->spim_peripheral = &spim_peripherals[i];
break;
}
}
if (self->spim_peripheral == NULL) {
mp_raise_ValueError(translate("All SPI peripherals are in use"));
}
nrfx_spim_config_t config = NRFX_SPIM_DEFAULT_CONFIG; nrfx_spim_config_t config = NRFX_SPIM_DEFAULT_CONFIG;
config.frequency = NRF_SPIM_FREQ_8M; config.frequency = NRF_SPIM_FREQ_8M;
@ -97,12 +138,12 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t *
self->MISO_pin_number = NO_PIN; self->MISO_pin_number = NO_PIN;
} }
nrfx_err_t err = nrfx_spim_init(&self->spim, &config, NULL, NULL); nrfx_err_t err = nrfx_spim_init(&self->spim_peripheral->spim, &config, NULL, NULL);
// A soft reset doesn't uninit the driver so we might end up with a invalid state // A soft reset doesn't uninit the driver so we might end up with a invalid state
if (err == NRFX_ERROR_INVALID_STATE) { if (err == NRFX_ERROR_INVALID_STATE) {
nrfx_spim_uninit(&self->spim); nrfx_spim_uninit(&self->spim_peripheral->spim);
err = nrfx_spim_init(&self->spim, &config, NULL, NULL); err = nrfx_spim_init(&self->spim_peripheral->spim, &config, NULL, NULL);
} }
if (err != NRFX_SUCCESS) { if (err != NRFX_SUCCESS) {
@ -119,7 +160,7 @@ void common_hal_busio_spi_deinit(busio_spi_obj_t *self) {
if (common_hal_busio_spi_deinited(self)) if (common_hal_busio_spi_deinited(self))
return; return;
nrfx_spim_uninit(&self->spim); nrfx_spim_uninit(&self->spim_peripheral->spim);
reset_pin_number(self->clock_pin_number); reset_pin_number(self->clock_pin_number);
reset_pin_number(self->MOSI_pin_number); reset_pin_number(self->MOSI_pin_number);
@ -131,7 +172,11 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self, uint32_t baudrate, ui
if (bits != 8) if (bits != 8)
return false; return false;
nrf_spim_frequency_set(self->spim.p_reg, baudrate_to_spim_frequency(baudrate)); if (baudrate > self->spim_peripheral->max_frequency_MHz * 1000000) {
mp_raise_ValueError(translate("Baud rate too high for this SPI peripheral"));
return false;
}
nrf_spim_frequency_set(self->spim_peripheral->spim.p_reg, baudrate_to_spim_frequency(baudrate));
nrf_spim_mode_t mode = NRF_SPIM_MODE_0; nrf_spim_mode_t mode = NRF_SPIM_MODE_0;
if (polarity) { if (polarity) {
@ -140,19 +185,19 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self, uint32_t baudrate, ui
mode = (phase) ? NRF_SPIM_MODE_1 : NRF_SPIM_MODE_0; mode = (phase) ? NRF_SPIM_MODE_1 : NRF_SPIM_MODE_0;
} }
nrf_spim_configure(self->spim.p_reg, mode, NRF_SPIM_BIT_ORDER_MSB_FIRST); nrf_spim_configure(self->spim_peripheral->spim.p_reg, mode, NRF_SPIM_BIT_ORDER_MSB_FIRST);
return true; return true;
} }
bool common_hal_busio_spi_try_lock(busio_spi_obj_t *self) { bool common_hal_busio_spi_try_lock(busio_spi_obj_t *self) {
bool grabbed_lock = false; bool grabbed_lock = false;
// CRITICAL_SECTION_ENTER() // NRFX_CRITICAL_SECTION_ENTER();
// if (!self->has_lock) { if (!self->has_lock) {
grabbed_lock = true; grabbed_lock = true;
self->has_lock = true; self->has_lock = true;
// } }
// CRITICAL_SECTION_LEAVE(); // NRFX_CRITICAL_SECTION_EXIT();
return grabbed_lock; return grabbed_lock;
} }
@ -168,18 +213,19 @@ bool common_hal_busio_spi_write(busio_spi_obj_t *self, const uint8_t *data, size
if (len == 0) if (len == 0)
return true; return true;
const uint32_t parts = len / MAX_XFER_SIZE; const uint32_t max_xfer_size = self->spim_peripheral->max_xfer_size;
const uint32_t remainder = len % MAX_XFER_SIZE; const uint32_t parts = len / max_xfer_size;
const uint32_t remainder = len % max_xfer_size;
for (uint32_t i = 0; i < parts; ++i) { for (uint32_t i = 0; i < parts; ++i) {
const nrfx_spim_xfer_desc_t xfer = NRFX_SPIM_XFER_TX(data + i * MAX_XFER_SIZE, MAX_XFER_SIZE); const nrfx_spim_xfer_desc_t xfer = NRFX_SPIM_XFER_TX(data + i * max_xfer_size, max_xfer_size);
if (nrfx_spim_xfer(&self->spim, &xfer, 0) != NRFX_SUCCESS) if (nrfx_spim_xfer(&self->spim_peripheral->spim, &xfer, 0) != NRFX_SUCCESS)
return false; return false;
} }
if (remainder > 0) { if (remainder > 0) {
const nrfx_spim_xfer_desc_t xfer = NRFX_SPIM_XFER_TX(data + parts * MAX_XFER_SIZE, remainder); const nrfx_spim_xfer_desc_t xfer = NRFX_SPIM_XFER_TX(data + parts * max_xfer_size, remainder);
if (nrfx_spim_xfer(&self->spim, &xfer, 0) != NRFX_SUCCESS) if (nrfx_spim_xfer(&self->spim_peripheral->spim, &xfer, 0) != NRFX_SUCCESS)
return false; return false;
} }
@ -190,18 +236,19 @@ bool common_hal_busio_spi_read(busio_spi_obj_t *self, uint8_t *data, size_t len,
if (len == 0) if (len == 0)
return true; return true;
const uint32_t parts = len / MAX_XFER_SIZE; const uint32_t max_xfer_size = self->spim_peripheral->max_xfer_size;
const uint32_t remainder = len % MAX_XFER_SIZE; const uint32_t parts = len / max_xfer_size;
const uint32_t remainder = len % max_xfer_size;
for (uint32_t i = 0; i < parts; ++i) { for (uint32_t i = 0; i < parts; ++i) {
const nrfx_spim_xfer_desc_t xfer = NRFX_SPIM_XFER_RX(data + i * MAX_XFER_SIZE, MAX_XFER_SIZE); const nrfx_spim_xfer_desc_t xfer = NRFX_SPIM_XFER_RX(data + i * max_xfer_size, max_xfer_size);
if (nrfx_spim_xfer(&self->spim, &xfer, 0) != NRFX_SUCCESS) if (nrfx_spim_xfer(&self->spim_peripheral->spim, &xfer, 0) != NRFX_SUCCESS)
return false; return false;
} }
if (remainder > 0) { if (remainder > 0) {
const nrfx_spim_xfer_desc_t xfer = NRFX_SPIM_XFER_RX(data + parts * MAX_XFER_SIZE, remainder); const nrfx_spim_xfer_desc_t xfer = NRFX_SPIM_XFER_RX(data + parts * max_xfer_size, remainder);
if (nrfx_spim_xfer(&self->spim, &xfer, 0) != NRFX_SUCCESS) if (nrfx_spim_xfer(&self->spim_peripheral->spim, &xfer, 0) != NRFX_SUCCESS)
return false; return false;
} }
@ -212,20 +259,22 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uin
if (len == 0) if (len == 0)
return true; return true;
const uint32_t parts = len / MAX_XFER_SIZE;
const uint32_t remainder = len % MAX_XFER_SIZE; const uint32_t max_xfer_size = self->spim_peripheral->max_xfer_size;
const uint32_t parts = len / max_xfer_size;
const uint32_t remainder = len % max_xfer_size;
for (uint32_t i = 0; i < parts; ++i) { for (uint32_t i = 0; i < parts; ++i) {
const nrfx_spim_xfer_desc_t xfer = NRFX_SPIM_SINGLE_XFER(data_out + i * MAX_XFER_SIZE, MAX_XFER_SIZE, const nrfx_spim_xfer_desc_t xfer = NRFX_SPIM_SINGLE_XFER(data_out + i * max_xfer_size, max_xfer_size,
data_in + i * MAX_XFER_SIZE, MAX_XFER_SIZE); data_in + i * max_xfer_size, max_xfer_size);
if (nrfx_spim_xfer(&self->spim, &xfer, 0) != NRFX_SUCCESS) if (nrfx_spim_xfer(&self->spim_peripheral->spim, &xfer, 0) != NRFX_SUCCESS)
return false; return false;
} }
if (remainder > 0) { if (remainder > 0) {
const nrfx_spim_xfer_desc_t xfer = NRFX_SPIM_SINGLE_XFER(data_out + parts * MAX_XFER_SIZE, remainder, const nrfx_spim_xfer_desc_t xfer = NRFX_SPIM_SINGLE_XFER(data_out + parts * max_xfer_size, remainder,
data_in + parts * MAX_XFER_SIZE, remainder); data_in + parts * max_xfer_size, remainder);
if (nrfx_spim_xfer(&self->spim, &xfer, 0) != NRFX_SUCCESS) if (nrfx_spim_xfer(&self->spim_peripheral->spim, &xfer, 0) != NRFX_SUCCESS)
return false; return false;
} }
@ -233,7 +282,7 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint8_t *data_out, uin
} }
uint32_t common_hal_busio_spi_get_frequency(busio_spi_obj_t* self) { uint32_t common_hal_busio_spi_get_frequency(busio_spi_obj_t* self) {
switch (self->spim.p_reg->FREQUENCY) { switch (self->spim_peripheral->spim.p_reg->FREQUENCY) {
case NRF_SPIM_FREQ_125K: case NRF_SPIM_FREQ_125K:
return 125000; return 125000;
case NRF_SPIM_FREQ_250K: case NRF_SPIM_FREQ_250K:

View File

@ -31,12 +31,20 @@
#include "py/obj.h" #include "py/obj.h"
typedef struct { typedef struct {
mp_obj_base_t base;
nrfx_spim_t spim; nrfx_spim_t spim;
uint8_t max_frequency_MHz;
uint8_t max_xfer_size;
} spim_peripheral_t;
typedef struct {
mp_obj_base_t base;
spim_peripheral_t* spim_peripheral;
bool has_lock; bool has_lock;
uint8_t clock_pin_number; uint8_t clock_pin_number;
uint8_t MOSI_pin_number; uint8_t MOSI_pin_number;
uint8_t MISO_pin_number; uint8_t MISO_pin_number;
} busio_spi_obj_t; } busio_spi_obj_t;
void spi_reset(void);
#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_BUSIO_SPI_H #endif // MICROPY_INCLUDED_NRF_COMMON_HAL_BUSIO_SPI_H

View File

@ -82,6 +82,10 @@ uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) {
return 0; return 0;
} }
void common_hal_busio_uart_clear_rx_buffer(busio_uart_obj_t *self) {
mp_raise_NotImplementedError(translate("busio.UART not yet implemented"));
}
bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) { bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) {
mp_raise_NotImplementedError(translate("busio.UART not yet implemented")); mp_raise_NotImplementedError(translate("busio.UART not yet implemented"));
return false; return false;

View File

@ -34,8 +34,6 @@ digitalinout_result_t common_hal_digitalio_digitalinout_construct(
digitalio_digitalinout_obj_t *self, const mcu_pin_obj_t *pin) { digitalio_digitalinout_obj_t *self, const mcu_pin_obj_t *pin) {
claim_pin(pin); claim_pin(pin);
self->pin = pin; self->pin = pin;
self->output = false;
self->open_drain = false;
nrf_gpio_cfg_input(pin->number, NRF_GPIO_PIN_NOPULL); nrf_gpio_cfg_input(pin->number, NRF_GPIO_PIN_NOPULL);
@ -58,7 +56,6 @@ void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self
void common_hal_digitalio_digitalinout_switch_to_input( void common_hal_digitalio_digitalinout_switch_to_input(
digitalio_digitalinout_obj_t *self, digitalio_pull_t pull) { digitalio_digitalinout_obj_t *self, digitalio_pull_t pull) {
self->output = false;
nrf_gpio_cfg_input(self->pin->number, NRF_GPIO_PIN_NOPULL); nrf_gpio_cfg_input(self->pin->number, NRF_GPIO_PIN_NOPULL);
common_hal_digitalio_digitalinout_set_pull(self, pull); common_hal_digitalio_digitalinout_set_pull(self, pull);
} }
@ -66,62 +63,54 @@ void common_hal_digitalio_digitalinout_switch_to_input(
void common_hal_digitalio_digitalinout_switch_to_output( void common_hal_digitalio_digitalinout_switch_to_output(
digitalio_digitalinout_obj_t *self, bool value, digitalio_digitalinout_obj_t *self, bool value,
digitalio_drive_mode_t drive_mode) { digitalio_drive_mode_t drive_mode) {
self->output = true;
self->open_drain = (drive_mode == DRIVE_MODE_OPEN_DRAIN);
nrf_gpio_cfg_input(self->pin->number, NRF_GPIO_PIN_NOPULL);
common_hal_digitalio_digitalinout_set_drive_mode(self, drive_mode);
common_hal_digitalio_digitalinout_set_value(self, value); common_hal_digitalio_digitalinout_set_value(self, value);
} }
digitalio_direction_t common_hal_digitalio_digitalinout_get_direction( digitalio_direction_t common_hal_digitalio_digitalinout_get_direction(
digitalio_digitalinout_obj_t *self) { digitalio_digitalinout_obj_t *self) {
return self->output ? DIRECTION_OUTPUT : DIRECTION_INPUT;
return (nrf_gpio_pin_dir_get(self->pin->number) == NRF_GPIO_PIN_DIR_INPUT)
? DIRECTION_INPUT : DIRECTION_OUTPUT;
} }
void common_hal_digitalio_digitalinout_set_value( void common_hal_digitalio_digitalinout_set_value(
digitalio_digitalinout_obj_t *self, bool value) { digitalio_digitalinout_obj_t *self, bool value) {
if (value && self->open_drain) { nrf_gpio_pin_write(self->pin->number, value);
nrf_gpio_pin_dir_set(self->pin->number, NRF_GPIO_PIN_DIR_INPUT);
} else {
nrf_gpio_pin_dir_set(self->pin->number, NRF_GPIO_PIN_DIR_OUTPUT);
nrf_gpio_pin_write(self->pin->number, value);
}
} }
bool common_hal_digitalio_digitalinout_get_value( bool common_hal_digitalio_digitalinout_get_value(
digitalio_digitalinout_obj_t *self) { digitalio_digitalinout_obj_t *self) {
if (nrf_gpio_pin_dir_get(self->pin->number) == NRF_GPIO_PIN_DIR_INPUT) { return (nrf_gpio_pin_dir_get(self->pin->number) == NRF_GPIO_PIN_DIR_INPUT)
if (self->open_drain) { ? nrf_gpio_pin_read(self->pin->number)
return true; : nrf_gpio_pin_out_read(self->pin->number);
}
return nrf_gpio_pin_read(self->pin->number);
}
return nrf_gpio_pin_out_read(self->pin->number);
} }
void common_hal_digitalio_digitalinout_set_drive_mode( void common_hal_digitalio_digitalinout_set_drive_mode(
digitalio_digitalinout_obj_t *self, digitalio_digitalinout_obj_t *self,
digitalio_drive_mode_t drive_mode) { digitalio_drive_mode_t drive_mode) {
const bool value = common_hal_digitalio_digitalinout_get_value(self); nrf_gpio_cfg(self->pin->number,
self->open_drain = drive_mode == DRIVE_MODE_OPEN_DRAIN; NRF_GPIO_PIN_DIR_OUTPUT,
NRF_GPIO_PIN_INPUT_DISCONNECT,
// True is implemented differently between modes so reset the value to make NRF_GPIO_PIN_NOPULL,
// sure its correct for the new mode. drive_mode == DRIVE_MODE_OPEN_DRAIN ? NRF_GPIO_PIN_H0D1 : NRF_GPIO_PIN_H0H1,
if (value) { NRF_GPIO_PIN_NOSENSE);
common_hal_digitalio_digitalinout_set_value(self, value);
}
} }
digitalio_drive_mode_t common_hal_digitalio_digitalinout_get_drive_mode( digitalio_drive_mode_t common_hal_digitalio_digitalinout_get_drive_mode(
digitalio_digitalinout_obj_t *self) { digitalio_digitalinout_obj_t *self) {
if (self->open_drain) { uint32_t pin = self->pin->number;
return DRIVE_MODE_OPEN_DRAIN; // Changes pin to be a relative pin number in port.
} NRF_GPIO_Type *reg = nrf_gpio_pin_port_decode(&pin);
return DRIVE_MODE_PUSH_PULL; switch ((reg->PIN_CNF[pin] & GPIO_PIN_CNF_DRIVE_Msk) >> GPIO_PIN_CNF_DRIVE_Pos) {
case NRF_GPIO_PIN_S0D1:
case NRF_GPIO_PIN_H0D1:
return DRIVE_MODE_OPEN_DRAIN;
default:
return DRIVE_MODE_PUSH_PULL;
}
} }
void common_hal_digitalio_digitalinout_set_pull( void common_hal_digitalio_digitalinout_set_pull(
@ -151,16 +140,13 @@ digitalio_pull_t common_hal_digitalio_digitalinout_get_pull(
if (nrf_gpio_pin_dir_get(self->pin->number) == NRF_GPIO_PIN_DIR_OUTPUT) { if (nrf_gpio_pin_dir_get(self->pin->number) == NRF_GPIO_PIN_DIR_OUTPUT) {
mp_raise_AttributeError(translate("Cannot get pull while in output mode")); mp_raise_AttributeError(translate("Cannot get pull while in output mode"));
return PULL_NONE;
} }
switch (reg->PIN_CNF[pin] & GPIO_PIN_CNF_PULL_Msk) { switch ((reg->PIN_CNF[pin] & GPIO_PIN_CNF_PULL_Msk) >> GPIO_PIN_CNF_PULL_Pos) {
case NRF_GPIO_PIN_PULLUP: case NRF_GPIO_PIN_PULLUP:
return PULL_UP; return PULL_UP;
case NRF_GPIO_PIN_PULLDOWN: case NRF_GPIO_PIN_PULLDOWN:
return PULL_DOWN; return PULL_DOWN;
default: default:
return PULL_NONE; return PULL_NONE;
} }

View File

@ -32,8 +32,6 @@
typedef struct { typedef struct {
mp_obj_base_t base; mp_obj_base_t base;
const mcu_pin_obj_t *pin; const mcu_pin_obj_t *pin;
bool output;
bool open_drain;
} digitalio_digitalinout_obj_t; } digitalio_digitalinout_obj_t;
#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_DIGITALIO_DIGITALINOUT_H #endif // MICROPY_INCLUDED_NRF_COMMON_HAL_DIGITALIO_DIGITALINOUT_H

View File

@ -5,21 +5,40 @@
#define NRFX_POWER_ENABLED 1 #define NRFX_POWER_ENABLED 1
#define NRFX_POWER_CONFIG_IRQ_PRIORITY 7 #define NRFX_POWER_CONFIG_IRQ_PRIORITY 7
// Turn on nrfx supported workarounds for errata in Rev1/Rev2 of nRF52832
#ifdef NRF52832_XXAA
#define NRFX_SPIS_NRF52_ANOMALY_109_WORKAROUND_ENABLED 1
#endif
// Turn on nrfx supported workarounds for errata in Rev1 of nRF52840
#ifdef NRF52840_XXAA
#define NRFX_SPIM3_NRF52840_ANOMALY_198_WORKAROUND_ENABLED 1
#endif
// SPI // SPI
#define NRFX_SPIM_ENABLED 1 #define NRFX_SPIM_ENABLED 1
// TWIM0 and TWIM1 are the same peripherals as SPIM0 and SPIM1.
// The IRQ handlers for these peripherals are set up at compile time,
// so out of the box TWIM0/SPIM0 and TWIM1/SPIM1 cannot be shared
// between common-hal/busio/I2C.c and SPI.c.
// We could write an interrupt handler that checks whether it's
// being used for SPI or I2C, but perhaps two I2C's and 1-2 SPI's are good enough for now.
// Enable SPIM2 and SPIM3 (if available)
#define NRFX_SPIM2_ENABLED 1
#ifdef NRF52840_XXAA #ifdef NRF52840_XXAA
#define NRFX_SPIM3_ENABLED 1 #define NRFX_SPIM3_ENABLED 1
#else
#define NRFX_SPIM2_ENABLED 1
#endif #endif
#define NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY 7 #define NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY 7
#define NRFX_SPIM_MISO_PULL_CFG 1 #define NRFX_SPIM_MISO_PULL_CFG 1
// TWI aka. I2C // TWI aka. I2C; enable TWIM0 and TWIM1 (no conflict with SPIM choices)
#define NRFX_TWIM_ENABLED 1 #define NRFX_TWIM_ENABLED 1
#define NRFX_TWIM0_ENABLED 1 #define NRFX_TWIM0_ENABLED 1
#define NRFX_TWIM1_ENABLED 1
#define NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY 7 #define NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY 7
#define NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY NRF_TWIM_FREQ_400K #define NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY NRF_TWIM_FREQ_400K
@ -45,4 +64,4 @@
#define NRFX_PWM3_ENABLED 0 #define NRFX_PWM3_ENABLED 0
#endif #endif
#endif #endif // NRFX_CONFIG_H__

View File

@ -0,0 +1,38 @@
/*
* This file is part of the Micro Python project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2018 Dan Halbert for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "nrfx.h"
// Turn off cache and invalidate all data in it.
void nrf_peripherals_disable_and_clear_cache(void) {
// Disabling cache also invalidates all cache entries.
NRF_NVMC->ICACHECNF &= ~(1 << NVMC_ICACHECNF_CACHEEN_Pos);
}
// Enable cache
void nrf_peripherals_enable_cache(void) {
NRF_NVMC->ICACHECNF |= 1 << NVMC_ICACHECNF_CACHEEN_Pos;
}

View File

@ -0,0 +1,28 @@
/*
* This file is part of the Micro Python project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2018 Dan Halbert for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
void nrf_peripherals_disable_and_clear_cache(void);
void nrf_peripherals_enable_cache(void);

View File

@ -0,0 +1,35 @@
/*
* This file is part of the Micro Python project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2018 Dan Halbert for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "nrfx.h"
void nrf_peripherals_clocks_init(void) {
// Set low-frequency clock source to be crystal. If there's a crystalless board, this will need to be
// generalized.
NRF_CLOCK->LFCLKSRC = (uint32_t)((CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos) & CLOCK_LFCLKSRC_SRC_Msk);
NRF_CLOCK->TASKS_LFCLKSTART = 1UL;
}

View File

@ -0,0 +1,27 @@
/*
* This file is part of the Micro Python project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2018 Dan Halbert for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
void nrf_peripherals_clocks_init(void);

View File

@ -0,0 +1,30 @@
/*
* This file is part of the Micro Python project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2018 Dan Halbert for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "nrfx.h"
void nrf_peripherals_power_init(void) {
}

View File

@ -0,0 +1,40 @@
/*
* This file is part of the Micro Python project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2018 Dan Halbert for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "nrfx.h"
#include "nrf_nvmc.h"
void nrf_peripherals_power_init(void) {
// Set GPIO reference voltage to 3.3V if it isn't already. REGOUT0 will get reset to 0xfffffff
// if flash is erased, which sets the default to 1.8V
// This matters only when "high voltage mode" is enabled, which is true on the PCA10059,
// and might be true on other boards.
if (NRF_UICR->REGOUT0 == 0xffffffff) {
nrf_nvmc_write_word((uint32_t) &NRF_UICR->REGOUT0, UICR_REGOUT0_VOUT_3V3 << UICR_REGOUT0_VOUT_Pos);
// Must reset to make enable change.
NVIC_SystemReset();
}
}

View File

@ -0,0 +1,27 @@
/*
* This file is part of the Micro Python project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2018 Dan Halbert for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
void nrf_peripherals_power_init(void);

View File

@ -28,13 +28,26 @@
#include "supervisor/port.h" #include "supervisor/port.h"
#include "boards/board.h" #include "boards/board.h"
#include "nrf/cache.h"
#include "nrf/clocks.h"
#include "nrf/power.h"
#include "shared-module/gamepad/__init__.h" #include "shared-module/gamepad/__init__.h"
#include "common-hal/microcontroller/Pin.h" #include "common-hal/microcontroller/Pin.h"
#include "common-hal/busio/I2C.h"
#include "common-hal/busio/SPI.h"
#include "common-hal/pulseio/PWMOut.h" #include "common-hal/pulseio/PWMOut.h"
#include "tick.h" #include "tick.h"
safe_mode_t port_init(void) { safe_mode_t port_init(void) {
board_init();
nrf_peripherals_clocks_init();
// If GPIO voltage is set wrong in UICR, this will fix it, and
// will also do a reset to make the change take effect.
nrf_peripherals_power_init();
nrf_peripherals_enable_cache();
// Configure millisecond timer initialization. // Configure millisecond timer initialization.
tick_init(); tick_init();
@ -46,7 +59,12 @@ safe_mode_t port_init(void) {
return HARD_CRASH; return HARD_CRASH;
} }
#endif #endif
#endif
// Will do usb_init() if chip supports USB.
board_init();
#if 0
if (board_requests_safe_mode()) { if (board_requests_safe_mode()) {
return USER_SAFE_MODE; return USER_SAFE_MODE;
} }
@ -56,11 +74,14 @@ safe_mode_t port_init(void) {
} }
void reset_port(void) { void reset_port(void) {
#ifdef CIRCUITPY_GAMEPAD_TICKS #ifdef CIRCUITPY_GAMEPAD_TICKS
gamepad_reset(); gamepad_reset();
#endif #endif
i2c_reset();
spi_reset();
pwmout_reset(); pwmout_reset();
reset_all_pins(); reset_all_pins();
} }
@ -80,4 +101,3 @@ void HardFault_Handler(void)
// (void)bfar; // (void)bfar;
// } // }
} }

View File

@ -1,38 +1,28 @@
/**************************************************************************/ /*
/*! * This file is part of the MicroPython project, http://micropython.org/
@file usb_msc_flash.c *
@author hathach (tinyusb.org) * The MIT License (MIT)
*
@section LICENSE * Copyright (c) 2018 hathach for Adafruit Industries
*
Software License Agreement (BSD License) * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Copyright (c) 2018, Adafruit Industries (adafruit.com) * in the Software without restriction, including without limitation the rights
All rights reserved. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
Redistribution and use in source and binary forms, with or without * furnished to do so, subject to the following conditions:
modification, are permitted provided that the following conditions are met: *
1. Redistributions of source code must retain the above copyright * The above copyright notice and this permission notice shall be included in
notice, this list of conditions and the following disclaimer. * all copies or substantial portions of the Software.
2. Redistributions in binary form must reproduce the above copyright *
notice, this list of conditions and the following disclaimer in the * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
documentation and/or other materials provided with the distribution. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
3. Neither the name of the copyright holders nor the * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
names of its contributors may be used to endorse or promote products * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
derived from this software without specific prior written permission. * 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
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY * THE SOFTWARE.
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED */
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**************************************************************************/
#include "tusb.h" #include "tusb.h"
#include "internal_flash.h" #include "internal_flash.h"
@ -43,6 +33,8 @@
#include "lib/oofatfs/ff.h" #include "lib/oofatfs/ff.h"
#include "py/mpstate.h" #include "py/mpstate.h"
#include "supervisor/shared/autoreload.h"
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
/* MACRO TYPEDEF CONSTANT ENUM /* MACRO TYPEDEF CONSTANT ENUM
*------------------------------------------------------------------*/ *------------------------------------------------------------------*/
@ -56,8 +48,8 @@
// Callback invoked when received an SCSI command not in built-in list below // Callback invoked when received an SCSI command not in built-in list below
// - READ_CAPACITY10, READ_FORMAT_CAPACITY, INQUIRY, MODE_SENSE6, REQUEST_SENSE // - READ_CAPACITY10, READ_FORMAT_CAPACITY, INQUIRY, MODE_SENSE6, REQUEST_SENSE
// - READ10 and WRITE10 has their own callbacks // - READ10 and WRITE10 has their own callbacks
int32_t tud_msc_scsi_cb (uint8_t lun, uint8_t const scsi_cmd[16], void* buffer, uint16_t bufsize) { int32_t tud_msc_scsi_cb (uint8_t lun, const uint8_t scsi_cmd[16], void* buffer, uint16_t bufsize) {
void const* response = NULL; const void* response = NULL;
uint16_t resplen = 0; uint16_t resplen = 0;
switch ( scsi_cmd[0] ) { switch ( scsi_cmd[0] ) {
@ -110,7 +102,7 @@ int32_t tud_msc_read10_cb (uint8_t lun, uint32_t lba, uint32_t offset, void* buf
(void) lun; (void) lun;
(void) offset; (void) offset;
uint32_t const block_count = bufsize / MSC_FLASH_BLOCK_SIZE; const uint32_t block_count = bufsize / MSC_FLASH_BLOCK_SIZE;
internal_flash_read_blocks(buffer, lba, block_count); internal_flash_read_blocks(buffer, lba, block_count);
@ -123,7 +115,7 @@ int32_t tud_msc_write10_cb (uint8_t lun, uint32_t lba, uint32_t offset, void* bu
(void) lun; (void) lun;
(void) offset; (void) offset;
uint32_t const block_count = bufsize / MSC_FLASH_BLOCK_SIZE; const uint32_t block_count = bufsize / MSC_FLASH_BLOCK_SIZE;
// bufsize <= CFG_TUD_MSC_BUFSIZE (4096) // bufsize <= CFG_TUD_MSC_BUFSIZE (4096)
internal_flash_write_blocks(buffer, lba, block_count); internal_flash_write_blocks(buffer, lba, block_count);
@ -145,4 +137,7 @@ void tud_msc_write10_complete_cb (uint8_t lun) {
// flush pending cache when write10 is complete // flush pending cache when write10 is complete
internal_flash_flush(); internal_flash_flush();
// This write is complete, start the autoreload clock.
autoreload_start();
} }

View File

@ -67,7 +67,11 @@ extern const busio_uart_parity_obj_t busio_uart_parity_odd_obj;
STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *pos_args) { STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *pos_args) {
mp_arg_check_num(n_args, n_kw, 0, MP_OBJ_FUN_ARGS_MAX, true); mp_arg_check_num(n_args, n_kw, 0, MP_OBJ_FUN_ARGS_MAX, true);
busio_uart_obj_t *self = m_new_obj(busio_uart_obj_t); // Always initially allocate the UART object within the long-lived heap.
// This is needed to avoid crashes with certain UART implementations which
// cannot accomodate being moved after creation. (See
// https://github.com/adafruit/circuitpython/issues/1056)
busio_uart_obj_t *self = m_new_ll_obj(busio_uart_obj_t);
self->base.type = &busio_uart_type; self->base.type = &busio_uart_type;
mp_map_t kw_args; mp_map_t kw_args;
mp_map_init_fixed_table(&kw_args, n_kw, pos_args + n_args); mp_map_init_fixed_table(&kw_args, n_kw, pos_args + n_args);
@ -249,6 +253,36 @@ const mp_obj_property_t busio_uart_baudrate_obj = {
(mp_obj_t)&mp_const_none_obj}, (mp_obj_t)&mp_const_none_obj},
}; };
//| .. attribute:: in_waiting
//|
//| The number of bytes in the input buffer, available to be read
//|
STATIC mp_obj_t busio_uart_obj_get_in_waiting(mp_obj_t self_in) {
busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in);
raise_error_if_deinited(common_hal_busio_uart_deinited(self));
return MP_OBJ_NEW_SMALL_INT(common_hal_busio_uart_rx_characters_available(self));
}
MP_DEFINE_CONST_FUN_OBJ_1(busio_uart_get_in_waiting_obj, busio_uart_obj_get_in_waiting);
const mp_obj_property_t busio_uart_in_waiting_obj = {
.base.type = &mp_type_property,
.proxy = {(mp_obj_t)&busio_uart_get_in_waiting_obj,
(mp_obj_t)&mp_const_none_obj,
(mp_obj_t)&mp_const_none_obj},
};
//| .. method:: reset_input_buffer()
//|
//| Discard any unread characters in the input buffer.
//|
STATIC mp_obj_t busio_uart_obj_reset_input_buffer(mp_obj_t self_in) {
busio_uart_obj_t *self = MP_OBJ_TO_PTR(self_in);
raise_error_if_deinited(common_hal_busio_uart_deinited(self));
common_hal_busio_uart_clear_rx_buffer(self);
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(busio_uart_reset_input_buffer_obj, busio_uart_obj_reset_input_buffer);
//| .. class:: busio.UART.Parity //| .. class:: busio.UART.Parity
//| //|
//| Enum-like class to define the parity used to verify correct data transfer. //| Enum-like class to define the parity used to verify correct data transfer.
@ -303,8 +337,11 @@ STATIC const mp_rom_map_elem_t busio_uart_locals_dict_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&mp_stream_readinto_obj) }, { MP_OBJ_NEW_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&mp_stream_readinto_obj) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_write), MP_ROM_PTR(&mp_stream_write_obj) }, { MP_OBJ_NEW_QSTR(MP_QSTR_write), MP_ROM_PTR(&mp_stream_write_obj) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_reset_input_buffer), MP_ROM_PTR(&busio_uart_reset_input_buffer_obj) },
// Properties // Properties
{ MP_ROM_QSTR(MP_QSTR_baudrate), MP_ROM_PTR(&busio_uart_baudrate_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) },
// Nested Enum-like Classes. // Nested Enum-like Classes.
{ MP_ROM_QSTR(MP_QSTR_Parity), MP_ROM_PTR(&busio_uart_parity_type) }, { MP_ROM_QSTR(MP_QSTR_Parity), MP_ROM_PTR(&busio_uart_parity_type) },

View File

@ -60,6 +60,7 @@ extern void common_hal_busio_uart_set_baudrate(busio_uart_obj_t *self, uint32_t
extern uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self); 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);
extern bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self); extern bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self);
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_UART_H #endif // MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_UART_H

View File

@ -0,0 +1,90 @@
/*
* This file is part of the Micro Python project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2018 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 "shared-bindings/displayio/ColorConverter.h"
#include <stdint.h>
#include "lib/utils/context_manager_helpers.h"
#include "py/binary.h"
#include "py/objproperty.h"
#include "py/runtime.h"
#include "shared-bindings/microcontroller/Pin.h"
#include "shared-bindings/util.h"
#include "supervisor/shared/translate.h"
//| .. currentmodule:: displayio
//|
//| :class:`ColorConverter` -- Converts one color format to another
//| =========================================================================================
//|
//| Converts one color format to another.
//|
//| .. warning:: This will be changed before 4.0.0. Consider it very experimental.
//|
//| .. class:: ColorConverter()
//|
//| Create a ColorConverter object to convert color formats. Only supports RGB888 to RGB565
//| currently.
//|
// TODO(tannewt): Add support for other color formats.
//|
STATIC mp_obj_t displayio_colorconverter_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *pos_args) {
mp_arg_check_num(n_args, n_kw, 0, 0, true);
displayio_colorconverter_t *self = m_new_obj(displayio_colorconverter_t);
self->base.type = &displayio_colorconverter_type;
common_hal_displayio_colorconverter_construct(self);
return MP_OBJ_FROM_PTR(self);
}
//| .. method:: convert(color)
//|
STATIC mp_obj_t displayio_colorconverter_obj_convert(mp_obj_t self_in, mp_obj_t color_obj) {
displayio_colorconverter_t *self = MP_OBJ_TO_PTR(self_in);
mp_int_t color;
if (!mp_obj_get_int_maybe(color_obj, &color)) {
mp_raise_ValueError(translate("color should be an int"));
}
uint16_t output_color;
common_hal_displayio_colorconverter_convert(self, color, &output_color);
return MP_OBJ_NEW_SMALL_INT(output_color);
}
MP_DEFINE_CONST_FUN_OBJ_2(displayio_colorconverter_convert_obj, displayio_colorconverter_obj_convert);
STATIC const mp_rom_map_elem_t displayio_colorconverter_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_convert), MP_ROM_PTR(&displayio_colorconverter_convert_obj) },
};
STATIC MP_DEFINE_CONST_DICT(displayio_colorconverter_locals_dict, displayio_colorconverter_locals_dict_table);
const mp_obj_type_t displayio_colorconverter_type = {
{ &mp_type_type },
.name = MP_QSTR_ColorConverter,
.make_new = displayio_colorconverter_make_new,
.locals_dict = (mp_obj_dict_t*)&displayio_colorconverter_locals_dict,
};

View File

@ -0,0 +1,37 @@
/*
* This file is part of the Micro Python project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2018 Scott Shawcroft for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_COLORCONVERTER_H
#define MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_COLORCONVERTER_H
#include "shared-module/displayio/ColorConverter.h"
extern const mp_obj_type_t displayio_colorconverter_type;
void common_hal_displayio_colorconverter_construct(displayio_colorconverter_t* self);
bool common_hal_displayio_colorconverter_convert(displayio_colorconverter_t *colorconverter, uint32_t input_color, uint16_t* output_color);
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_COLORCONVERTER_H

View File

@ -83,8 +83,19 @@ STATIC mp_obj_t displayio_group_obj_append(mp_obj_t self_in, mp_obj_t layer) {
} }
MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_append_obj, displayio_group_obj_append); MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_append_obj, displayio_group_obj_append);
//| .. method:: pop()
//|
//| Remove the last item and return it.
//|
STATIC mp_obj_t displayio_group_obj_pop(mp_obj_t self_in) {
displayio_group_t *self = MP_OBJ_TO_PTR(self_in);
return common_hal_displayio_group_pop(self);
}
MP_DEFINE_CONST_FUN_OBJ_1(displayio_group_pop_obj, displayio_group_obj_pop);
STATIC const mp_rom_map_elem_t displayio_group_locals_dict_table[] = { STATIC const mp_rom_map_elem_t displayio_group_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_append), MP_ROM_PTR(&displayio_group_append_obj) }, { MP_ROM_QSTR(MP_QSTR_append), MP_ROM_PTR(&displayio_group_append_obj) },
{ MP_ROM_QSTR(MP_QSTR_pop), MP_ROM_PTR(&displayio_group_pop_obj) },
}; };
STATIC MP_DEFINE_CONST_DICT(displayio_group_locals_dict, displayio_group_locals_dict_table); STATIC MP_DEFINE_CONST_DICT(displayio_group_locals_dict, displayio_group_locals_dict_table);

View File

@ -34,5 +34,6 @@ extern const mp_obj_type_t displayio_group_type;
void common_hal_displayio_group_construct(displayio_group_t* self, uint32_t max_size); void common_hal_displayio_group_construct(displayio_group_t* self, uint32_t max_size);
void common_hal_displayio_group_append(displayio_group_t* self, mp_obj_t layer); void common_hal_displayio_group_append(displayio_group_t* self, mp_obj_t layer);
mp_obj_t common_hal_displayio_group_pop(displayio_group_t* self);
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_GROUP_H #endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_GROUP_H

View File

@ -0,0 +1,104 @@
/*
* This file is part of the Micro Python project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2018 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 "shared-bindings/displayio/OnDiskBitmap.h"
#include <stdint.h>
#include "py/runtime.h"
#include "supervisor/shared/translate.h"
//| .. currentmodule:: displayio
//|
//| :class:`OnDiskBitmap` -- Loads pixels straight from disk
//| ==========================================================================
//|
//| Loads values straight from disk. This minimizes memory use but can lead to
//| much slower pixel load times. These load times may result in frame tearing where only part of
//| the image is visible.
//|
//| .. warning:: This will likely be changed before 4.0.0. Consider it very experimental.
//|
//| It's easiest to use on a board with a built in display such as the `Hallowing M0 Express
//| <https://www.adafruit.com/product/3900>`_.
//|
//| .. code-block:: Python
//|
//| import board
//| import displayio
//| import time
//| import pulseio
//|
//| backlight = pulseio.PWMOut(board.TFT_BACKLIGHT)
//| splash = displayio.Group()
//| board.DISPLAY.show(splash)
//|
//| with open("/sample.bmp", "rb") as f:
//| odb = displayio.OnDiskBitmap(f)
//| face = displayio.Sprite(odb, pixel_shader=displayio.ColorConverter(), position=(0,0))
//| splash.append(face)
//| # Wait for the image to load.
//| board.DISPLAY.wait_for_frame()
//|
//| # Fade up the backlight
//| for i in range(100):
//| backlight.duty_cycle = i * (2 ** 15) // 100
//| time.sleep(0.01)
//|
//| # Wait forever
//| while True:
//| pass
//|
//| .. class:: OnDiskBitmap(file)
//|
//| Create an OnDiskBitmap object with the given file.
//|
//| :param file file: The open bitmap file
//|
STATIC mp_obj_t displayio_ondiskbitmap_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *pos_args) {
mp_arg_check_num(n_args, n_kw, 1, 1, false);
if (!MP_OBJ_IS_TYPE(pos_args[0], &mp_type_fileio)) {
mp_raise_TypeError(translate("file must be a file opened in byte mode"));
}
displayio_ondiskbitmap_t *self = m_new_obj(displayio_ondiskbitmap_t);
self->base.type = &displayio_ondiskbitmap_type;
common_hal_displayio_ondiskbitmap_construct(self, MP_OBJ_TO_PTR(pos_args[0]));
return MP_OBJ_FROM_PTR(self);
}
STATIC const mp_rom_map_elem_t displayio_ondiskbitmap_locals_dict_table[] = {
};
STATIC MP_DEFINE_CONST_DICT(displayio_ondiskbitmap_locals_dict, displayio_ondiskbitmap_locals_dict_table);
const mp_obj_type_t displayio_ondiskbitmap_type = {
{ &mp_type_type },
.name = MP_QSTR_OnDiskBitmap,
.make_new = displayio_ondiskbitmap_make_new,
.locals_dict = (mp_obj_dict_t*)&displayio_ondiskbitmap_locals_dict,
};

View File

@ -0,0 +1,40 @@
/*
* This file is part of the Micro Python project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2018 Scott Shawcroft for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_ONDISKBITMAP_H
#define MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_ONDISKBITMAP_H
#include "shared-module/displayio/OnDiskBitmap.h"
#include "extmod/vfs_fat.h"
extern const mp_obj_type_t displayio_ondiskbitmap_type;
void common_hal_displayio_ondiskbitmap_construct(displayio_ondiskbitmap_t *self, pyb_file_obj_t* file);
uint32_t common_hal_displayio_ondiskbitmap_get_pixel(displayio_ondiskbitmap_t *bitmap,
int16_t x, int16_t y);
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_ONDISKBITMAP_H

View File

@ -33,6 +33,9 @@
#include "py/objproperty.h" #include "py/objproperty.h"
#include "py/runtime.h" #include "py/runtime.h"
#include "shared-bindings/displayio/Bitmap.h" #include "shared-bindings/displayio/Bitmap.h"
#include "shared-bindings/displayio/ColorConverter.h"
#include "shared-bindings/displayio/OnDiskBitmap.h"
#include "shared-bindings/displayio/Palette.h"
#include "supervisor/shared/translate.h" #include "supervisor/shared/translate.h"
void unpack_position(mp_obj_t position_obj, int16_t* x, int16_t* y) { void unpack_position(mp_obj_t position_obj, int16_t* x, int16_t* y) {
@ -51,23 +54,26 @@ void unpack_position(mp_obj_t position_obj, int16_t* x, int16_t* y) {
//| :class:`Sprite` -- A particular copy of an image to display //| :class:`Sprite` -- A particular copy of an image to display
//| ========================================================================== //| ==========================================================================
//| //|
//| Position a particular image and palette combination. //| Position a particular image and pixel_shader combination. Multiple sprites can share bitmaps
//| pixel shaders.
//| //|
//| .. warning:: This will be changed before 4.0.0. Consider it very experimental. //| .. warning:: This will be changed before 4.0.0. Consider it very experimental.
//| //|
//| .. class:: Sprite(bitmap, *, palette, position, width, height) //| .. class:: Sprite(bitmap, *, pixel_shader, position, width, height)
//| //|
//| Create a Sprite object //| Create a Sprite object. The bitmap is source for 2d pixels. The pixel_shader is used to
//| convert the value and its location to a display native pixel color. This may be a simple color
//| palette lookup, a gradient, a pattern or a color transformer.
//| //|
//| //|
STATIC mp_obj_t displayio_sprite_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *pos_args) { STATIC mp_obj_t displayio_sprite_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *pos_args) {
mp_arg_check_num(n_args, n_kw, 1, 4, true); mp_arg_check_num(n_args, n_kw, 1, 4, true);
mp_map_t kw_args; mp_map_t kw_args;
mp_map_init_fixed_table(&kw_args, n_kw, pos_args + n_args); mp_map_init_fixed_table(&kw_args, n_kw, pos_args + n_args);
enum { ARG_bitmap, ARG_palette, ARG_position, ARG_width, ARG_height }; enum { ARG_bitmap, ARG_pixel_shader, ARG_position, ARG_width, ARG_height };
static const mp_arg_t allowed_args[] = { static const mp_arg_t allowed_args[] = {
{ MP_QSTR_bitmap, MP_ARG_OBJ | MP_ARG_REQUIRED }, { MP_QSTR_bitmap, MP_ARG_OBJ | MP_ARG_REQUIRED },
{ MP_QSTR_palette, MP_ARG_OBJ | MP_ARG_KW_ONLY }, { MP_QSTR_pixel_shader, MP_ARG_OBJ | MP_ARG_KW_ONLY },
{ MP_QSTR_position, MP_ARG_OBJ | MP_ARG_KW_ONLY }, { MP_QSTR_position, MP_ARG_OBJ | MP_ARG_KW_ONLY },
{ MP_QSTR_width, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = -1} }, { MP_QSTR_width, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = -1} },
{ MP_QSTR_height, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = -1} }, { MP_QSTR_height, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = -1} },
@ -83,6 +89,10 @@ STATIC mp_obj_t displayio_sprite_make_new(const mp_obj_type_t *type, size_t n_ar
displayio_bitmap_t* bmp = MP_OBJ_TO_PTR(bitmap); displayio_bitmap_t* bmp = MP_OBJ_TO_PTR(bitmap);
width = bmp->width; width = bmp->width;
height = bmp->height; height = bmp->height;
} else if (MP_OBJ_IS_TYPE(bitmap, &displayio_ondiskbitmap_type)) {
displayio_ondiskbitmap_t* bmp = MP_OBJ_TO_PTR(bitmap);
width = bmp->width;
height = bmp->height;
} else { } else {
mp_raise_TypeError(translate("unsupported bitmap type")); mp_raise_TypeError(translate("unsupported bitmap type"));
} }
@ -93,7 +103,7 @@ STATIC mp_obj_t displayio_sprite_make_new(const mp_obj_type_t *type, size_t n_ar
displayio_sprite_t *self = m_new_obj(displayio_sprite_t); displayio_sprite_t *self = m_new_obj(displayio_sprite_t);
self->base.type = &displayio_sprite_type; self->base.type = &displayio_sprite_type;
common_hal_displayio_sprite_construct(self, bitmap, args[ARG_palette].u_obj, common_hal_displayio_sprite_construct(self, bitmap, args[ARG_pixel_shader].u_obj,
width, height, x, y); width, height, x, y);
return MP_OBJ_FROM_PTR(self); return MP_OBJ_FROM_PTR(self);
} }
@ -136,40 +146,39 @@ const mp_obj_property_t displayio_sprite_position_obj = {
(mp_obj_t)&mp_const_none_obj}, (mp_obj_t)&mp_const_none_obj},
}; };
//| .. attribute:: palette //| .. attribute:: pixel_shader
//| //|
//| The color palette of the sprite. //| The pixel shader of the sprite.
//| //|
STATIC mp_obj_t displayio_sprite_obj_get_palette(mp_obj_t self_in) { STATIC mp_obj_t displayio_sprite_obj_get_pixel_shader(mp_obj_t self_in) {
displayio_sprite_t *self = MP_OBJ_TO_PTR(self_in); displayio_sprite_t *self = MP_OBJ_TO_PTR(self_in);
return common_hal_displayio_sprite_get_palette(self); return common_hal_displayio_sprite_get_pixel_shader(self);
} }
MP_DEFINE_CONST_FUN_OBJ_1(displayio_sprite_get_palette_obj, displayio_sprite_obj_get_palette); MP_DEFINE_CONST_FUN_OBJ_1(displayio_sprite_get_pixel_shader_obj, displayio_sprite_obj_get_pixel_shader);
STATIC mp_obj_t displayio_sprite_obj_set_palette(mp_obj_t self_in, mp_obj_t palette_in) { STATIC mp_obj_t displayio_sprite_obj_set_pixel_shader(mp_obj_t self_in, mp_obj_t pixel_shader) {
displayio_sprite_t *self = MP_OBJ_TO_PTR(self_in); displayio_sprite_t *self = MP_OBJ_TO_PTR(self_in);
if (!MP_OBJ_IS_TYPE(palette_in, &displayio_palette_type)) { if (!MP_OBJ_IS_TYPE(pixel_shader, &displayio_palette_type) && !MP_OBJ_IS_TYPE(pixel_shader, &displayio_colorconverter_type)) {
mp_raise_TypeError(translate("palette must be displayio.Palette")); mp_raise_TypeError(translate("pixel_shader must be displayio.Palette or displayio.ColorConverter"));
} }
displayio_palette_t *palette = MP_OBJ_TO_PTR(palette_in);
common_hal_displayio_sprite_set_palette(self, palette); common_hal_displayio_sprite_set_pixel_shader(self, pixel_shader);
return mp_const_none; return mp_const_none;
} }
MP_DEFINE_CONST_FUN_OBJ_2(displayio_sprite_set_palette_obj, displayio_sprite_obj_set_palette); MP_DEFINE_CONST_FUN_OBJ_2(displayio_sprite_set_pixel_shader_obj, displayio_sprite_obj_set_pixel_shader);
const mp_obj_property_t displayio_sprite_palette_obj = { const mp_obj_property_t displayio_sprite_pixel_shader_obj = {
.base.type = &mp_type_property, .base.type = &mp_type_property,
.proxy = {(mp_obj_t)&displayio_sprite_get_palette_obj, .proxy = {(mp_obj_t)&displayio_sprite_get_pixel_shader_obj,
(mp_obj_t)&displayio_sprite_set_palette_obj, (mp_obj_t)&displayio_sprite_set_pixel_shader_obj,
(mp_obj_t)&mp_const_none_obj}, (mp_obj_t)&mp_const_none_obj},
}; };
STATIC const mp_rom_map_elem_t displayio_sprite_locals_dict_table[] = { STATIC const mp_rom_map_elem_t displayio_sprite_locals_dict_table[] = {
// Properties // Properties
{ MP_ROM_QSTR(MP_QSTR_position), MP_ROM_PTR(&displayio_sprite_position_obj) }, { MP_ROM_QSTR(MP_QSTR_position), MP_ROM_PTR(&displayio_sprite_position_obj) },
{ MP_ROM_QSTR(MP_QSTR_palette), MP_ROM_PTR(&displayio_sprite_palette_obj) }, { MP_ROM_QSTR(MP_QSTR_pixel_shader), MP_ROM_PTR(&displayio_sprite_pixel_shader_obj) },
}; };
STATIC MP_DEFINE_CONST_DICT(displayio_sprite_locals_dict, displayio_sprite_locals_dict_table); STATIC MP_DEFINE_CONST_DICT(displayio_sprite_locals_dict, displayio_sprite_locals_dict_table);

View File

@ -32,12 +32,12 @@
extern const mp_obj_type_t displayio_sprite_type; extern const mp_obj_type_t displayio_sprite_type;
void common_hal_displayio_sprite_construct(displayio_sprite_t *self, mp_obj_t bitmap, void common_hal_displayio_sprite_construct(displayio_sprite_t *self, mp_obj_t bitmap,
mp_obj_t palette, uint16_t width, uint16_t height, uint16_t x, uint16_t y); mp_obj_t pixel_shader, uint16_t width, uint16_t height, uint16_t x, uint16_t y);
void common_hal_displayio_sprite_get_position(displayio_sprite_t *self, int16_t* x, int16_t* y); void common_hal_displayio_sprite_get_position(displayio_sprite_t *self, int16_t* x, int16_t* y);
void common_hal_displayio_sprite_set_position(displayio_sprite_t *self, int16_t x, int16_t y); void common_hal_displayio_sprite_set_position(displayio_sprite_t *self, int16_t x, int16_t y);
displayio_palette_t* common_hal_displayio_sprite_get_palette(displayio_sprite_t *self); mp_obj_t common_hal_displayio_sprite_get_pixel_shader(displayio_sprite_t *self);
void common_hal_displayio_sprite_set_palette(displayio_sprite_t *self, displayio_palette_t* palette); void common_hal_displayio_sprite_set_pixel_shader(displayio_sprite_t *self, mp_obj_t pixel_shader);
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_SPRITE_H #endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_SPRITE_H

View File

@ -31,8 +31,10 @@
#include "shared-bindings/displayio/__init__.h" #include "shared-bindings/displayio/__init__.h"
#include "shared-bindings/displayio/Bitmap.h" #include "shared-bindings/displayio/Bitmap.h"
#include "shared-bindings/displayio/ColorConverter.h"
#include "shared-bindings/displayio/FourWire.h" #include "shared-bindings/displayio/FourWire.h"
#include "shared-bindings/displayio/Group.h" #include "shared-bindings/displayio/Group.h"
#include "shared-bindings/displayio/OnDiskBitmap.h"
#include "shared-bindings/displayio/Palette.h" #include "shared-bindings/displayio/Palette.h"
#include "shared-bindings/displayio/Sprite.h" #include "shared-bindings/displayio/Sprite.h"
@ -57,8 +59,10 @@
//| :maxdepth: 3 //| :maxdepth: 3
//| //|
//| Bitmap //| Bitmap
//| ColorConverter
//| FourWire //| FourWire
//| Group //| Group
//| OnDiskBitmap
//| Palette //| Palette
//| Sprite //| Sprite
//| //|
@ -68,7 +72,9 @@
STATIC const mp_rom_map_elem_t displayio_module_globals_table[] = { STATIC const mp_rom_map_elem_t displayio_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_displayio) }, { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_displayio) },
{ MP_ROM_QSTR(MP_QSTR_Bitmap), MP_ROM_PTR(&displayio_bitmap_type) }, { MP_ROM_QSTR(MP_QSTR_Bitmap), MP_ROM_PTR(&displayio_bitmap_type) },
{ MP_ROM_QSTR(MP_QSTR_ColorConverter), MP_ROM_PTR(&displayio_colorconverter_type) },
{ MP_ROM_QSTR(MP_QSTR_Group), MP_ROM_PTR(&displayio_group_type) }, { MP_ROM_QSTR(MP_QSTR_Group), MP_ROM_PTR(&displayio_group_type) },
{ MP_ROM_QSTR(MP_QSTR_OnDiskBitmap), MP_ROM_PTR(&displayio_ondiskbitmap_type) },
{ MP_ROM_QSTR(MP_QSTR_Palette), MP_ROM_PTR(&displayio_palette_type) }, { MP_ROM_QSTR(MP_QSTR_Palette), MP_ROM_PTR(&displayio_palette_type) },
{ MP_ROM_QSTR(MP_QSTR_Sprite), MP_ROM_PTR(&displayio_sprite_type) }, { MP_ROM_QSTR(MP_QSTR_Sprite), MP_ROM_PTR(&displayio_sprite_type) },

View File

@ -0,0 +1,41 @@
/*
* This file is part of the Micro Python project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2018 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 "shared-bindings/displayio/ColorConverter.h"
void common_hal_displayio_colorconverter_construct(displayio_colorconverter_t* self) {
}
bool common_hal_displayio_colorconverter_convert(displayio_colorconverter_t *self, uint32_t input_color, uint16_t* output_color) {
// TODO(tannewt): Validate the color input against the input format.
uint32_t r5 = (input_color >> 19);
uint32_t g6 = (input_color >> 10) & 0x3f;
uint32_t b5 = (input_color >> 3) & 0x1f;
uint32_t packed = r5 << 11 | g6 << 5 | b5;
// swap bytes
*output_color = __builtin_bswap16(packed);
return true;
}

View File

@ -0,0 +1,39 @@
/*
* This file is part of the Micro Python project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2018 Scott Shawcroft for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef MICROPY_INCLUDED_SHARED_MODULE_DISPLAYIO_COLORCONVERTER_H
#define MICROPY_INCLUDED_SHARED_MODULE_DISPLAYIO_COLORCONVERTER_H
#include <stdbool.h>
#include <stdint.h>
#include "py/obj.h"
typedef struct {
mp_obj_base_t base;
} displayio_colorconverter_t;
#endif // MICROPY_INCLUDED_SHARED_MODULE_DISPLAYIO_COLORCONVERTER_H

View File

@ -40,13 +40,26 @@ void common_hal_displayio_group_append(displayio_group_t* self, mp_obj_t layer)
} }
self->children[self->size] = layer; self->children[self->size] = layer;
self->size++; self->size++;
self->needs_refresh = true;
}
mp_obj_t common_hal_displayio_group_pop(displayio_group_t* self) {
if (self->size == 0) {
mp_raise_IndexError(translate("Group empty"));
}
self->size--;
mp_obj_t item = self->children[self->size];
self->children[self->size] = NULL;
self->needs_refresh = true;
return item;
} }
void displayio_group_construct(displayio_group_t* self, mp_obj_t* child_array, uint32_t max_size) { void displayio_group_construct(displayio_group_t* self, mp_obj_t* child_array, uint32_t max_size) {
self->x = 0; self->x = 0;
self->y = 1; self->y = 0;
self->children = child_array; self->children = child_array;
self->max_size = max_size; self->max_size = max_size;
self->needs_refresh = false;
} }
bool displayio_group_get_pixel(displayio_group_t *self, int16_t x, int16_t y, uint16_t* pixel) { bool displayio_group_get_pixel(displayio_group_t *self, int16_t x, int16_t y, uint16_t* pixel) {
@ -65,6 +78,9 @@ bool displayio_group_get_pixel(displayio_group_t *self, int16_t x, int16_t y, ui
} }
bool displayio_group_needs_refresh(displayio_group_t *self) { bool displayio_group_needs_refresh(displayio_group_t *self) {
if (self->needs_refresh) {
return true;
}
for (int32_t i = self->size - 1; i >= 0 ; i--) { for (int32_t i = self->size - 1; i >= 0 ; i--) {
mp_obj_t layer = self->children[i]; mp_obj_t layer = self->children[i];
if (MP_OBJ_IS_TYPE(layer, &displayio_sprite_type)) { if (MP_OBJ_IS_TYPE(layer, &displayio_sprite_type)) {
@ -78,6 +94,7 @@ bool displayio_group_needs_refresh(displayio_group_t *self) {
} }
void displayio_group_finish_refresh(displayio_group_t *self) { void displayio_group_finish_refresh(displayio_group_t *self) {
self->needs_refresh = false;
for (int32_t i = self->size - 1; i >= 0 ; i--) { for (int32_t i = self->size - 1; i >= 0 ; i--) {
mp_obj_t layer = self->children[i]; mp_obj_t layer = self->children[i];
if (MP_OBJ_IS_TYPE(layer, &displayio_sprite_type)) { if (MP_OBJ_IS_TYPE(layer, &displayio_sprite_type)) {

View File

@ -39,6 +39,7 @@ typedef struct {
uint16_t size; uint16_t size;
uint16_t max_size; uint16_t max_size;
mp_obj_t* children; mp_obj_t* children;
bool needs_refresh;
} displayio_group_t; } displayio_group_t;

View File

@ -0,0 +1,93 @@
/*
* This file is part of the Micro Python project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2018 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 "shared-bindings/displayio/OnDiskBitmap.h"
#include <string.h>
#include "py/mperrno.h"
#include "py/runtime.h"
static uint32_t read_word(uint16_t* bmp_header, uint16_t index) {
return bmp_header[index] | bmp_header[index + 1] << 16;
}
void common_hal_displayio_ondiskbitmap_construct(displayio_ondiskbitmap_t *self, pyb_file_obj_t* file) {
// Load the wave
self->file = file;
uint16_t bmp_header[24];
f_rewind(&self->file->fp);
UINT bytes_read;
if (f_read(&self->file->fp, bmp_header, 48, &bytes_read) != FR_OK) {
mp_raise_OSError(MP_EIO);
}
if (bytes_read != 48 ||
memcmp(bmp_header, "BM", 2) != 0) {
mp_raise_ValueError(translate("Invalid BMP file"));
}
// We can't cast because we're not aligned.
self->data_offset = read_word(bmp_header, 5);
uint32_t header_size = read_word(bmp_header, 7);
uint32_t compression = read_word(bmp_header, 15);
if (!(header_size == 12 || header_size == 40 || header_size == 108 || header_size == 124) ||
!(compression == 0)) {
mp_raise_ValueError_varg(translate("Only Windows format, uncompressed BMP supported %d"), header_size);
}
// TODO(tannewt): Support bitfield compressed colors since RGB565 can be produced by the GIMP.
uint16_t bits_per_pixel = bmp_header[14];
if (bits_per_pixel < 24) {
mp_raise_ValueError_varg(translate("Only true color (24 bpp or higher) BMP supported %x"), bits_per_pixel);
}
self->bytes_per_pixel = bits_per_pixel / 8;
self->width = read_word(bmp_header, 9);
self->height = read_word(bmp_header, 11);
uint32_t byte_width = self->width * self->bytes_per_pixel;
self->stride = byte_width;
// Rows are word aligned.
if (self->stride % 4 != 0) {
self->stride += 4 - self->stride % 4;
}
}
uint32_t common_hal_displayio_ondiskbitmap_get_pixel(displayio_ondiskbitmap_t *self,
int16_t x, int16_t y) {
if (x < 0 || x >= self->width || y < 0 || y >= self->height) {
return 0;
}
uint32_t location = self->data_offset + (self->height - y) * self->stride + x * self->bytes_per_pixel;
// We don't cache here because the underlying FS caches sectors.
f_lseek(&self->file->fp, location);
UINT bytes_read;
uint32_t pixel = 0;
uint32_t result = f_read(&self->file->fp, &pixel, self->bytes_per_pixel, &bytes_read);
if (result == FR_OK) {
return pixel;
}
return 0;
}

View File

@ -0,0 +1,47 @@
/*
* This file is part of the Micro Python project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2018 Scott Shawcroft for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef MICROPY_INCLUDED_SHARED_MODULE_DISPLAYIO_ONDISKBITMAP_H
#define MICROPY_INCLUDED_SHARED_MODULE_DISPLAYIO_ONDISKBITMAP_H
#include <stdbool.h>
#include <stdint.h>
#include "py/obj.h"
#include "extmod/vfs_fat.h"
typedef struct {
mp_obj_base_t base;
uint16_t width;
uint16_t height;
uint16_t data_offset;
uint16_t stride;
pyb_file_obj_t* file;
uint8_t bytes_per_pixel;
} displayio_ondiskbitmap_t;
#endif // MICROPY_INCLUDED_SHARED_MODULE_DISPLAYIO_ONDISKBITMAP_H

View File

@ -26,15 +26,17 @@
#include "shared-bindings/displayio/Sprite.h" #include "shared-bindings/displayio/Sprite.h"
#include "shared-bindings/displayio/Bitmap.h" #include "shared-bindings/displayio/Bitmap.h"
#include "shared-bindings/displayio/ColorConverter.h"
#include "shared-bindings/displayio/OnDiskBitmap.h"
#include "shared-bindings/displayio/Palette.h"
void common_hal_displayio_sprite_construct(displayio_sprite_t *self, mp_obj_t bitmap, void common_hal_displayio_sprite_construct(displayio_sprite_t *self, mp_obj_t bitmap,
mp_obj_t palette, uint16_t width, uint16_t height, uint16_t x, uint16_t y) { mp_obj_t pixel_shader, uint16_t width, uint16_t height, uint16_t x, uint16_t y) {
self->width = width; self->width = width;
self->height = height; self->height = height;
self->bitmap = bitmap; self->bitmap = bitmap;
self->palette = palette; self->pixel_shader = pixel_shader;
self->x = x; self->x = x;
self->y = y; self->y = y;
} }
@ -51,12 +53,12 @@ void common_hal_displayio_sprite_set_position(displayio_sprite_t *self, int16_t
} }
displayio_palette_t* common_hal_displayio_sprite_get_palette(displayio_sprite_t *self) { mp_obj_t common_hal_displayio_sprite_get_pixel_shader(displayio_sprite_t *self) {
return self->palette; return self->pixel_shader;
} }
void common_hal_displayio_sprite_set_palette(displayio_sprite_t *self, displayio_palette_t* palette) { void common_hal_displayio_sprite_set_pixel_shader(displayio_sprite_t *self, mp_obj_t pixel_shader) {
self->palette = palette; self->pixel_shader = pixel_shader;
self->needs_refresh = true; self->needs_refresh = true;
} }
@ -66,12 +68,19 @@ bool displayio_sprite_get_pixel(displayio_sprite_t *self, int16_t x, int16_t y,
if (y < 0 || y >= self->height || x >= self->width || x < 0) { if (y < 0 || y >= self->height || x >= self->width || x < 0) {
return false; return false;
} }
uint32_t value;
if (MP_OBJ_IS_TYPE(self->bitmap, &displayio_bitmap_type)) {
value = common_hal_displayio_bitmap_get_pixel(self->bitmap, x, y);
} else if (MP_OBJ_IS_TYPE(self->bitmap, &displayio_ondiskbitmap_type)) {
value = common_hal_displayio_ondiskbitmap_get_pixel(self->bitmap, x, y);
}
uint32_t value = common_hal_displayio_bitmap_get_pixel(self->bitmap, x, y); if (self->pixel_shader == mp_const_none) {
if (self->palette == mp_const_none) {
*pixel = value; *pixel = value;
return true; return true;
} else if (MP_OBJ_IS_TYPE(self->palette, &displayio_palette_type) && displayio_palette_get_color(self->palette, value, pixel)) { } else if (MP_OBJ_IS_TYPE(self->pixel_shader, &displayio_palette_type) && displayio_palette_get_color(self->pixel_shader, value, pixel)) {
return true;
} else if (MP_OBJ_IS_TYPE(self->pixel_shader, &displayio_colorconverter_type) && common_hal_displayio_colorconverter_convert(self->pixel_shader, value, pixel)) {
return true; return true;
} }
@ -79,12 +88,12 @@ bool displayio_sprite_get_pixel(displayio_sprite_t *self, int16_t x, int16_t y,
} }
bool displayio_sprite_needs_refresh(displayio_sprite_t *self) { bool displayio_sprite_needs_refresh(displayio_sprite_t *self) {
return self->needs_refresh || displayio_palette_needs_refresh(self->palette); return self->needs_refresh || displayio_palette_needs_refresh(self->pixel_shader);
} }
void displayio_sprite_finish_refresh(displayio_sprite_t *self) { void displayio_sprite_finish_refresh(displayio_sprite_t *self) {
self->needs_refresh = false; self->needs_refresh = false;
displayio_palette_finish_refresh(self->palette); displayio_palette_finish_refresh(self->pixel_shader);
// TODO(tannewt): We could double buffer changes to position and move them over here. // TODO(tannewt): We could double buffer changes to position and move them over here.
// That way they won't change during a refresh and tear. // That way they won't change during a refresh and tear.
} }

View File

@ -31,12 +31,11 @@
#include <stdint.h> #include <stdint.h>
#include "py/obj.h" #include "py/obj.h"
#include "shared-bindings/displayio/Palette.h"
typedef struct { typedef struct {
mp_obj_base_t base; mp_obj_base_t base;
mp_obj_t bitmap; mp_obj_t bitmap;
displayio_palette_t* palette; mp_obj_t pixel_shader;
uint16_t x; uint16_t x;
uint16_t y; uint16_t y;
uint16_t width; uint16_t width;

View File

@ -1,7 +1,10 @@
#!/usr/bin/env bash
rm -rf ports/atmel-samd/build* rm -rf ports/atmel-samd/build*
rm -rf ports/esp8266/build* rm -rf ports/esp8266/build*
rm -rf ports/nrf/build* rm -rf ports/nrf/build*
# Alphabetical.
HW_BOARDS="\ HW_BOARDS="\
arduino_zero \ arduino_zero \
circuitplayground_express \ circuitplayground_express \
@ -16,40 +19,42 @@ feather_m0_rfm9x \
feather_m4_express \ feather_m4_express \
feather_nrf52832 \ feather_nrf52832 \
feather_nrf52840_express \ feather_nrf52840_express \
grandcentral_m4_express \
pca10056 \
feather_radiofruit_zigbee \ feather_radiofruit_zigbee \
gemma_m0 \ gemma_m0 \
grandcentral_m4_express \
hallowing_m0_express \ hallowing_m0_express \
itsybitsy_m0_express \ itsybitsy_m0_express \
itsybitsy_m4_express \ itsybitsy_m4_express \
metro_m0_express \ metro_m0_express \
metro_m4_express \ metro_m4_express \
pca10056 \
pca10059 \
pirkey_m0 \ pirkey_m0 \
trellis_m4_express \
trinket_m0 \ trinket_m0 \
" "
ROSIE_SETUPS="rosie-ci" ROSIE_SETUPS="rosie-ci"
PARALLEL="-j 5" PARALLEL="-j 5"
if [ "$TRAVIS" == "true" ]; then if [[ "$TRAVIS" == "true" ]]; then
PARALLEL="-j 2" PARALLEL="-j 2"
fi fi
if [ -z "$TRAVIS_BOARD" ]; then if [[ -z "$TRAVIS_BOARD" ]]; then
boards=$HW_BOARDS boards=$HW_BOARDS
else else
boards=$TRAVIS_BOARD boards=$TRAVIS_BOARD
fi fi
version=`git describe --tags --exact-match` version=`git describe --tags --exact-match`
if [ $? -ne 0 ]; then if [[ $? -ne 0 ]]; then
version=`date +%Y%m%d`-`git rev-parse --short HEAD` version=`date +%Y%m%d`-`git rev-parse --short HEAD`
fi fi
if [ "$TRAVIS" == "true" ]; then if [[ "$TRAVIS" == "true" ]]; then
sha=$TRAVIS_COMMIT sha=$TRAVIS_COMMIT
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
version=`date +%Y%m%d`-`echo $TRAVIS_PULL_REQUEST_SHA | cut -c1-7` version=`date +%Y%m%d`-`echo $TRAVIS_PULL_REQUEST_SHA | cut -c1-7`
sha=$TRAVIS_PULL_REQUEST_SHA sha=$TRAVIS_PULL_REQUEST_SHA
fi fi
@ -61,23 +66,18 @@ for board in $boards; do
for language_file in $(ls locale/*.po); do for language_file in $(ls locale/*.po); do
language=$(basename -s .po $language_file) language=$(basename -s .po $language_file)
echo "Building $board for $language" echo "Building $board for $language"
if [ $board == "feather_huzzah" ]; then if [[ $board == "feather_huzzah" ]]; then
make $PARALLEL -C ports/esp8266 TRANSLATION=$language BOARD=feather_huzzah make $PARALLEL -C ports/esp8266 TRANSLATION=$language BOARD=$board
(( exit_status = exit_status || $? )) (( exit_status = exit_status || $? ))
temp_filename=ports/esp8266/build/firmware-combined.bin temp_filename=ports/esp8266/build/firmware-combined.bin
extension=bin extension=bin
elif [ $board == "feather_nrf52832" ]; then elif [[ $board == "feather_nrf52832" ]]; then
make $PARALLEL -C ports/nrf TRANSLATION=$language BOARD=feather_nrf52832 make $PARALLEL -C ports/nrf TRANSLATION=$language BOARD=$board
(( exit_status = exit_status || $? )) (( exit_status = exit_status || $? ))
temp_filename=ports/nrf/build-$board-s132/firmware.bin temp_filename=ports/nrf/build-$board-s132/firmware.bin
extension=bin extension=bin
elif [ $board == "feather_nrf52840_express" ]; then elif [[ $board == "feather_nrf52840_express" || $board == "pca10056" || $board == "pca10059" ]]; then
make $PARALLEL -C ports/nrf TRANSLATION=$language BOARD=feather_nrf52840_express SD=s140 make $PARALLEL -C ports/nrf TRANSLATION=$language BOARD=$board SD=s140
(( exit_status = exit_status || $? ))
temp_filename=ports/nrf/build-$board-s140/firmware.uf2
extension=uf2
elif [ $board == "pca10056" ]; then
make $PARALLEL -C ports/nrf TRANSLATION=$language BOARD=pca10056 SD=s140
(( exit_status = exit_status || $? )) (( exit_status = exit_status || $? ))
temp_filename=ports/nrf/build-$board-s140/firmware.uf2 temp_filename=ports/nrf/build-$board-s140/firmware.uf2
extension=uf2 extension=uf2
@ -93,7 +93,7 @@ for board in $boards; do
cp $temp_filename $final_filename cp $temp_filename $final_filename
(( exit_status = exit_status || $? )) (( exit_status = exit_status || $? ))
# Only upload to Rosie if its a pull request. # Only upload to Rosie if its a pull request.
if [ "$TRAVIS" == "true" ]; then if [[ "$TRAVIS" == "true" ]]; then
for rosie in $ROSIE_SETUPS; do for rosie in $ROSIE_SETUPS; do
echo "Uploading to https://$rosie.ngrok.io/upload/$sha" echo "Uploading to https://$rosie.ngrok.io/upload/$sha"
curl -F "file=@$final_filename" https://$rosie.ngrok.io/upload/$sha curl -F "file=@$final_filename" https://$rosie.ngrok.io/upload/$sha