From e1a843878e4272334869b1db4a8222ae344f5cb8 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 17 Aug 2020 09:48:17 -0400 Subject: [PATCH 01/82] add robots.txt to specify doc versions to appear in search engines --- conf.py | 2 +- docs/robots.txt | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 docs/robots.txt diff --git a/conf.py b/conf.py index 4a8b72584e..f7d028c19b 100644 --- a/conf.py +++ b/conf.py @@ -272,7 +272,7 @@ html_static_path = ['docs/static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. -#html_extra_path = [] +html_extra_path = ["docs/robots.txt"] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. diff --git a/docs/robots.txt b/docs/robots.txt new file mode 100644 index 0000000000..39a4eaeed9 --- /dev/null +++ b/docs/robots.txt @@ -0,0 +1,6 @@ +User-agent: * +Allow: /*/latest/ +Allow: /en/latest/ # Fallback for bots that don't understand wildcards +Allow: /*/5.3.x/ +Allow: /en/5.3.x/ # Fallback for bots that don't understand wildcards +Disallow: / From 90c203a3dd0c25b39909e98ec64dcdd0fc73054c Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Sun, 8 Nov 2020 18:39:20 -0800 Subject: [PATCH 02/82] add module msgpack --- ports/nrf/mpconfigport.mk | 2 + py/circuitpy_defns.mk | 4 + py/circuitpy_mpconfig.h | 8 + py/circuitpy_mpconfig.mk | 4 + shared-bindings/msgpack/__init__.c | 391 +++++++++++++++++++++++++++++ shared-bindings/msgpack/__init__.h | 34 +++ 6 files changed, 443 insertions(+) create mode 100644 shared-bindings/msgpack/__init__.c create mode 100644 shared-bindings/msgpack/__init__.h diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index 9560064fbc..2ee182b7d5 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -52,6 +52,8 @@ MCU_SUB_VARIANT = nrf52840 # Fits on nrf52840 but space is tight on nrf52833. CIRCUITPY_AESIO ?= 1 +CIRCUITPY_MSGPACK ?= 1 + SD ?= s140 SOFTDEV_VERSION ?= 6.1.0 diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index ccdf973e9f..144168c79e 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -283,6 +283,9 @@ endif ifeq ($(CIRCUITPY_PEW),1) SRC_PATTERNS += _pew/% endif +ifeq ($(CIRCUITPY_MSGPACK),1) +SRC_PATTERNS += msgpack/% +endif # All possible sources are listed here, and are filtered by SRC_PATTERNS in SRC_COMMON_HAL SRC_COMMON_HAL_ALL = \ @@ -396,6 +399,7 @@ $(filter $(SRC_PATTERNS), \ fontio/Glyph.c \ math/__init__.c \ microcontroller/RunMode.c \ + msgpack/__init__.c \ ) SRC_BINDINGS_ENUMS += \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index bffab4f30f..3c4e5c2909 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -754,6 +754,13 @@ extern const struct _mp_obj_module_t wifi_module; #define WIFI_MODULE #endif +#if CIRCUITPY_MSGPACK +extern const struct _mp_obj_module_t msgpack_module; +#define MSGPACK_MODULE { MP_ROM_QSTR(MP_QSTR_msgpack), MP_ROM_PTR(&msgpack_module) }, +#else +#define MSGPACK_MODULE +#endif + // Define certain native modules with weak links so they can be replaced with Python // implementations. This list may grow over time. #define MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS \ @@ -839,6 +846,7 @@ extern const struct _mp_obj_module_t wifi_module; USTACK_MODULE \ WATCHDOG_MODULE \ WIFI_MODULE \ + MSGPACK_MODULE \ // If weak links are enabled, just include strong links in the main list of modules, // and also include the underscore alternate names. diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 08e7737180..38ca795849 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -296,3 +296,7 @@ CFLAGS += -DCIRCUITPY_WIFI=$(CIRCUITPY_WIFI) # Enabled micropython.native decorator (experimental) CIRCUITPY_ENABLE_MPY_NATIVE ?= 0 CFLAGS += -DCIRCUITPY_ENABLE_MPY_NATIVE=$(CIRCUITPY_ENABLE_MPY_NATIVE) + +CIRCUITPY_MSGPACK ?= 0 +CFLAGS += -DCIRCUITPY_MSGPACK=$(CIRCUITPY_MSGPACK) + diff --git a/shared-bindings/msgpack/__init__.c b/shared-bindings/msgpack/__init__.c new file mode 100644 index 0000000000..74ab644702 --- /dev/null +++ b/shared-bindings/msgpack/__init__.c @@ -0,0 +1,391 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Bernhard Boser + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "py/binary.h" +#include "py/objarray.h" +#include "py/objlist.h" +#include "py/objstringio.h" +#include "py/parsenum.h" +#include "py/runtime.h" +#include "py/stream.h" + +#include "supervisor/shared/translate.h" + +//////////////////////////////////////////////////////////////// +// stream management + +typedef struct _msgpack_stream_t { + mp_obj_t stream_obj; + mp_uint_t (*read)(mp_obj_t obj, void *buf, mp_uint_t size, int *errcode); + mp_uint_t (*write)(mp_obj_t obj, const void *buf, mp_uint_t size, int *errcode); + int errcode; +} msgpack_stream_t; + +STATIC msgpack_stream_t get_stream(mp_obj_t stream_obj, int flags) { + const mp_stream_p_t *stream_p = mp_get_stream_raise(stream_obj, flags); + msgpack_stream_t s = {stream_obj, stream_p->read, stream_p->write, 0}; + return s; +} + +//////////////////////////////////////////////////////////////// +// readers + +STATIC void read(msgpack_stream_t *s, void *buf, mp_uint_t size) { + if (size == 0) return; + mp_uint_t ret = s->read(s->stream_obj, buf, size, &s->errcode); + if (s->errcode != 0) { + mp_raise_OSError(s->errcode); + } + if (ret == 0) { + mp_raise_msg(&mp_type_EOFError, NULL); + } +} + +STATIC uint32_t read_bytes(msgpack_stream_t *s, mp_uint_t n_bytes) { + uint32_t res = 0; + read(s, &res, n_bytes); + return res; +} + +size_t read_size(msgpack_stream_t *s, uint8_t len_index) { + size_t n_bytes = 4; + switch (len_index) { + case 0: n_bytes = 1; break; + case 1: n_bytes = 2; break; + case 2: n_bytes = 4; break; + } + size_t res = 0; + read(s, &res, n_bytes); + return res; +} + +//////////////////////////////////////////////////////////////// +// writers + +STATIC void write(msgpack_stream_t *s, const void *buf, mp_uint_t size) { + mp_uint_t ret = s->write(s->stream_obj, buf, size, &s->errcode); + if (s->errcode != 0) { + mp_raise_OSError(s->errcode); + } + if (ret == 0) { + mp_raise_msg(&mp_type_EOFError, NULL); + } +} + +STATIC void write_bytes(msgpack_stream_t *s, mp_uint_t n_bytes, uint32_t obj) { + write(s, &obj, n_bytes); +} + +void write_size(msgpack_stream_t *s, uint8_t code, size_t size) { + if ((uint8_t)size == size) { + write_bytes(s, 1, code); + write_bytes(s, 1, size); + } else if ((uint16_t)size == size) { + write_bytes(s, 1, code+1); + write_bytes(s, 2, size); + } else { + write_bytes(s, 1, code+2); + write_bytes(s, 4, size); + } +} + +//////////////////////////////////////////////////////////////// +// packers + +// This is a helper function to iterate through a dictionary. The state of +// the iteration is held in *cur and should be initialised with zero for the +// first call. Will return NULL when no more elements are available. +STATIC mp_map_elem_t *dict_iter_next(mp_obj_dict_t *dict, size_t *cur) { + size_t max = dict->map.alloc; + mp_map_t *map = &dict->map; + + for (size_t i = *cur; i < max; i++) { + if (MP_MAP_SLOT_IS_FILLED(map, i)) { + *cur = i + 1; + return &(map->table[i]); + } + } + + return NULL; +} + + +STATIC void pack_int(msgpack_stream_t *s, int32_t x) { + if (x > -32 && x < 128) { + write_bytes(s, 1, x); + } else if ((int8_t)x == x) { + write_bytes(s, 1, 0xd0); + write_bytes(s, 1, x); + } else if ((int16_t)x == x) { + write_bytes(s, 1, 0xd1); + write_bytes(s, 2, x); + } else { + write_bytes(s, 1, 0xd2); + write_bytes(s, 4, x); + } +} + +void pack_bin(msgpack_stream_t *s, const uint8_t* data, size_t len) { + write_size(s, 0xc4, len); + for (size_t i=0; ilen); + for (size_t i=0; ilen; i++) { + _pack(self->items[i], s); + } + } else if (MP_OBJ_IS_TYPE(obj, &mp_type_list)) { + // list (layout differs from tuple) + mp_obj_list_t *self = MP_OBJ_TO_PTR(obj); + pack_array(s, self->len); + for (size_t i=0; ilen; i++) { + _pack(self->items[i], s); + } + } else if (MP_OBJ_IS_TYPE(obj, &mp_type_dict)) { + // dict + mp_obj_dict_t *self = MP_OBJ_TO_PTR(obj); + pack_dict(s, self->map.used); + size_t cur = 0; + mp_map_elem_t *next = NULL; + while ((next = dict_iter_next(self, &cur)) != NULL) { + _pack(next->key, s); + _pack(next->value, s); + } + } else if (mp_obj_is_float(obj)) { + mp_float_t f = mp_obj_float_get(obj); + write_bytes(s, 1, 0xca); + write(s, &f, 4); + } else if (obj == mp_const_none) { + write_bytes(s, 1, 0xc0); + } else if (obj == mp_const_false) { + write_bytes(s, 1, 0xc2); + } else if (obj == mp_const_true) { + write_bytes(s, 1, 0xc3); + } else { + mp_raise_ValueError(translate("no packer")); + } +} + +// Write obj to stream in msgpack format +STATIC mp_obj_t mod_msgpack_pack(mp_obj_t obj, mp_obj_t stream_obj) { + msgpack_stream_t s = get_stream(stream_obj, MP_STREAM_OP_WRITE); + _pack(obj, &s); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_msgpack_pack_obj, mod_msgpack_pack); + +//////////////////////////////////////////////////////////////// +// un-packers + +STATIC mp_obj_t _unpack(msgpack_stream_t *s) { + uint8_t code = read_bytes(s, 1); + if (((code & 0b10000000) == 0) || ((code & 0b11100000) == 0b11100000)) { + // int + return MP_OBJ_NEW_SMALL_INT((int8_t)code); + } + if ((code & 0b11100000) == 0b10100000) { + // str + size_t len = code & 0b11111; + // allocate on stack; len < 32 + char str[len]; + read(s, &str, len); + return mp_obj_new_str(str, len); + } + if ((code & 0b11110000) == 0b10010000) { + // array (tuple) + size_t len = code & 0b1111; + mp_obj_tuple_t *t = MP_OBJ_TO_PTR(mp_obj_new_tuple(len, NULL)); + for (size_t i=0; iitems[i] = _unpack(s); + } + return MP_OBJ_FROM_PTR(t); + } + if ((code & 0b11110000) == 0b10000000) { + // map (dict) + size_t len = code & 0b1111; + mp_obj_dict_t *d = MP_OBJ_TO_PTR(mp_obj_new_dict(len)); + for (size_t i=0; iitems[i] = _unpack(s); + } + return MP_OBJ_FROM_PTR(t); + } + case 0xc1: // never used + case 0xc7: // ext 8 + case 0xc8: // ext 16 + case 0xc9: // ext 32 + case 0xcb: // float 64 + case 0xcc: // uint 8 + case 0xcd: // uint 16 + case 0xce: // uint 32 + case 0xcf: // uint 64 + case 0xd3: // int 64 + case 0xd4: // fixenxt 1 + case 0xd5: // fixenxt 2 + case 0xd6: // fixenxt 4 + case 0xd7: // fixenxt 8 + case 0xd8: // fixenxt 16 + default: + mp_raise_ValueError(translate("no unpacker found")); + } +} + +// Read msgpack encoded object from stream +STATIC mp_obj_t mod_msgpack_unpack(mp_obj_t stream_obj) { + msgpack_stream_t s = get_stream(stream_obj, MP_STREAM_OP_READ); + return _unpack(&s); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_msgpack_unpack_obj, mod_msgpack_unpack); + +STATIC const mp_rom_map_elem_t msgpack_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_msgpack) }, + { MP_ROM_QSTR(MP_QSTR_pack), MP_ROM_PTR(&mod_msgpack_pack_obj) }, + { MP_ROM_QSTR(MP_QSTR_unpack), MP_ROM_PTR(&mod_msgpack_unpack_obj) }, +}; + +STATIC MP_DEFINE_CONST_DICT(msgpack_module_globals, msgpack_module_globals_table); + +const mp_obj_module_t msgpack_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t*)&msgpack_module_globals, +}; diff --git a/shared-bindings/msgpack/__init__.h b/shared-bindings/msgpack/__init__.h new file mode 100644 index 0000000000..4836cc62e7 --- /dev/null +++ b/shared-bindings/msgpack/__init__.h @@ -0,0 +1,34 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 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_MSGPACK___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_MSGPACK___INIT___H + +#include "py/obj.h" + +// Nothing now. + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_MSGPACK___INIT___H From 748472de7a0c2b18d88d868b1037252d57ab1bfb Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Sun, 8 Nov 2020 18:52:33 -0800 Subject: [PATCH 03/82] removed empty line at end of py/circuitpy_mpconfig.mk --- py/circuitpy_mpconfig.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 38ca795849..4b6f4eb966 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -299,4 +299,3 @@ CFLAGS += -DCIRCUITPY_ENABLE_MPY_NATIVE=$(CIRCUITPY_ENABLE_MPY_NATIVE) CIRCUITPY_MSGPACK ?= 0 CFLAGS += -DCIRCUITPY_MSGPACK=$(CIRCUITPY_MSGPACK) - From 513253bc3f22e5afa67155f7b4ca29a770929a3e Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Mon, 9 Nov 2020 18:09:56 -0800 Subject: [PATCH 04/82] moved logic to shared-module and added documentation --- ports/nrf/mpconfigport.mk | 2 - py/circuitpy_defns.mk | 1 + py/circuitpy_mpconfig.h | 2 +- py/circuitpy_mpconfig.mk | 2 +- shared-bindings/msgpack/__init__.c | 367 +++------------------------- shared-module/msgpack/__init__.c | 372 +++++++++++++++++++++++++++++ shared-module/msgpack/__init__.h | 34 +++ 7 files changed, 437 insertions(+), 343 deletions(-) create mode 100644 shared-module/msgpack/__init__.c create mode 100644 shared-module/msgpack/__init__.h diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index 2ee182b7d5..9560064fbc 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -52,8 +52,6 @@ MCU_SUB_VARIANT = nrf52840 # Fits on nrf52840 but space is tight on nrf52833. CIRCUITPY_AESIO ?= 1 -CIRCUITPY_MSGPACK ?= 1 - SD ?= s140 SOFTDEV_VERSION ?= 6.1.0 diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 144168c79e..8c452c2b03 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -465,6 +465,7 @@ SRC_SHARED_MODULE_ALL = \ memorymonitor/AllocationAlarm.c \ memorymonitor/AllocationSize.c \ network/__init__.c \ + msgpack/__init__.c \ os/__init__.c \ random/__init__.c \ rgbmatrix/RGBMatrix.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 3c4e5c2909..64fedd506c 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -815,6 +815,7 @@ extern const struct _mp_obj_module_t msgpack_module; _EVE_MODULE \ MEMORYMONITOR_MODULE \ MICROCONTROLLER_MODULE \ + MSGPACK_MODULE \ NEOPIXEL_WRITE_MODULE \ NETWORK_MODULE \ SOCKET_MODULE \ @@ -846,7 +847,6 @@ extern const struct _mp_obj_module_t msgpack_module; USTACK_MODULE \ WATCHDOG_MODULE \ WIFI_MODULE \ - MSGPACK_MODULE \ // If weak links are enabled, just include strong links in the main list of modules, // and also include the underscore alternate names. diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 4b6f4eb966..348a22cd4b 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -297,5 +297,5 @@ CFLAGS += -DCIRCUITPY_WIFI=$(CIRCUITPY_WIFI) CIRCUITPY_ENABLE_MPY_NATIVE ?= 0 CFLAGS += -DCIRCUITPY_ENABLE_MPY_NATIVE=$(CIRCUITPY_ENABLE_MPY_NATIVE) -CIRCUITPY_MSGPACK ?= 0 +CIRCUITPY_MSGPACK ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_MSGPACK=$(CIRCUITPY_MSGPACK) diff --git a/shared-bindings/msgpack/__init__.c b/shared-bindings/msgpack/__init__.c index 74ab644702..6329c50269 100644 --- a/shared-bindings/msgpack/__init__.c +++ b/shared-bindings/msgpack/__init__.c @@ -24,359 +24,48 @@ * THE SOFTWARE. */ -#include +#include "shared-bindings/msgpack/__init__.h" +#include "shared-module/msgpack/__init__.h" -#include "py/binary.h" -#include "py/objarray.h" -#include "py/objlist.h" -#include "py/objstringio.h" -#include "py/parsenum.h" -#include "py/runtime.h" -#include "py/stream.h" +//| """Pack object in msgpack format +//| +//| The msgpack format is similar to json, except that the encoded data is binary. +//| See https://msgpack.org for details. +//| +//| Example: +//| import msgpack +//| from io import StringIO +//| +//| s = StringIO() +//| msgpack.pack({'list': [True, False, None, 1, 'abc'], 'str': 'blah'}, s) +//| s.seek(0) +//| print(msgpack.unpack(s))""" +//| -#include "supervisor/shared/translate.h" +//| def pack(obj, stream): +//| """Pack obj to stream.""" +//| ... +//| -//////////////////////////////////////////////////////////////// -// stream management - -typedef struct _msgpack_stream_t { - mp_obj_t stream_obj; - mp_uint_t (*read)(mp_obj_t obj, void *buf, mp_uint_t size, int *errcode); - mp_uint_t (*write)(mp_obj_t obj, const void *buf, mp_uint_t size, int *errcode); - int errcode; -} msgpack_stream_t; - -STATIC msgpack_stream_t get_stream(mp_obj_t stream_obj, int flags) { - const mp_stream_p_t *stream_p = mp_get_stream_raise(stream_obj, flags); - msgpack_stream_t s = {stream_obj, stream_p->read, stream_p->write, 0}; - return s; -} - -//////////////////////////////////////////////////////////////// -// readers - -STATIC void read(msgpack_stream_t *s, void *buf, mp_uint_t size) { - if (size == 0) return; - mp_uint_t ret = s->read(s->stream_obj, buf, size, &s->errcode); - if (s->errcode != 0) { - mp_raise_OSError(s->errcode); - } - if (ret == 0) { - mp_raise_msg(&mp_type_EOFError, NULL); - } -} - -STATIC uint32_t read_bytes(msgpack_stream_t *s, mp_uint_t n_bytes) { - uint32_t res = 0; - read(s, &res, n_bytes); - return res; -} - -size_t read_size(msgpack_stream_t *s, uint8_t len_index) { - size_t n_bytes = 4; - switch (len_index) { - case 0: n_bytes = 1; break; - case 1: n_bytes = 2; break; - case 2: n_bytes = 4; break; - } - size_t res = 0; - read(s, &res, n_bytes); - return res; -} - -//////////////////////////////////////////////////////////////// -// writers - -STATIC void write(msgpack_stream_t *s, const void *buf, mp_uint_t size) { - mp_uint_t ret = s->write(s->stream_obj, buf, size, &s->errcode); - if (s->errcode != 0) { - mp_raise_OSError(s->errcode); - } - if (ret == 0) { - mp_raise_msg(&mp_type_EOFError, NULL); - } -} - -STATIC void write_bytes(msgpack_stream_t *s, mp_uint_t n_bytes, uint32_t obj) { - write(s, &obj, n_bytes); -} - -void write_size(msgpack_stream_t *s, uint8_t code, size_t size) { - if ((uint8_t)size == size) { - write_bytes(s, 1, code); - write_bytes(s, 1, size); - } else if ((uint16_t)size == size) { - write_bytes(s, 1, code+1); - write_bytes(s, 2, size); - } else { - write_bytes(s, 1, code+2); - write_bytes(s, 4, size); - } -} - -//////////////////////////////////////////////////////////////// -// packers - -// This is a helper function to iterate through a dictionary. The state of -// the iteration is held in *cur and should be initialised with zero for the -// first call. Will return NULL when no more elements are available. -STATIC mp_map_elem_t *dict_iter_next(mp_obj_dict_t *dict, size_t *cur) { - size_t max = dict->map.alloc; - mp_map_t *map = &dict->map; - - for (size_t i = *cur; i < max; i++) { - if (MP_MAP_SLOT_IS_FILLED(map, i)) { - *cur = i + 1; - return &(map->table[i]); - } - } - - return NULL; -} - - -STATIC void pack_int(msgpack_stream_t *s, int32_t x) { - if (x > -32 && x < 128) { - write_bytes(s, 1, x); - } else if ((int8_t)x == x) { - write_bytes(s, 1, 0xd0); - write_bytes(s, 1, x); - } else if ((int16_t)x == x) { - write_bytes(s, 1, 0xd1); - write_bytes(s, 2, x); - } else { - write_bytes(s, 1, 0xd2); - write_bytes(s, 4, x); - } -} - -void pack_bin(msgpack_stream_t *s, const uint8_t* data, size_t len) { - write_size(s, 0xc4, len); - for (size_t i=0; ilen); - for (size_t i=0; ilen; i++) { - _pack(self->items[i], s); - } - } else if (MP_OBJ_IS_TYPE(obj, &mp_type_list)) { - // list (layout differs from tuple) - mp_obj_list_t *self = MP_OBJ_TO_PTR(obj); - pack_array(s, self->len); - for (size_t i=0; ilen; i++) { - _pack(self->items[i], s); - } - } else if (MP_OBJ_IS_TYPE(obj, &mp_type_dict)) { - // dict - mp_obj_dict_t *self = MP_OBJ_TO_PTR(obj); - pack_dict(s, self->map.used); - size_t cur = 0; - mp_map_elem_t *next = NULL; - while ((next = dict_iter_next(self, &cur)) != NULL) { - _pack(next->key, s); - _pack(next->value, s); - } - } else if (mp_obj_is_float(obj)) { - mp_float_t f = mp_obj_float_get(obj); - write_bytes(s, 1, 0xca); - write(s, &f, 4); - } else if (obj == mp_const_none) { - write_bytes(s, 1, 0xc0); - } else if (obj == mp_const_false) { - write_bytes(s, 1, 0xc2); - } else if (obj == mp_const_true) { - write_bytes(s, 1, 0xc3); - } else { - mp_raise_ValueError(translate("no packer")); - } -} - -// Write obj to stream in msgpack format STATIC mp_obj_t mod_msgpack_pack(mp_obj_t obj, mp_obj_t stream_obj) { - msgpack_stream_t s = get_stream(stream_obj, MP_STREAM_OP_WRITE); - _pack(obj, &s); + common_hal_msgpack_pack(obj, stream_obj); return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_msgpack_pack_obj, mod_msgpack_pack); -//////////////////////////////////////////////////////////////// -// un-packers -STATIC mp_obj_t _unpack(msgpack_stream_t *s) { - uint8_t code = read_bytes(s, 1); - if (((code & 0b10000000) == 0) || ((code & 0b11100000) == 0b11100000)) { - // int - return MP_OBJ_NEW_SMALL_INT((int8_t)code); - } - if ((code & 0b11100000) == 0b10100000) { - // str - size_t len = code & 0b11111; - // allocate on stack; len < 32 - char str[len]; - read(s, &str, len); - return mp_obj_new_str(str, len); - } - if ((code & 0b11110000) == 0b10010000) { - // array (tuple) - size_t len = code & 0b1111; - mp_obj_tuple_t *t = MP_OBJ_TO_PTR(mp_obj_new_tuple(len, NULL)); - for (size_t i=0; iitems[i] = _unpack(s); - } - return MP_OBJ_FROM_PTR(t); - } - if ((code & 0b11110000) == 0b10000000) { - // map (dict) - size_t len = code & 0b1111; - mp_obj_dict_t *d = MP_OBJ_TO_PTR(mp_obj_new_dict(len)); - for (size_t i=0; iitems[i] = _unpack(s); - } - return MP_OBJ_FROM_PTR(t); - } - case 0xc1: // never used - case 0xc7: // ext 8 - case 0xc8: // ext 16 - case 0xc9: // ext 32 - case 0xcb: // float 64 - case 0xcc: // uint 8 - case 0xcd: // uint 16 - case 0xce: // uint 32 - case 0xcf: // uint 64 - case 0xd3: // int 64 - case 0xd4: // fixenxt 1 - case 0xd5: // fixenxt 2 - case 0xd6: // fixenxt 4 - case 0xd7: // fixenxt 8 - case 0xd8: // fixenxt 16 - default: - mp_raise_ValueError(translate("no unpacker found")); - } -} +//| def pack(obj, stream) -> obj: +//| """Unpack and return one object (in msgpack format) from stream. +//| Call repeatedly to read multiple objects from the stream.""" +//| ... +//| -// Read msgpack encoded object from stream STATIC mp_obj_t mod_msgpack_unpack(mp_obj_t stream_obj) { - msgpack_stream_t s = get_stream(stream_obj, MP_STREAM_OP_READ); - return _unpack(&s); + return common_hal_msgpack_unpack(stream_obj); } STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_msgpack_unpack_obj, mod_msgpack_unpack); + STATIC const mp_rom_map_elem_t msgpack_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_msgpack) }, { MP_ROM_QSTR(MP_QSTR_pack), MP_ROM_PTR(&mod_msgpack_pack_obj) }, diff --git a/shared-module/msgpack/__init__.c b/shared-module/msgpack/__init__.c new file mode 100644 index 0000000000..4a969901d1 --- /dev/null +++ b/shared-module/msgpack/__init__.c @@ -0,0 +1,372 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Bernhard Boser + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "py/binary.h" +#include "py/objarray.h" +#include "py/objlist.h" +#include "py/objstringio.h" +#include "py/parsenum.h" +#include "py/runtime.h" +#include "py/stream.h" + +#include "supervisor/shared/translate.h" + +//////////////////////////////////////////////////////////////// +// stream management + +typedef struct _msgpack_stream_t { + mp_obj_t stream_obj; + mp_uint_t (*read)(mp_obj_t obj, void *buf, mp_uint_t size, int *errcode); + mp_uint_t (*write)(mp_obj_t obj, const void *buf, mp_uint_t size, int *errcode); + int errcode; +} msgpack_stream_t; + +STATIC msgpack_stream_t get_stream(mp_obj_t stream_obj, int flags) { + const mp_stream_p_t *stream_p = mp_get_stream_raise(stream_obj, flags); + msgpack_stream_t s = {stream_obj, stream_p->read, stream_p->write, 0}; + return s; +} + +//////////////////////////////////////////////////////////////// +// readers + +STATIC void read(msgpack_stream_t *s, void *buf, mp_uint_t size) { + if (size == 0) return; + mp_uint_t ret = s->read(s->stream_obj, buf, size, &s->errcode); + if (s->errcode != 0) { + mp_raise_OSError(s->errcode); + } + if (ret == 0) { + mp_raise_msg(&mp_type_EOFError, NULL); + } +} + +STATIC uint32_t read_bytes(msgpack_stream_t *s, mp_uint_t n_bytes) { + uint32_t res = 0; + read(s, &res, n_bytes); + return res; +} + +size_t read_size(msgpack_stream_t *s, uint8_t len_index) { + size_t n_bytes = 4; + switch (len_index) { + case 0: n_bytes = 1; break; + case 1: n_bytes = 2; break; + case 2: n_bytes = 4; break; + } + size_t res = 0; + read(s, &res, n_bytes); + return res; +} + +//////////////////////////////////////////////////////////////// +// writers + +STATIC void write(msgpack_stream_t *s, const void *buf, mp_uint_t size) { + mp_uint_t ret = s->write(s->stream_obj, buf, size, &s->errcode); + if (s->errcode != 0) { + mp_raise_OSError(s->errcode); + } + if (ret == 0) { + mp_raise_msg(&mp_type_EOFError, NULL); + } +} + +STATIC void write_bytes(msgpack_stream_t *s, mp_uint_t n_bytes, uint32_t obj) { + write(s, &obj, n_bytes); +} + +void write_size(msgpack_stream_t *s, uint8_t code, size_t size) { + if ((uint8_t)size == size) { + write_bytes(s, 1, code); + write_bytes(s, 1, size); + } else if ((uint16_t)size == size) { + write_bytes(s, 1, code+1); + write_bytes(s, 2, size); + } else { + write_bytes(s, 1, code+2); + write_bytes(s, 4, size); + } +} + +//////////////////////////////////////////////////////////////// +// packers + +// This is a helper function to iterate through a dictionary. The state of +// the iteration is held in *cur and should be initialised with zero for the +// first call. Will return NULL when no more elements are available. +STATIC mp_map_elem_t *dict_iter_next(mp_obj_dict_t *dict, size_t *cur) { + size_t max = dict->map.alloc; + mp_map_t *map = &dict->map; + + for (size_t i = *cur; i < max; i++) { + if (MP_MAP_SLOT_IS_FILLED(map, i)) { + *cur = i + 1; + return &(map->table[i]); + } + } + + return NULL; +} + +STATIC void pack_int(msgpack_stream_t *s, int32_t x) { + if (x > -32 && x < 128) { + write_bytes(s, 1, x); + } else if ((int8_t)x == x) { + write_bytes(s, 1, 0xd0); + write_bytes(s, 1, x); + } else if ((int16_t)x == x) { + write_bytes(s, 1, 0xd1); + write_bytes(s, 2, x); + } else { + write_bytes(s, 1, 0xd2); + write_bytes(s, 4, x); + } +} + +void pack_bin(msgpack_stream_t *s, const uint8_t* data, size_t len) { + write_size(s, 0xc4, len); + for (size_t i=0; ilen); + for (size_t i=0; ilen; i++) { + pack(self->items[i], s); + } + } else if (MP_OBJ_IS_TYPE(obj, &mp_type_list)) { + // list (layout differs from tuple) + mp_obj_list_t *self = MP_OBJ_TO_PTR(obj); + pack_array(s, self->len); + for (size_t i=0; ilen; i++) { + pack(self->items[i], s); + } + } else if (MP_OBJ_IS_TYPE(obj, &mp_type_dict)) { + // dict + mp_obj_dict_t *self = MP_OBJ_TO_PTR(obj); + pack_dict(s, self->map.used); + size_t cur = 0; + mp_map_elem_t *next = NULL; + while ((next = dict_iter_next(self, &cur)) != NULL) { + pack(next->key, s); + pack(next->value, s); + } + } else if (mp_obj_is_float(obj)) { + mp_float_t f = mp_obj_float_get(obj); + write_bytes(s, 1, 0xca); + write(s, &f, 4); + } else if (obj == mp_const_none) { + write_bytes(s, 1, 0xc0); + } else if (obj == mp_const_false) { + write_bytes(s, 1, 0xc2); + } else if (obj == mp_const_true) { + write_bytes(s, 1, 0xc3); + } else { + mp_raise_ValueError(translate("no packer")); + } +} + +//////////////////////////////////////////////////////////////// +// unpacker + +mp_obj_t unpack(msgpack_stream_t *s) { + uint8_t code = read_bytes(s, 1); + if (((code & 0b10000000) == 0) || ((code & 0b11100000) == 0b11100000)) { + // int + return MP_OBJ_NEW_SMALL_INT((int8_t)code); + } + if ((code & 0b11100000) == 0b10100000) { + // str + size_t len = code & 0b11111; + // allocate on stack; len < 32 + char str[len]; + read(s, &str, len); + return mp_obj_new_str(str, len); + } + if ((code & 0b11110000) == 0b10010000) { + // array (tuple) + size_t len = code & 0b1111; + mp_obj_tuple_t *t = MP_OBJ_TO_PTR(mp_obj_new_tuple(len, NULL)); + for (size_t i=0; iitems[i] = unpack(s); + } + return MP_OBJ_FROM_PTR(t); + } + if ((code & 0b11110000) == 0b10000000) { + // map (dict) + size_t len = code & 0b1111; + mp_obj_dict_t *d = MP_OBJ_TO_PTR(mp_obj_new_dict(len)); + for (size_t i=0; iitems[i] = unpack(s); + } + return MP_OBJ_FROM_PTR(t); + } + case 0xc1: // never used + case 0xc7: // ext 8 + case 0xc8: // ext 16 + case 0xc9: // ext 32 + case 0xcb: // float 64 + case 0xcc: // uint 8 + case 0xcd: // uint 16 + case 0xce: // uint 32 + case 0xcf: // uint 64 + case 0xd3: // int 64 + case 0xd4: // fixenxt 1 + case 0xd5: // fixenxt 2 + case 0xd6: // fixenxt 4 + case 0xd7: // fixenxt 8 + case 0xd8: // fixenxt 16 + default: + mp_raise_ValueError(translate("no unpacker found")); + } +} + +void common_hal_msgpack_pack(mp_obj_t obj, mp_obj_t stream_obj) { + msgpack_stream_t stream = get_stream(stream_obj, MP_STREAM_OP_WRITE); + pack(obj, &stream); +} + +mp_obj_t common_hal_msgpack_unpack(mp_obj_t stream_obj) { + msgpack_stream_t stream = get_stream(stream_obj, MP_STREAM_OP_WRITE); + return unpack(&stream); +} + diff --git a/shared-module/msgpack/__init__.h b/shared-module/msgpack/__init__.h new file mode 100644 index 0000000000..0a5e7852ad --- /dev/null +++ b/shared-module/msgpack/__init__.h @@ -0,0 +1,34 @@ +/* + * 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. + */ +#ifndef MICROPY_INCLUDED_SHARED_MODULE_MSGPACK___INIT___H +#define MICROPY_INCLUDED_SHARED_MODULE_MSGPACK___INIT___H + +#include "py/stream.h" + +void common_hal_msgpack_pack(mp_obj_t obj, mp_obj_t stream_obj); +mp_obj_t common_hal_msgpack_unpack(mp_obj_t stream_obj); + +#endif From e19782633a88ac5b076119d506ddef1d35728e4d Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Mon, 9 Nov 2020 18:12:55 -0800 Subject: [PATCH 05/82] removed blanks to make pre-commit check happy --- shared-bindings/msgpack/__init__.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/msgpack/__init__.c b/shared-bindings/msgpack/__init__.c index 6329c50269..b53fb93998 100644 --- a/shared-bindings/msgpack/__init__.c +++ b/shared-bindings/msgpack/__init__.c @@ -35,12 +35,12 @@ //| Example: //| import msgpack //| from io import StringIO -//| +//| //| s = StringIO() //| msgpack.pack({'list': [True, False, None, 1, 'abc'], 'str': 'blah'}, s) //| s.seek(0) //| print(msgpack.unpack(s))""" -//| +//| //| def pack(obj, stream): //| """Pack obj to stream.""" From 912691e0d28ecbef563610dc328f6b08c61b31b0 Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Mon, 9 Nov 2020 18:16:22 -0800 Subject: [PATCH 06/82] removed blanks line at end of file --- shared-module/msgpack/__init__.c | 1 - 1 file changed, 1 deletion(-) diff --git a/shared-module/msgpack/__init__.c b/shared-module/msgpack/__init__.c index 4a969901d1..437469978b 100644 --- a/shared-module/msgpack/__init__.c +++ b/shared-module/msgpack/__init__.c @@ -369,4 +369,3 @@ mp_obj_t common_hal_msgpack_unpack(mp_obj_t stream_obj) { msgpack_stream_t stream = get_stream(stream_obj, MP_STREAM_OP_WRITE); return unpack(&stream); } - From f38bd59c6bbf3cb2f5e4417c676a12444e39f11b Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Mon, 9 Nov 2020 18:29:31 -0800 Subject: [PATCH 07/82] added signatures to documenation --- shared-bindings/msgpack/__init__.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/msgpack/__init__.c b/shared-bindings/msgpack/__init__.c index b53fb93998..720d88109a 100644 --- a/shared-bindings/msgpack/__init__.c +++ b/shared-bindings/msgpack/__init__.c @@ -42,7 +42,7 @@ //| print(msgpack.unpack(s))""" //| -//| def pack(obj, stream): +//| def pack(obj: Any, buffer: WriteableBuffer) -> None: //| """Pack obj to stream.""" //| ... //| @@ -54,7 +54,7 @@ STATIC mp_obj_t mod_msgpack_pack(mp_obj_t obj, mp_obj_t stream_obj) { STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_msgpack_pack_obj, mod_msgpack_pack); -//| def pack(obj, stream) -> obj: +//| def unpack(buffer: ReadableBuffer) -> Any: //| """Unpack and return one object (in msgpack format) from stream. //| Call repeatedly to read multiple objects from the stream.""" //| ... From f91932d78374bec0fe6225f53a487919a956b76f Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Wed, 11 Nov 2020 16:37:15 -0800 Subject: [PATCH 08/82] make translate --- locale/circuitpython.pot | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 274d92168a..51feb16c35 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-24 15:40-0500\n" +"POT-Creation-Date: 2020-12-01 18:38-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3050,6 +3050,10 @@ msgstr "" msgid "no module named '%q'" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "no packer" +msgstr "" + #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c #: shared-bindings/displayio/ParallelBus.c msgid "no reset pin available" @@ -3063,6 +3067,10 @@ msgstr "" msgid "no such attribute" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "no unpacker found" +msgstr "" + #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" msgstr "" From 44bc75af37a464eb6e5ba26bab19f2150d58044d Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Thu, 12 Nov 2020 12:28:40 -0800 Subject: [PATCH 09/82] output little endian; update example --- shared-bindings/msgpack/__init__.c | 10 +- shared-module/msgpack/__init__.c | 147 ++++++++++++++++++++--------- 2 files changed, 106 insertions(+), 51 deletions(-) diff --git a/shared-bindings/msgpack/__init__.c b/shared-bindings/msgpack/__init__.c index 720d88109a..a222177f74 100644 --- a/shared-bindings/msgpack/__init__.c +++ b/shared-bindings/msgpack/__init__.c @@ -34,12 +34,12 @@ //| //| Example: //| import msgpack -//| from io import StringIO +//| from io import BytesIO //| -//| s = StringIO() -//| msgpack.pack({'list': [True, False, None, 1, 'abc'], 'str': 'blah'}, s) -//| s.seek(0) -//| print(msgpack.unpack(s))""" +//| b = BytesIO() +//| msgpack.pack({'list': [True, False, None, 1, 'abc'], 'str': 'blah'}, b) +//| b.seek(0) +//| print(msgpack.unpack(b))""" //| //| def pack(obj: Any, buffer: WriteableBuffer) -> None: diff --git a/shared-module/msgpack/__init__.c b/shared-module/msgpack/__init__.c index 437469978b..505c1c9697 100644 --- a/shared-module/msgpack/__init__.c +++ b/shared-module/msgpack/__init__.c @@ -25,6 +25,7 @@ */ #include +#include #include "py/binary.h" #include "py/objarray.h" @@ -66,13 +67,37 @@ STATIC void read(msgpack_stream_t *s, void *buf, mp_uint_t size) { } } +/* STATIC uint32_t read_bytes(msgpack_stream_t *s, mp_uint_t n_bytes) { uint32_t res = 0; read(s, &res, n_bytes); return res; } +*/ +STATIC uint8_t read1(msgpack_stream_t *s) { + uint8_t res = 0; + read(s, &res, 1); + return res; +} -size_t read_size(msgpack_stream_t *s, uint8_t len_index) { +STATIC uint16_t read2(msgpack_stream_t *s) { + uint16_t res = 0; + read(s, &res, 2); + int n = 1; + if (*(char *)&n == 1) res = __builtin_bswap16(res); + return res; +} + +STATIC uint32_t read4(msgpack_stream_t *s) { + uint32_t res = 0; + read(s, &res, 4); + int n = 1; + if (*(char *)&n == 1) res = __builtin_bswap32(res); + return res; +} + +/* +STATIC size_t read_size(msgpack_stream_t *s, uint8_t len_index) { size_t n_bytes = 4; switch (len_index) { case 0: n_bytes = 1; break; @@ -83,6 +108,17 @@ size_t read_size(msgpack_stream_t *s, uint8_t len_index) { read(s, &res, n_bytes); return res; } +*/ + +STATIC size_t read_size(msgpack_stream_t *s, uint8_t len_index) { + size_t res; + switch (len_index) { + case 0: res = (size_t)read1(s); break; + case 1: res = (size_t)read2(s); break; + case 2: res = (size_t)read4(s); break; + } + return res; +} //////////////////////////////////////////////////////////////// // writers @@ -97,20 +133,33 @@ STATIC void write(msgpack_stream_t *s, const void *buf, mp_uint_t size) { } } -STATIC void write_bytes(msgpack_stream_t *s, mp_uint_t n_bytes, uint32_t obj) { - write(s, &obj, n_bytes); +STATIC void write1(msgpack_stream_t *s, uint8_t obj) { + write(s, &obj, 1); } -void write_size(msgpack_stream_t *s, uint8_t code, size_t size) { +STATIC void write2(msgpack_stream_t *s, uint16_t obj) { + int n = 1; + if (*(char *)&n == 1) obj = __builtin_bswap16(obj); + write(s, &obj, 2); +} + +STATIC void write4(msgpack_stream_t *s, uint32_t obj) { + int n = 1; + if (*(char *)&n == 1) obj = __builtin_bswap32(obj); + write(s, &obj, 4); +} + +// compute and write msgpack size code (array structures) +STATIC void write_size(msgpack_stream_t *s, uint8_t code, size_t size) { if ((uint8_t)size == size) { - write_bytes(s, 1, code); - write_bytes(s, 1, size); + write1(s, code); + write1(s, size); } else if ((uint16_t)size == size) { - write_bytes(s, 1, code+1); - write_bytes(s, 2, size); + write1(s, code+1); + write2(s, size); } else { - write_bytes(s, 1, code+2); - write_bytes(s, 4, size); + write1(s, code+2); + write4(s, size); } } @@ -136,61 +185,61 @@ STATIC mp_map_elem_t *dict_iter_next(mp_obj_dict_t *dict, size_t *cur) { STATIC void pack_int(msgpack_stream_t *s, int32_t x) { if (x > -32 && x < 128) { - write_bytes(s, 1, x); + write1(s, x); } else if ((int8_t)x == x) { - write_bytes(s, 1, 0xd0); - write_bytes(s, 1, x); + write1(s, 0xd0); + write1(s, x); } else if ((int16_t)x == x) { - write_bytes(s, 1, 0xd1); - write_bytes(s, 2, x); + write1(s, 0xd1); + write2(s, x); } else { - write_bytes(s, 1, 0xd2); - write_bytes(s, 4, x); + write1(s, 0xd2); + write4(s, x); } } void pack_bin(msgpack_stream_t *s, const uint8_t* data, size_t len) { write_size(s, 0xc4, len); for (size_t i=0; ivalue, s); } } else if (mp_obj_is_float(obj)) { - mp_float_t f = mp_obj_float_get(obj); - write_bytes(s, 1, 0xca); - write(s, &f, 4); + union Float { mp_float_t f; uint32_t u; }; + union Float data; + data.f = mp_obj_float_get(obj); + write1(s, 0xca); + write4(s, data.u); } else if (obj == mp_const_none) { - write_bytes(s, 1, 0xc0); + write1(s, 0xc0); } else if (obj == mp_const_false) { - write_bytes(s, 1, 0xc2); + write1(s, 0xc2); } else if (obj == mp_const_true) { - write_bytes(s, 1, 0xc3); + write1(s, 0xc3); } else { mp_raise_ValueError(translate("no packer")); } @@ -252,7 +303,7 @@ void pack(mp_obj_t obj, msgpack_stream_t *s) { // unpacker mp_obj_t unpack(msgpack_stream_t *s) { - uint8_t code = read_bytes(s, 1); + uint8_t code = read1(s); if (((code & 0b10000000) == 0) || ((code & 0b11100000) == 0b11100000)) { // int return MP_OBJ_NEW_SMALL_INT((int8_t)code); @@ -298,17 +349,24 @@ mp_obj_t unpack(msgpack_stream_t *s) { read(s, p, size); return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); } + case 0xcc: + return MP_OBJ_NEW_SMALL_INT(read1(s)); + case 0xcd: + return MP_OBJ_NEW_SMALL_INT(read2(s)); + case 0xce: + return MP_OBJ_NEW_SMALL_INT(read4(s)); case 0xca: { - float f; - read(s, &f, 4); - return mp_obj_new_float(f); + union Float { mp_float_t f; uint32_t u; }; + union Float data; + data.u = read4(s); + return mp_obj_new_float(data.f); } case 0xd0: - return MP_OBJ_NEW_SMALL_INT((int8_t)read_bytes(s, 1)); + return MP_OBJ_NEW_SMALL_INT((int8_t)read1(s)); case 0xd1: - return MP_OBJ_NEW_SMALL_INT((int16_t)read_bytes(s, 2)); + return MP_OBJ_NEW_SMALL_INT((int16_t)read2(s)); case 0xd2: - return MP_OBJ_NEW_SMALL_INT((int32_t)read_bytes(s, 4)); + return MP_OBJ_NEW_SMALL_INT((int32_t)read4(s)); case 0xd9: case 0xda: case 0xdb: { @@ -345,9 +403,6 @@ mp_obj_t unpack(msgpack_stream_t *s) { case 0xc8: // ext 16 case 0xc9: // ext 32 case 0xcb: // float 64 - case 0xcc: // uint 8 - case 0xcd: // uint 16 - case 0xce: // uint 32 case 0xcf: // uint 64 case 0xd3: // int 64 case 0xd4: // fixenxt 1 From b805bf8a6293ff4c6f8550946403e509a0aa9e37 Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Thu, 12 Nov 2020 13:21:59 -0800 Subject: [PATCH 10/82] cleanup --- shared-module/msgpack/__init__.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/shared-module/msgpack/__init__.c b/shared-module/msgpack/__init__.c index 505c1c9697..a825bb0f3b 100644 --- a/shared-module/msgpack/__init__.c +++ b/shared-module/msgpack/__init__.c @@ -67,13 +67,6 @@ STATIC void read(msgpack_stream_t *s, void *buf, mp_uint_t size) { } } -/* -STATIC uint32_t read_bytes(msgpack_stream_t *s, mp_uint_t n_bytes) { - uint32_t res = 0; - read(s, &res, n_bytes); - return res; -} -*/ STATIC uint8_t read1(msgpack_stream_t *s) { uint8_t res = 0; read(s, &res, 1); @@ -96,20 +89,6 @@ STATIC uint32_t read4(msgpack_stream_t *s) { return res; } -/* -STATIC size_t read_size(msgpack_stream_t *s, uint8_t len_index) { - size_t n_bytes = 4; - switch (len_index) { - case 0: n_bytes = 1; break; - case 1: n_bytes = 2; break; - case 2: n_bytes = 4; break; - } - size_t res = 0; - read(s, &res, n_bytes); - return res; -} -*/ - STATIC size_t read_size(msgpack_stream_t *s, uint8_t len_index) { size_t res; switch (len_index) { From a310cde8c10878d83128c1a96b1dc4ecdf4b721a Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Thu, 12 Nov 2020 17:43:40 -0800 Subject: [PATCH 11/82] fixed res may not be initialized in read_size --- shared-module/msgpack/__init__.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shared-module/msgpack/__init__.c b/shared-module/msgpack/__init__.c index a825bb0f3b..3508755e0f 100644 --- a/shared-module/msgpack/__init__.c +++ b/shared-module/msgpack/__init__.c @@ -90,11 +90,12 @@ STATIC uint32_t read4(msgpack_stream_t *s) { } STATIC size_t read_size(msgpack_stream_t *s, uint8_t len_index) { - size_t res; + size_t res = 0; switch (len_index) { case 0: res = (size_t)read1(s); break; case 1: res = (size_t)read2(s); break; case 2: res = (size_t)read4(s); break; + default: mp_raise_ValueError(translate("too big")); } return res; } From 4b710796289756cb43275f19bafa9ff806e1011e Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Fri, 13 Nov 2020 17:00:32 -0800 Subject: [PATCH 12/82] update translations --- locale/circuitpython.pot | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 51feb16c35..163d59428a 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-01 18:38-0800\n" +"POT-Creation-Date: 2020-12-01 18:39-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3528,6 +3528,10 @@ msgstr "" msgid "tobytes can be invoked for dense arrays only" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "too big" +msgstr "" + #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" msgstr "" From 59c3e25168fde52939948f5c1ffce13557bf4f4b Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Tue, 17 Nov 2020 11:56:36 -0800 Subject: [PATCH 13/82] disable on boards tight on memory. add stddef.h to imports (not actually needed). --- ports/atmel-samd/boards/bdmicro_vina_d21/mpconfigboard.mk | 1 + .../boards/circuitplayground_express/mpconfigboard.mk | 1 + .../boards/circuitplayground_express_crickit/mpconfigboard.mk | 1 + .../boards/circuitplayground_express_displayio/mpconfigboard.mk | 1 + ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk | 1 + .../boards/feather_m0_express_crickit/mpconfigboard.mk | 1 + ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk | 1 + ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk | 1 + ports/atmel-samd/boards/snekboard/mpconfigboard.mk | 1 + .../atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk | 1 + ports/cxd56/boards/spresense/mpconfigboard.mk | 2 ++ shared-module/msgpack/__init__.c | 1 + 12 files changed, 13 insertions(+) diff --git a/ports/atmel-samd/boards/bdmicro_vina_d21/mpconfigboard.mk b/ports/atmel-samd/boards/bdmicro_vina_d21/mpconfigboard.mk index a9885d064b..4e2314b8d5 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_d21/mpconfigboard.mk +++ b/ports/atmel-samd/boards/bdmicro_vina_d21/mpconfigboard.mk @@ -14,6 +14,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_MSGPACK = 0 CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk index 13ec9e861c..505f5c145d 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk @@ -15,6 +15,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_MSGPACK = 0 MICROPY_PY_ASYNC_AWAIT = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk index 7aa45eb39e..c3be33134c 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk @@ -16,6 +16,7 @@ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_MSGPACK = 0 CIRCUITPY_PIXELBUF = 1 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk index 3a43093a98..51e9b05af2 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk @@ -16,6 +16,7 @@ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_MSGPACK = 0 CIRCUITPY_PIXELBUF = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 diff --git a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk index dc02e1f60d..73ce47199b 100644 --- a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk @@ -15,6 +15,7 @@ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_MSGPACK = 0 CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 diff --git a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk index 5624144e88..f06163b84a 100644 --- a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk @@ -18,6 +18,7 @@ CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_GAMEPAD = 0 CFLAGS_INLINE_LIMIT = 50 +CIRCUITPY_MSGPACK = 0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice diff --git a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk index 6f7f2d8b67..0f1972abc3 100644 --- a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk @@ -15,6 +15,7 @@ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_MSGPACK = 0 # supersized, not ultra-supersized CIRCUITPY_VECTORIO = 0 diff --git a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk index 7dd9650003..0e9361a443 100644 --- a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk @@ -14,6 +14,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_MSGPACK = 0 CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 diff --git a/ports/atmel-samd/boards/snekboard/mpconfigboard.mk b/ports/atmel-samd/boards/snekboard/mpconfigboard.mk index e0262b6b22..d7540fe64d 100644 --- a/ports/atmel-samd/boards/snekboard/mpconfigboard.mk +++ b/ports/atmel-samd/boards/snekboard/mpconfigboard.mk @@ -14,6 +14,7 @@ LONGINT_IMPL = MPZ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_GAMEPAD = 0 CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_MSGPACK = 0 CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 diff --git a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk index 5170f8a233..ddf7246dfb 100755 --- a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk @@ -15,6 +15,7 @@ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_GAMEPAD = 0 CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_MSGPACK = 0 CIRCUITPY_VECTORIO = 0 CFLAGS_INLINE_LIMIT = 60 diff --git a/ports/cxd56/boards/spresense/mpconfigboard.mk b/ports/cxd56/boards/spresense/mpconfigboard.mk index 7b8ac6ff63..80c6e4b692 100644 --- a/ports/cxd56/boards/spresense/mpconfigboard.mk +++ b/ports/cxd56/boards/spresense/mpconfigboard.mk @@ -4,3 +4,5 @@ USB_PRODUCT = "Spresense" USB_MANUFACTURER = "Sony" INTERNAL_FLASH_FILESYSTEM = 1 + +CIRCUITPY_MSGPACK = 0 diff --git a/shared-module/msgpack/__init__.c b/shared-module/msgpack/__init__.c index 3508755e0f..e550b01af9 100644 --- a/shared-module/msgpack/__init__.c +++ b/shared-module/msgpack/__init__.c @@ -24,6 +24,7 @@ * THE SOFTWARE. */ +#include #include #include From 582a47d71a5d047abc7ee9a17b0940d1a1ed4b31 Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Tue, 17 Nov 2020 16:26:09 -0800 Subject: [PATCH 14/82] rename read, write to read_bytes, write_bytes --- ports/cxd56/boards/spresense/mpconfigboard.mk | 2 -- shared-module/msgpack/__init__.c | 23 +++++++++---------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/ports/cxd56/boards/spresense/mpconfigboard.mk b/ports/cxd56/boards/spresense/mpconfigboard.mk index 80c6e4b692..7b8ac6ff63 100644 --- a/ports/cxd56/boards/spresense/mpconfigboard.mk +++ b/ports/cxd56/boards/spresense/mpconfigboard.mk @@ -4,5 +4,3 @@ USB_PRODUCT = "Spresense" USB_MANUFACTURER = "Sony" INTERNAL_FLASH_FILESYSTEM = 1 - -CIRCUITPY_MSGPACK = 0 diff --git a/shared-module/msgpack/__init__.c b/shared-module/msgpack/__init__.c index e550b01af9..5bc7d1f615 100644 --- a/shared-module/msgpack/__init__.c +++ b/shared-module/msgpack/__init__.c @@ -24,7 +24,6 @@ * THE SOFTWARE. */ -#include #include #include @@ -57,7 +56,7 @@ STATIC msgpack_stream_t get_stream(mp_obj_t stream_obj, int flags) { //////////////////////////////////////////////////////////////// // readers -STATIC void read(msgpack_stream_t *s, void *buf, mp_uint_t size) { +STATIC void read_bytes(msgpack_stream_t *s, void *buf, mp_uint_t size) { if (size == 0) return; mp_uint_t ret = s->read(s->stream_obj, buf, size, &s->errcode); if (s->errcode != 0) { @@ -70,13 +69,13 @@ STATIC void read(msgpack_stream_t *s, void *buf, mp_uint_t size) { STATIC uint8_t read1(msgpack_stream_t *s) { uint8_t res = 0; - read(s, &res, 1); + read_bytes(s, &res, 1); return res; } STATIC uint16_t read2(msgpack_stream_t *s) { uint16_t res = 0; - read(s, &res, 2); + read_bytes(s, &res, 2); int n = 1; if (*(char *)&n == 1) res = __builtin_bswap16(res); return res; @@ -84,7 +83,7 @@ STATIC uint16_t read2(msgpack_stream_t *s) { STATIC uint32_t read4(msgpack_stream_t *s) { uint32_t res = 0; - read(s, &res, 4); + read_bytes(s, &res, 4); int n = 1; if (*(char *)&n == 1) res = __builtin_bswap32(res); return res; @@ -104,7 +103,7 @@ STATIC size_t read_size(msgpack_stream_t *s, uint8_t len_index) { //////////////////////////////////////////////////////////////// // writers -STATIC void write(msgpack_stream_t *s, const void *buf, mp_uint_t size) { +STATIC void write_bytes(msgpack_stream_t *s, const void *buf, mp_uint_t size) { mp_uint_t ret = s->write(s->stream_obj, buf, size, &s->errcode); if (s->errcode != 0) { mp_raise_OSError(s->errcode); @@ -115,19 +114,19 @@ STATIC void write(msgpack_stream_t *s, const void *buf, mp_uint_t size) { } STATIC void write1(msgpack_stream_t *s, uint8_t obj) { - write(s, &obj, 1); + write_bytes(s, &obj, 1); } STATIC void write2(msgpack_stream_t *s, uint16_t obj) { int n = 1; if (*(char *)&n == 1) obj = __builtin_bswap16(obj); - write(s, &obj, 2); + write_bytes(s, &obj, 2); } STATIC void write4(msgpack_stream_t *s, uint32_t obj) { int n = 1; if (*(char *)&n == 1) obj = __builtin_bswap32(obj); - write(s, &obj, 4); + write_bytes(s, &obj, 4); } // compute and write msgpack size code (array structures) @@ -294,7 +293,7 @@ mp_obj_t unpack(msgpack_stream_t *s) { size_t len = code & 0b11111; // allocate on stack; len < 32 char str[len]; - read(s, &str, len); + read_bytes(s, &str, len); return mp_obj_new_str(str, len); } if ((code & 0b11110000) == 0b10010000) { @@ -327,7 +326,7 @@ mp_obj_t unpack(msgpack_stream_t *s) { vstr_t vstr; vstr_init_len(&vstr, size); byte *p = (byte*)vstr.buf; - read(s, p, size); + read_bytes(s, p, size); return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); } case 0xcc: @@ -356,7 +355,7 @@ mp_obj_t unpack(msgpack_stream_t *s) { vstr_t vstr; vstr_init_len(&vstr, size); byte *p = (byte*)vstr.buf; - read(s, p, size); + read_bytes(s, p, size); return mp_obj_new_str_from_vstr(&mp_type_str, &vstr); } case 0xde: From 87d4184dd5e143494b77daa8d43bbc997f727095 Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Wed, 18 Nov 2020 08:38:48 -0800 Subject: [PATCH 15/82] exclude spresense --- ports/cxd56/boards/spresense/mpconfigboard.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/cxd56/boards/spresense/mpconfigboard.mk b/ports/cxd56/boards/spresense/mpconfigboard.mk index 7b8ac6ff63..1e81c4683f 100644 --- a/ports/cxd56/boards/spresense/mpconfigboard.mk +++ b/ports/cxd56/boards/spresense/mpconfigboard.mk @@ -4,3 +4,5 @@ USB_PRODUCT = "Spresense" USB_MANUFACTURER = "Sony" INTERNAL_FLASH_FILESYSTEM = 1 + +CIRCUITPY_MSGPACK = 0 \ No newline at end of file From 546b15bf1abb66174c77eca4d21af71aa55384db Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Wed, 18 Nov 2020 08:53:55 -0800 Subject: [PATCH 16/82] add trailing newline --- ports/cxd56/boards/spresense/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/cxd56/boards/spresense/mpconfigboard.mk b/ports/cxd56/boards/spresense/mpconfigboard.mk index 1e81c4683f..80c6e4b692 100644 --- a/ports/cxd56/boards/spresense/mpconfigboard.mk +++ b/ports/cxd56/boards/spresense/mpconfigboard.mk @@ -5,4 +5,4 @@ USB_MANUFACTURER = "Sony" INTERNAL_FLASH_FILESYSTEM = 1 -CIRCUITPY_MSGPACK = 0 \ No newline at end of file +CIRCUITPY_MSGPACK = 0 From 34bbcc4910014c3b4646d8005baf8244bac51f03 Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Wed, 2 Dec 2020 11:52:29 -0800 Subject: [PATCH 17/82] exclude nrf/simmel due to lack of flash --- ports/nrf/boards/simmel/mpconfigboard.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/nrf/boards/simmel/mpconfigboard.mk b/ports/nrf/boards/simmel/mpconfigboard.mk index e34739c0f3..f702a336fd 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.mk +++ b/ports/nrf/boards/simmel/mpconfigboard.mk @@ -16,6 +16,7 @@ CIRCUITPY_AUDIOMP3 = 0 CIRCUITPY_BUSIO = 1 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 +CIRCUITPY_MSGPACK = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_PIXELBUF = 0 From b5b6b6d0f2fe669e0304521d663b16388c63b15e Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Mon, 7 Dec 2020 15:16:16 -0800 Subject: [PATCH 18/82] add ExtType, update doc, add a test --- locale/circuitpython.pot | 34 +++-- shared-bindings/msgpack/ExtType.c | 127 ++++++++++++++++++ shared-bindings/msgpack/ExtType.h | 40 ++++++ shared-bindings/msgpack/__init__.c | 108 +++++++++++++--- shared-bindings/msgpack/__init__.h | 2 +- shared-module/msgpack/__init__.c | 199 +++++++++++++++++++---------- shared-module/msgpack/__init__.h | 4 +- tests/extmod/umsgpack_pack.py | 30 +++++ tests/extmod/umsgpack_pack.py.ext | 5 + 9 files changed, 447 insertions(+), 102 deletions(-) create mode 100644 shared-bindings/msgpack/ExtType.c create mode 100644 shared-bindings/msgpack/ExtType.h create mode 100644 tests/extmod/umsgpack_pack.py create mode 100644 tests/extmod/umsgpack_pack.py.ext diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index e0b839ed3e..979f62466e 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-01 18:39-0800\n" +"POT-Creation-Date: 2020-12-07 15:35-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -270,6 +270,10 @@ msgstr "" msgid "3-arg pow() not supported" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "64 bit types" +msgstr "" + #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "A hardware interrupt channel is already in use" @@ -2371,6 +2375,10 @@ msgstr "" msgid "circle can only be registered in one parent" msgstr "" +#: shared-bindings/msgpack/ExtType.c +msgid "code outside range 0~127" +msgstr "" + #: shared-bindings/displayio/Palette.c msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)" msgstr "" @@ -2451,6 +2459,10 @@ msgstr "" msgid "default 'except' must be last" msgstr "" +#: shared-bindings/msgpack/__init__.c +msgid "default is not a function" +msgstr "" + #: shared-bindings/audiobusio/PDMIn.c msgid "" "destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" @@ -2550,6 +2562,10 @@ msgstr "" msgid "expecting key:value for dict" msgstr "" +#: shared-bindings/msgpack/__init__.c +msgid "ext_hook is not a function" +msgstr "" + #: py/argcheck.c msgid "extra keyword arguments given" msgstr "" @@ -3078,12 +3094,12 @@ msgstr "" msgid "no binding for nonlocal found" msgstr "" -#: py/builtinimport.c -msgid "no module named '%q'" +#: shared-module/msgpack/__init__.c +msgid "no default packer" msgstr "" -#: shared-module/msgpack/__init__.c -msgid "no packer" +#: py/builtinimport.c +msgid "no module named '%q'" msgstr "" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c @@ -3099,10 +3115,6 @@ msgstr "" msgid "no such attribute" msgstr "" -#: shared-module/msgpack/__init__.c -msgid "no unpacker found" -msgstr "" - #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" msgstr "" @@ -3560,10 +3572,6 @@ msgstr "" msgid "tobytes can be invoked for dense arrays only" msgstr "" -#: shared-module/msgpack/__init__.c -msgid "too big" -msgstr "" - #: shared-module/struct/__init__.c msgid "too many arguments provided with the given format" msgstr "" diff --git a/shared-bindings/msgpack/ExtType.c b/shared-bindings/msgpack/ExtType.c new file mode 100644 index 0000000000..3a4eee3884 --- /dev/null +++ b/shared-bindings/msgpack/ExtType.c @@ -0,0 +1,127 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Bernhard Boser + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/runtime.h" +#include "py/smallint.h" +#include "py/objproperty.h" +#include "shared-bindings/msgpack/ExtType.h" + +//| class ExtType: +//| """ExtType represents ext type in msgpack.""" +//| def __init__(self, code: int, data: bytes) -> None: +//| """Constructor""" +//| +//| :param int code: type code in range 0~127. +//| :param bytes data: representation. + +STATIC mp_obj_t mod_msgpack_exttype_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + mod_msgpack_extype_obj_t *self = m_new_obj(mod_msgpack_extype_obj_t); + self->base.type = &mod_msgpack_exttype_type; + enum { ARG_code, ARG_data }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_code, MP_ARG_INT | MP_ARG_REQUIRED }, + { MP_QSTR_data, MP_ARG_OBJ | MP_ARG_REQUIRED }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + int code = args[ARG_code].u_int; + if (code < 0 || code > 127) { + mp_raise_AttributeError(translate("code outside range 0~127")); + } + self->code = code; + + mp_obj_t data = args[ARG_data].u_obj; + self->data = data; + return MP_OBJ_FROM_PTR(self); +} + + +//| code: int +//| """The type code, in range 0~127.""" +//| + +STATIC mp_obj_t mod_msgpack_exttype_get_code(mp_obj_t self_in) { + mod_msgpack_extype_obj_t *self = MP_OBJ_TO_PTR(self_in); + return MP_OBJ_NEW_SMALL_INT(self->code); +} +MP_DEFINE_CONST_FUN_OBJ_1(mod_msgpack_exttype_get_code_obj, mod_msgpack_exttype_get_code); + +STATIC mp_obj_t mod_msgpack_exttype_set_code(mp_obj_t self_in, mp_obj_t code_in) { + mod_msgpack_extype_obj_t *self = MP_OBJ_TO_PTR(self_in); + int code = mp_obj_get_int(code_in); + if (code < 0 || code > 127) { + mp_raise_AttributeError(translate("code outside range 0~127")); + } + self->code = code; + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(mod_msgpack_exttype_set_code_obj, mod_msgpack_exttype_set_code); + +const mp_obj_property_t mod_msgpack_exttype_code_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&mod_msgpack_exttype_get_code_obj, + (mp_obj_t)&mod_msgpack_exttype_set_code_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +//| data: bytes +//| """Data.""" +//| + +STATIC mp_obj_t mod_msgpack_exttype_get_data(mp_obj_t self_in) { + mod_msgpack_extype_obj_t *self = MP_OBJ_TO_PTR(self_in); + return self->data; +} +MP_DEFINE_CONST_FUN_OBJ_1(mod_msgpack_exttype_get_data_obj, mod_msgpack_exttype_get_data); + +STATIC mp_obj_t mod_msgpack_exttype_set_data(mp_obj_t self_in, mp_obj_t data_in) { + mod_msgpack_extype_obj_t *self = MP_OBJ_TO_PTR(self_in); + self->data = data_in; + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(mod_msgpack_exttype_set_data_obj, mod_msgpack_exttype_set_data); + +const mp_obj_property_t mod_msgpack_exttype_data_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&mod_msgpack_exttype_get_data_obj, + (mp_obj_t)&mod_msgpack_exttype_set_data_obj, + (mp_obj_t)&mp_const_none_obj}, +}; + +STATIC mp_rom_map_elem_t mod_msgpack_exttype_locals_dict_table[] = { + // Properties + { MP_ROM_QSTR(MP_QSTR_code), MP_ROM_PTR(&mod_msgpack_exttype_code_obj) }, + { MP_ROM_QSTR(MP_QSTR_data), MP_ROM_PTR(&mod_msgpack_exttype_data_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(mod_msgpack_exttype_locals_dict, mod_msgpack_exttype_locals_dict_table); + +const mp_obj_type_t mod_msgpack_exttype_type = { + { &mp_type_type }, + .name = MP_QSTR_ExtType, + .make_new = mod_msgpack_exttype_make_new, + .locals_dict = (mp_obj_dict_t*)&mod_msgpack_exttype_locals_dict, +}; diff --git a/shared-bindings/msgpack/ExtType.h b/shared-bindings/msgpack/ExtType.h new file mode 100644 index 0000000000..64173b2213 --- /dev/null +++ b/shared-bindings/msgpack/ExtType.h @@ -0,0 +1,40 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Bernhard Boser + * + * 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_MSGPACK_EXTTYPE___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_MSGPACK_EXTTYPE___INIT___H + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + int32_t code; + mp_obj_t data; +} mod_msgpack_extype_obj_t; + +extern const mp_obj_type_t mod_msgpack_exttype_type; + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_MSGPACK_EXTTYPE___INIT___H diff --git a/shared-bindings/msgpack/__init__.c b/shared-bindings/msgpack/__init__.c index a222177f74..fcb86ac6c7 100644 --- a/shared-bindings/msgpack/__init__.c +++ b/shared-bindings/msgpack/__init__.c @@ -24,15 +24,24 @@ * THE SOFTWARE. */ +#include +#include "py/obj.h" +#include "py/runtime.h" #include "shared-bindings/msgpack/__init__.h" #include "shared-module/msgpack/__init__.h" +#include "shared-bindings/msgpack/ExtType.h" + +#define MP_OBJ_IS_METH(o) (MP_OBJ_IS_OBJ(o) && (((mp_obj_base_t*)MP_OBJ_TO_PTR(o))->type->name == MP_QSTR_bound_method)) //| """Pack object in msgpack format //| //| The msgpack format is similar to json, except that the encoded data is binary. -//| See https://msgpack.org for details. +//| See https://msgpack.org for details. The module implements a subset of the cpython +//| module msgpack-python. //| -//| Example: +//| Not implemented: 64-bit int, uint, float. +//| +//| Example 1: //| import msgpack //| from io import BytesIO //| @@ -41,33 +50,98 @@ //| b.seek(0) //| print(msgpack.unpack(b))""" //| - -//| def pack(obj: Any, buffer: WriteableBuffer) -> None: -//| """Pack obj to stream.""" -//| ... +//| Example 2: handling objects //| +//| from msgpack import pack, unpack, ExtType +//| from io import BytesIO +//| +//| class MyClass: +//| def __init__(self, val): +//| self.value = val +//| def __str__(self): +//| return str(self.value) +//| +//| data = MyClass(b'my_value') +//| +//| def encoder(obj): +//| if isinstance(obj, MyClass): +//| return ExtType(1, obj.value) +//| return f"no encoder for {obj}" +//| +//| def decoder(code, data): +//| if code == 1: +//| return MyClass(data) +//| return f"no decoder for type {code}" +//| +//| buffer = BytesIO() +//| pack(data, buffer, default=encoder) +//| buffer.seek(0) +//| decoded = unpack(buffer, ext_hook=decoder) +//| print(f"{data} -> {buffer.getvalue()} -> {decoded}") +//| """ -STATIC mp_obj_t mod_msgpack_pack(mp_obj_t obj, mp_obj_t stream_obj) { - common_hal_msgpack_pack(obj, stream_obj); + +//| def pack(obj: object, buffer: WriteableBuffer, *, default: Function=None) -> None: +//| """Ouput object to buffer in msgpack format. +//| :param object obj: Object to convert to msgpack format. +//| :param ~_typing.WriteableBuffer buffer: buffer to write into +//| :param Optional[~_typing.Function] default: +//| function called for python objects that do not have +//| a representation in msgpack format. +//| """ + +STATIC mp_obj_t mod_msgpack_pack(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_obj, ARG_buffer, ARG_default }; + STATIC const mp_arg_t allowed_args[] = { + { MP_QSTR_obj, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_buffer, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_default, MP_ARG_KW_ONLY | MP_ARG_OBJ, { .u_obj = mp_const_none } }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + mp_obj_t handler = args[ARG_default].u_obj; + if (handler != mp_const_none && !MP_OBJ_IS_FUN(handler) && !MP_OBJ_IS_METH(handler)) { + mp_raise_ValueError(translate("default is not a function")); + } + + common_hal_msgpack_pack(args[ARG_obj].u_obj, args[ARG_buffer].u_obj, handler); return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_msgpack_pack_obj, mod_msgpack_pack); +MP_DEFINE_CONST_FUN_OBJ_KW(mod_msgpack_pack_obj, 1, mod_msgpack_pack); +//| def unpack(buffer: ReadableBuffer, *, ext_hook: Function=None, use_list: bool=True) -> object: +//| """Unpack and return one object from buffer. +//| :param ~_typing.ReadableBuffer buffer: buffer to read from +//| :param Optional[~_typing.Function] ext_hook: function called for objects in +//| msgpack ext format. +//| :param Optional[bool] use_list: return array as list or tuple (use_list=False). +//| :return object: object read from buffer. +//| """ -//| def unpack(buffer: ReadableBuffer) -> Any: -//| """Unpack and return one object (in msgpack format) from stream. -//| Call repeatedly to read multiple objects from the stream.""" -//| ... -//| +STATIC mp_obj_t mod_msgpack_unpack(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_buffer, ARG_ext_hook, ARG_use_list }; + STATIC const mp_arg_t allowed_args[] = { + { MP_QSTR_buffer, MP_ARG_REQUIRED | MP_ARG_OBJ, }, + { MP_QSTR_ext_hook, MP_ARG_KW_ONLY | MP_ARG_OBJ, { .u_obj = mp_const_none } }, + { MP_QSTR_use_list, MP_ARG_KW_ONLY | MP_ARG_BOOL, { .u_bool = true } }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); -STATIC mp_obj_t mod_msgpack_unpack(mp_obj_t stream_obj) { - return common_hal_msgpack_unpack(stream_obj); + mp_obj_t hook = args[ARG_ext_hook].u_obj; + if (hook != mp_const_none && !MP_OBJ_IS_FUN(hook) && !MP_OBJ_IS_METH(hook)) { + mp_raise_ValueError(translate("ext_hook is not a function")); + } + + return common_hal_msgpack_unpack(args[ARG_buffer].u_obj, hook, args[ARG_use_list].u_bool); } -STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_msgpack_unpack_obj, mod_msgpack_unpack); +MP_DEFINE_CONST_FUN_OBJ_KW(mod_msgpack_unpack_obj, 1, mod_msgpack_unpack); STATIC const mp_rom_map_elem_t msgpack_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_msgpack) }, + { MP_ROM_QSTR(MP_QSTR_ExtType), MP_ROM_PTR(&mod_msgpack_exttype_type) }, { MP_ROM_QSTR(MP_QSTR_pack), MP_ROM_PTR(&mod_msgpack_pack_obj) }, { MP_ROM_QSTR(MP_QSTR_unpack), MP_ROM_PTR(&mod_msgpack_unpack_obj) }, }; diff --git a/shared-bindings/msgpack/__init__.h b/shared-bindings/msgpack/__init__.h index 4836cc62e7..a02ead0bd0 100644 --- a/shared-bindings/msgpack/__init__.h +++ b/shared-bindings/msgpack/__init__.h @@ -29,6 +29,6 @@ #include "py/obj.h" -// Nothing now. +// nothing for now #endif // MICROPY_INCLUDED_SHARED_BINDINGS_MSGPACK___INIT___H diff --git a/shared-module/msgpack/__init__.c b/shared-module/msgpack/__init__.c index 5bc7d1f615..204312109a 100644 --- a/shared-module/msgpack/__init__.c +++ b/shared-module/msgpack/__init__.c @@ -27,6 +27,7 @@ #include #include +#include "py/obj.h" #include "py/binary.h" #include "py/objarray.h" #include "py/objlist.h" @@ -36,6 +37,7 @@ #include "py/stream.h" #include "supervisor/shared/translate.h" +#include "shared-bindings/msgpack/ExtType.h" //////////////////////////////////////////////////////////////// // stream management @@ -56,7 +58,7 @@ STATIC msgpack_stream_t get_stream(mp_obj_t stream_obj, int flags) { //////////////////////////////////////////////////////////////// // readers -STATIC void read_bytes(msgpack_stream_t *s, void *buf, mp_uint_t size) { +STATIC void read(msgpack_stream_t *s, void *buf, mp_uint_t size) { if (size == 0) return; mp_uint_t ret = s->read(s->stream_obj, buf, size, &s->errcode); if (s->errcode != 0) { @@ -69,13 +71,13 @@ STATIC void read_bytes(msgpack_stream_t *s, void *buf, mp_uint_t size) { STATIC uint8_t read1(msgpack_stream_t *s) { uint8_t res = 0; - read_bytes(s, &res, 1); + read(s, &res, 1); return res; } STATIC uint16_t read2(msgpack_stream_t *s) { uint16_t res = 0; - read_bytes(s, &res, 2); + read(s, &res, 2); int n = 1; if (*(char *)&n == 1) res = __builtin_bswap16(res); return res; @@ -83,19 +85,18 @@ STATIC uint16_t read2(msgpack_stream_t *s) { STATIC uint32_t read4(msgpack_stream_t *s) { uint32_t res = 0; - read_bytes(s, &res, 4); + read(s, &res, 4); int n = 1; if (*(char *)&n == 1) res = __builtin_bswap32(res); return res; } STATIC size_t read_size(msgpack_stream_t *s, uint8_t len_index) { - size_t res = 0; + size_t res; switch (len_index) { case 0: res = (size_t)read1(s); break; case 1: res = (size_t)read2(s); break; case 2: res = (size_t)read4(s); break; - default: mp_raise_ValueError(translate("too big")); } return res; } @@ -103,7 +104,7 @@ STATIC size_t read_size(msgpack_stream_t *s, uint8_t len_index) { //////////////////////////////////////////////////////////////// // writers -STATIC void write_bytes(msgpack_stream_t *s, const void *buf, mp_uint_t size) { +STATIC void write(msgpack_stream_t *s, const void *buf, mp_uint_t size) { mp_uint_t ret = s->write(s->stream_obj, buf, size, &s->errcode); if (s->errcode != 0) { mp_raise_OSError(s->errcode); @@ -114,19 +115,19 @@ STATIC void write_bytes(msgpack_stream_t *s, const void *buf, mp_uint_t size) { } STATIC void write1(msgpack_stream_t *s, uint8_t obj) { - write_bytes(s, &obj, 1); + write(s, &obj, 1); } STATIC void write2(msgpack_stream_t *s, uint16_t obj) { int n = 1; if (*(char *)&n == 1) obj = __builtin_bswap16(obj); - write_bytes(s, &obj, 2); + write(s, &obj, 2); } STATIC void write4(msgpack_stream_t *s, uint32_t obj) { int n = 1; if (*(char *)&n == 1) obj = __builtin_bswap32(obj); - write_bytes(s, &obj, 4); + write(s, &obj, 4); } // compute and write msgpack size code (array structures) @@ -178,15 +179,34 @@ STATIC void pack_int(msgpack_stream_t *s, int32_t x) { } } -void pack_bin(msgpack_stream_t *s, const uint8_t* data, size_t len) { +STATIC void pack_bin(msgpack_stream_t *s, const uint8_t* data, size_t len) { write_size(s, 0xc4, len); for (size_t i=0; idata, &bufinfo, MP_BUFFER_READ); + pack_ext(s, ext->code, bufinfo.buf, bufinfo.len); } else if (MP_OBJ_IS_TYPE(obj, &mp_type_bytes)) { // bytes mp_buffer_info_t bufinfo; @@ -243,14 +268,14 @@ void pack(mp_obj_t obj, msgpack_stream_t *s) { mp_obj_tuple_t *self = MP_OBJ_TO_PTR(obj); pack_array(s, self->len); for (size_t i=0; ilen; i++) { - pack(self->items[i], s); + pack(self->items[i], s, default_handler); } } else if (MP_OBJ_IS_TYPE(obj, &mp_type_list)) { // list (layout differs from tuple) mp_obj_list_t *self = MP_OBJ_TO_PTR(obj); pack_array(s, self->len); for (size_t i=0; ilen; i++) { - pack(self->items[i], s); + pack(self->items[i], s, default_handler); } } else if (MP_OBJ_IS_TYPE(obj, &mp_type_dict)) { // dict @@ -259,8 +284,8 @@ void pack(mp_obj_t obj, msgpack_stream_t *s) { size_t cur = 0; mp_map_elem_t *next = NULL; while ((next = dict_iter_next(self, &cur)) != NULL) { - pack(next->key, s); - pack(next->value, s); + pack(next->key, s, default_handler); + pack(next->value, s, default_handler); } } else if (mp_obj_is_float(obj)) { union Float { mp_float_t f; uint32_t u; }; @@ -275,14 +300,60 @@ void pack(mp_obj_t obj, msgpack_stream_t *s) { } else if (obj == mp_const_true) { write1(s, 0xc3); } else { - mp_raise_ValueError(translate("no packer")); + if (default_handler != mp_const_none) { + // set default_handler to mp_const_none to avoid infinite recursion + // this also precludes some valid outputs + pack(mp_call_function_1(default_handler, obj), s, mp_const_none); + } else { + mp_raise_ValueError(translate("no default packer")); + } } } //////////////////////////////////////////////////////////////// // unpacker -mp_obj_t unpack(msgpack_stream_t *s) { +STATIC mp_obj_t unpack(msgpack_stream_t *s, mp_obj_t ext_hook, bool use_list); + +STATIC mp_obj_t unpack_array_elements(msgpack_stream_t *s, size_t size, mp_obj_t ext_hook, bool use_list) { + if (use_list) { + mp_obj_list_t *t = MP_OBJ_TO_PTR(mp_obj_new_list(size, NULL)); + for (size_t i=0; iitems[i] = unpack(s, ext_hook, use_list); + } + return MP_OBJ_FROM_PTR(t); + } else { + mp_obj_tuple_t *t = MP_OBJ_TO_PTR(mp_obj_new_tuple(size, NULL)); + for (size_t i=0; iitems[i] = unpack(s, ext_hook, use_list); + } + return MP_OBJ_FROM_PTR(t); + } +} + +STATIC mp_obj_t unpack_bytes(msgpack_stream_t *s, size_t size) { + vstr_t vstr; + vstr_init_len(&vstr, size); + byte *p = (byte*)vstr.buf; + read(s, p, size); + return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr); +} + +STATIC mp_obj_t unpack_ext(msgpack_stream_t *s, size_t size, mp_obj_t ext_hook) { + int8_t code = read1(s); + mp_obj_t data = unpack_bytes(s, size); + if (ext_hook != mp_const_none) { + return mp_call_function_2(ext_hook, MP_OBJ_NEW_SMALL_INT(code), data); + } else { + mod_msgpack_extype_obj_t *o = m_new_obj(mod_msgpack_extype_obj_t); + o->base.type = &mod_msgpack_exttype_type; + o->code = code; + o->data = data; + return MP_OBJ_FROM_PTR(o); + } +} + +STATIC mp_obj_t unpack(msgpack_stream_t *s, mp_obj_t ext_hook, bool use_list) { uint8_t code = read1(s); if (((code & 0b10000000) == 0) || ((code & 0b11100000) == 0b11100000)) { // int @@ -293,24 +364,19 @@ mp_obj_t unpack(msgpack_stream_t *s) { size_t len = code & 0b11111; // allocate on stack; len < 32 char str[len]; - read_bytes(s, &str, len); + read(s, &str, len); return mp_obj_new_str(str, len); } if ((code & 0b11110000) == 0b10010000) { - // array (tuple) - size_t len = code & 0b1111; - mp_obj_tuple_t *t = MP_OBJ_TO_PTR(mp_obj_new_tuple(len, NULL)); - for (size_t i=0; iitems[i] = unpack(s); - } - return MP_OBJ_FROM_PTR(t); + // array (list / tuple) + return unpack_array_elements(s, code & 0b1111, ext_hook, use_list); } if ((code & 0b11110000) == 0b10000000) { // map (dict) size_t len = code & 0b1111; mp_obj_dict_t *d = MP_OBJ_TO_PTR(mp_obj_new_dict(len)); for (size_t i=0; iitems[i] = unpack(s); - } - return MP_OBJ_FROM_PTR(t); + size_t size = read_size(s, code - 0xdc + 1); + return unpack_array_elements(s, size, ext_hook, use_list); } - case 0xc1: // never used + case 0xd4: // fixenxt 1 + return unpack_ext(s, 1, ext_hook); + case 0xd5: // fixenxt 2 + return unpack_ext(s, 2, ext_hook); + case 0xd6: // fixenxt 4 + return unpack_ext(s, 4, ext_hook); + case 0xd7: // fixenxt 8 + return unpack_ext(s, 8, ext_hook); + case 0xd8: // fixenxt 16 + return unpack_ext(s, 16, ext_hook); case 0xc7: // ext 8 case 0xc8: // ext 16 - case 0xc9: // ext 32 + case 0xc9: + // ext 8, 16, 32 + return unpack_ext(s, read_size(s, code-0xc7), ext_hook); + case 0xc1: // never used case 0xcb: // float 64 case 0xcf: // uint 64 case 0xd3: // int 64 - case 0xd4: // fixenxt 1 - case 0xd5: // fixenxt 2 - case 0xd6: // fixenxt 4 - case 0xd7: // fixenxt 8 - case 0xd8: // fixenxt 16 default: - mp_raise_ValueError(translate("no unpacker found")); + mp_raise_NotImplementedError(translate("64 bit types")); } } -void common_hal_msgpack_pack(mp_obj_t obj, mp_obj_t stream_obj) { +void common_hal_msgpack_pack(mp_obj_t obj, mp_obj_t stream_obj, mp_obj_t default_handler) { msgpack_stream_t stream = get_stream(stream_obj, MP_STREAM_OP_WRITE); - pack(obj, &stream); + pack(obj, &stream, default_handler); } -mp_obj_t common_hal_msgpack_unpack(mp_obj_t stream_obj) { +mp_obj_t common_hal_msgpack_unpack(mp_obj_t stream_obj, mp_obj_t ext_hook, bool use_list) { msgpack_stream_t stream = get_stream(stream_obj, MP_STREAM_OP_WRITE); - return unpack(&stream); + return unpack(&stream, ext_hook, use_list); } diff --git a/shared-module/msgpack/__init__.h b/shared-module/msgpack/__init__.h index 0a5e7852ad..88b4809f95 100644 --- a/shared-module/msgpack/__init__.h +++ b/shared-module/msgpack/__init__.h @@ -28,7 +28,7 @@ #include "py/stream.h" -void common_hal_msgpack_pack(mp_obj_t obj, mp_obj_t stream_obj); -mp_obj_t common_hal_msgpack_unpack(mp_obj_t stream_obj); +void common_hal_msgpack_pack(mp_obj_t obj, mp_obj_t stream_obj, mp_obj_t default_handler); +mp_obj_t common_hal_msgpack_unpack(mp_obj_t stream_obj, mp_obj_t ext_hook, bool use_list); #endif diff --git a/tests/extmod/umsgpack_pack.py b/tests/extmod/umsgpack_pack.py new file mode 100644 index 0000000000..d9f0005e1b --- /dev/null +++ b/tests/extmod/umsgpack_pack.py @@ -0,0 +1,30 @@ +try: + from uio import BytesIO + import umsgpack as msgpack +except: + try: + from io import BytesIO + import msgpack + except ImportError: + print("SKIP") + raise SystemExit + +b = BytesIO() +msgpack.pack(False, s) +print(b.getvalue()) + +b = BytesIO() +msgpack.pack({"a": (-1, 0, 2, [3, None], 128)}, b) +print(b.getvalue()) + +# pack to a small-int not allowed +try: + msgpack.pack(123, 1) +except (AttributeError, OSError): # CPython and uPy have different errors + print('Exception') + +# pack to an object not allowed +try: + msgpack.pack(123, {}) +except (AttributeError, OSError): # CPython and uPy have different errors + print('Exception') diff --git a/tests/extmod/umsgpack_pack.py.ext b/tests/extmod/umsgpack_pack.py.ext new file mode 100644 index 0000000000..2f966be069 --- /dev/null +++ b/tests/extmod/umsgpack_pack.py.ext @@ -0,0 +1,5 @@ +b'\xc2' +b'\x82\xa1a\x96\xff\x00\x02\x92\x03\xc0\xd1\x00\x80\xc4\x07abcdefg\xa1b\xd4\x05x' +Exception ExtType +Exception to int +Exception to object From 534b48fcfe688d88455bd8421fa02255ecc8508b Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Mon, 7 Dec 2020 16:08:16 -0800 Subject: [PATCH 19/82] remove a ~ from doc that causes an error; add ExtType.c to circuitpy_defns.mk --- locale/circuitpython.pot | 2 +- py/circuitpy_defns.mk | 1 + shared-bindings/msgpack/ExtType.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 979f62466e..7acfbe1ded 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-07 15:35-0800\n" +"POT-Creation-Date: 2020-12-07 16:05-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index f13f69bcf2..39ff2e380f 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -407,6 +407,7 @@ $(filter $(SRC_PATTERNS), \ microcontroller/ResetReason.c \ microcontroller/RunMode.c \ msgpack/__init__.c \ + msgpack/ExtType.c \ supervisor/RunReason.c \ ) diff --git a/shared-bindings/msgpack/ExtType.c b/shared-bindings/msgpack/ExtType.c index 3a4eee3884..dfccbd3ef2 100644 --- a/shared-bindings/msgpack/ExtType.c +++ b/shared-bindings/msgpack/ExtType.c @@ -34,7 +34,7 @@ //| def __init__(self, code: int, data: bytes) -> None: //| """Constructor""" //| -//| :param int code: type code in range 0~127. +//| :param int code: type code in range 0 .. 127. //| :param bytes data: representation. STATIC mp_obj_t mod_msgpack_exttype_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { From 9412c3f58e9340d9300cd048f566feda7c48c53c Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Mon, 7 Dec 2020 16:22:09 -0800 Subject: [PATCH 20/82] moved misplaced triple-quote --- shared-bindings/msgpack/ExtType.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/shared-bindings/msgpack/ExtType.c b/shared-bindings/msgpack/ExtType.c index dfccbd3ef2..daac55dc44 100644 --- a/shared-bindings/msgpack/ExtType.c +++ b/shared-bindings/msgpack/ExtType.c @@ -32,10 +32,9 @@ //| class ExtType: //| """ExtType represents ext type in msgpack.""" //| def __init__(self, code: int, data: bytes) -> None: -//| """Constructor""" -//| -//| :param int code: type code in range 0 .. 127. -//| :param bytes data: representation. +//| """Constructor +//| :param int code: type code in range 0~127. +//| :param bytes data: representation.""" STATIC mp_obj_t mod_msgpack_exttype_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { mod_msgpack_extype_obj_t *self = m_new_obj(mod_msgpack_extype_obj_t); From 5875a27fa8f09dc27c3d25c13f4aa28c22c0279b Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Mon, 7 Dec 2020 16:32:38 -0800 Subject: [PATCH 21/82] removed extra triple quote --- shared-bindings/msgpack/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/msgpack/__init__.c b/shared-bindings/msgpack/__init__.c index fcb86ac6c7..5f1fac1375 100644 --- a/shared-bindings/msgpack/__init__.c +++ b/shared-bindings/msgpack/__init__.c @@ -48,7 +48,7 @@ //| b = BytesIO() //| msgpack.pack({'list': [True, False, None, 1, 'abc'], 'str': 'blah'}, b) //| b.seek(0) -//| print(msgpack.unpack(b))""" +//| print(msgpack.unpack(b)) //| //| Example 2: handling objects //| From 9903c9e855f07b6660f6a89546030d47cd9c70e6 Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Mon, 7 Dec 2020 16:50:52 -0800 Subject: [PATCH 22/82] fixed (?) typespec for callback functions --- shared-bindings/msgpack/__init__.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/msgpack/__init__.c b/shared-bindings/msgpack/__init__.c index 5f1fac1375..08d535c58a 100644 --- a/shared-bindings/msgpack/__init__.c +++ b/shared-bindings/msgpack/__init__.c @@ -85,7 +85,7 @@ //| """Ouput object to buffer in msgpack format. //| :param object obj: Object to convert to msgpack format. //| :param ~_typing.WriteableBuffer buffer: buffer to write into -//| :param Optional[~_typing.Function] default: +//| :param Optional[~_typing.Callable[[object], None]] default: //| function called for python objects that do not have //| a representation in msgpack format. //| """ @@ -113,7 +113,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(mod_msgpack_pack_obj, 1, mod_msgpack_pack); //| def unpack(buffer: ReadableBuffer, *, ext_hook: Function=None, use_list: bool=True) -> object: //| """Unpack and return one object from buffer. //| :param ~_typing.ReadableBuffer buffer: buffer to read from -//| :param Optional[~_typing.Function] ext_hook: function called for objects in +//| :param Optional[~_typing.Callable[[int, bytes], object]] ext_hook: function called for objects in //| msgpack ext format. //| :param Optional[bool] use_list: return array as list or tuple (use_list=False). //| :return object: object read from buffer. From 413885a529db041413a1e1b259389afce3602d7e Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Mon, 7 Dec 2020 17:45:21 -0800 Subject: [PATCH 23/82] fix typspec in function declarations --- shared-bindings/msgpack/__init__.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/msgpack/__init__.c b/shared-bindings/msgpack/__init__.c index 08d535c58a..0660ee78b9 100644 --- a/shared-bindings/msgpack/__init__.c +++ b/shared-bindings/msgpack/__init__.c @@ -81,7 +81,7 @@ //| """ -//| def pack(obj: object, buffer: WriteableBuffer, *, default: Function=None) -> None: +//| def pack(obj: object, buffer: WriteableBuffer, *, default: Callable[[object], None]]=None) -> None: //| """Ouput object to buffer in msgpack format. //| :param object obj: Object to convert to msgpack format. //| :param ~_typing.WriteableBuffer buffer: buffer to write into @@ -110,7 +110,7 @@ STATIC mp_obj_t mod_msgpack_pack(size_t n_args, const mp_obj_t *pos_args, mp_map } MP_DEFINE_CONST_FUN_OBJ_KW(mod_msgpack_pack_obj, 1, mod_msgpack_pack); -//| def unpack(buffer: ReadableBuffer, *, ext_hook: Function=None, use_list: bool=True) -> object: +//| def unpack(buffer: ReadableBuffer, *, ext_hook: Callable[[int, bytes], object]]=None, use_list: bool=True) -> object: //| """Unpack and return one object from buffer. //| :param ~_typing.ReadableBuffer buffer: buffer to read from //| :param Optional[~_typing.Callable[[int, bytes], object]] ext_hook: function called for objects in From 1f14d393645d2f3939b8e378148b440ed237e2ce Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Tue, 8 Dec 2020 11:50:45 -0800 Subject: [PATCH 24/82] remove two extra closing angular brackets --- shared-bindings/msgpack/__init__.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/msgpack/__init__.c b/shared-bindings/msgpack/__init__.c index 0660ee78b9..ade88b10dd 100644 --- a/shared-bindings/msgpack/__init__.c +++ b/shared-bindings/msgpack/__init__.c @@ -81,7 +81,7 @@ //| """ -//| def pack(obj: object, buffer: WriteableBuffer, *, default: Callable[[object], None]]=None) -> None: +//| def pack(obj: object, buffer: WriteableBuffer, *, default: Callable[[object], None]=None) -> None: //| """Ouput object to buffer in msgpack format. //| :param object obj: Object to convert to msgpack format. //| :param ~_typing.WriteableBuffer buffer: buffer to write into @@ -110,7 +110,7 @@ STATIC mp_obj_t mod_msgpack_pack(size_t n_args, const mp_obj_t *pos_args, mp_map } MP_DEFINE_CONST_FUN_OBJ_KW(mod_msgpack_pack_obj, 1, mod_msgpack_pack); -//| def unpack(buffer: ReadableBuffer, *, ext_hook: Callable[[int, bytes], object]]=None, use_list: bool=True) -> object: +//| def unpack(buffer: ReadableBuffer, *, ext_hook: Callable[[int, bytes], object]=None, use_list: bool=True) -> object: //| """Unpack and return one object from buffer. //| :param ~_typing.ReadableBuffer buffer: buffer to read from //| :param Optional[~_typing.Callable[[int, bytes], object]] ext_hook: function called for objects in From 9e7a7b9dc422e3031c914a90f9ceda9b21ed27f8 Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Tue, 8 Dec 2020 14:38:20 -0800 Subject: [PATCH 25/82] uglify typing hints --- shared-bindings/msgpack/__init__.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/msgpack/__init__.c b/shared-bindings/msgpack/__init__.c index ade88b10dd..59ff694bb8 100644 --- a/shared-bindings/msgpack/__init__.c +++ b/shared-bindings/msgpack/__init__.c @@ -81,7 +81,7 @@ //| """ -//| def pack(obj: object, buffer: WriteableBuffer, *, default: Callable[[object], None]=None) -> None: +//| def pack(obj: object, buffer: WriteableBuffer, *, default: Union[Callable[[object], None],None]=None) -> None: //| """Ouput object to buffer in msgpack format. //| :param object obj: Object to convert to msgpack format. //| :param ~_typing.WriteableBuffer buffer: buffer to write into @@ -110,7 +110,7 @@ STATIC mp_obj_t mod_msgpack_pack(size_t n_args, const mp_obj_t *pos_args, mp_map } MP_DEFINE_CONST_FUN_OBJ_KW(mod_msgpack_pack_obj, 1, mod_msgpack_pack); -//| def unpack(buffer: ReadableBuffer, *, ext_hook: Callable[[int, bytes], object]=None, use_list: bool=True) -> object: +//| def unpack(buffer: ReadableBuffer, *, ext_hook: Union[Callable[[int, bytes], object],None],None]=None, use_list: bool=True) -> object: //| """Unpack and return one object from buffer. //| :param ~_typing.ReadableBuffer buffer: buffer to read from //| :param Optional[~_typing.Callable[[int, bytes], object]] ext_hook: function called for objects in From a5c3dc286c38c3c007513db58c09a88308c2a863 Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Tue, 8 Dec 2020 15:48:56 -0800 Subject: [PATCH 26/82] typing ... --- shared-bindings/msgpack/__init__.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-bindings/msgpack/__init__.c b/shared-bindings/msgpack/__init__.c index 59ff694bb8..ea1e430877 100644 --- a/shared-bindings/msgpack/__init__.c +++ b/shared-bindings/msgpack/__init__.c @@ -80,8 +80,7 @@ //| print(f"{data} -> {buffer.getvalue()} -> {decoded}") //| """ - -//| def pack(obj: object, buffer: WriteableBuffer, *, default: Union[Callable[[object], None],None]=None) -> None: +//| def pack(obj: object, buffer: WriteableBuffer, *, default: Union[Callable[[object], None], None] = None) -> None: //| """Ouput object to buffer in msgpack format. //| :param object obj: Object to convert to msgpack format. //| :param ~_typing.WriteableBuffer buffer: buffer to write into @@ -110,7 +109,8 @@ STATIC mp_obj_t mod_msgpack_pack(size_t n_args, const mp_obj_t *pos_args, mp_map } MP_DEFINE_CONST_FUN_OBJ_KW(mod_msgpack_pack_obj, 1, mod_msgpack_pack); -//| def unpack(buffer: ReadableBuffer, *, ext_hook: Union[Callable[[int, bytes], object],None],None]=None, use_list: bool=True) -> object: + +//| def unpack(buffer: ReadableBuffer, *, ext_hook: Union[Callable[[int, bytes], object], None] = None, use_list: bool=True) -> object: //| """Unpack and return one object from buffer. //| :param ~_typing.ReadableBuffer buffer: buffer to read from //| :param Optional[~_typing.Callable[[int, bytes], object]] ext_hook: function called for objects in From 3c724321d863c79dce0ec4d11e12fd6c9fa27c4c Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Wed, 9 Dec 2020 12:01:09 -0800 Subject: [PATCH 27/82] cosmetics --- shared-bindings/msgpack/ExtType.c | 2 -- shared-bindings/msgpack/__init__.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/shared-bindings/msgpack/ExtType.c b/shared-bindings/msgpack/ExtType.c index daac55dc44..272c1ccebc 100644 --- a/shared-bindings/msgpack/ExtType.c +++ b/shared-bindings/msgpack/ExtType.c @@ -61,7 +61,6 @@ STATIC mp_obj_t mod_msgpack_exttype_make_new(const mp_obj_type_t *type, size_t n //| code: int //| """The type code, in range 0~127.""" -//| STATIC mp_obj_t mod_msgpack_exttype_get_code(mp_obj_t self_in) { mod_msgpack_extype_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -89,7 +88,6 @@ const mp_obj_property_t mod_msgpack_exttype_code_obj = { //| data: bytes //| """Data.""" -//| STATIC mp_obj_t mod_msgpack_exttype_get_data(mp_obj_t self_in) { mod_msgpack_extype_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/msgpack/__init__.c b/shared-bindings/msgpack/__init__.c index ea1e430877..06c3900b5d 100644 --- a/shared-bindings/msgpack/__init__.c +++ b/shared-bindings/msgpack/__init__.c @@ -46,7 +46,7 @@ //| from io import BytesIO //| //| b = BytesIO() -//| msgpack.pack({'list': [True, False, None, 1, 'abc'], 'str': 'blah'}, b) +//| msgpack.pack({'list': [True, False, None, 1, 3.14], 'str': 'blah'}, b) //| b.seek(0) //| print(msgpack.unpack(b)) //| From 6d2329fb09ce47eaa5cdf0dbf9c5e1e1ef37632a Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Thu, 10 Dec 2020 10:59:26 -0800 Subject: [PATCH 28/82] add blank lines after all comment sections --- shared-bindings/msgpack/ExtType.c | 9 ++++++--- shared-bindings/msgpack/__init__.c | 8 ++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/shared-bindings/msgpack/ExtType.c b/shared-bindings/msgpack/ExtType.c index 272c1ccebc..6f0a16b999 100644 --- a/shared-bindings/msgpack/ExtType.c +++ b/shared-bindings/msgpack/ExtType.c @@ -35,7 +35,8 @@ //| """Constructor //| :param int code: type code in range 0~127. //| :param bytes data: representation.""" - +//| ... +//| STATIC mp_obj_t mod_msgpack_exttype_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { mod_msgpack_extype_obj_t *self = m_new_obj(mod_msgpack_extype_obj_t); self->base.type = &mod_msgpack_exttype_type; @@ -61,7 +62,8 @@ STATIC mp_obj_t mod_msgpack_exttype_make_new(const mp_obj_type_t *type, size_t n //| code: int //| """The type code, in range 0~127.""" - +//| ... +//| STATIC mp_obj_t mod_msgpack_exttype_get_code(mp_obj_t self_in) { mod_msgpack_extype_obj_t *self = MP_OBJ_TO_PTR(self_in); return MP_OBJ_NEW_SMALL_INT(self->code); @@ -88,7 +90,8 @@ const mp_obj_property_t mod_msgpack_exttype_code_obj = { //| data: bytes //| """Data.""" - +//| ... +//| STATIC mp_obj_t mod_msgpack_exttype_get_data(mp_obj_t self_in) { mod_msgpack_extype_obj_t *self = MP_OBJ_TO_PTR(self_in); return self->data; diff --git a/shared-bindings/msgpack/__init__.c b/shared-bindings/msgpack/__init__.c index 06c3900b5d..b41b32d45f 100644 --- a/shared-bindings/msgpack/__init__.c +++ b/shared-bindings/msgpack/__init__.c @@ -79,6 +79,8 @@ //| decoded = unpack(buffer, ext_hook=decoder) //| print(f"{data} -> {buffer.getvalue()} -> {decoded}") //| """ +//| ... +//| //| def pack(obj: object, buffer: WriteableBuffer, *, default: Union[Callable[[object], None], None] = None) -> None: //| """Ouput object to buffer in msgpack format. @@ -88,7 +90,8 @@ //| function called for python objects that do not have //| a representation in msgpack format. //| """ - +//| ... +//| STATIC mp_obj_t mod_msgpack_pack(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_obj, ARG_buffer, ARG_default }; STATIC const mp_arg_t allowed_args[] = { @@ -118,7 +121,8 @@ MP_DEFINE_CONST_FUN_OBJ_KW(mod_msgpack_pack_obj, 1, mod_msgpack_pack); //| :param Optional[bool] use_list: return array as list or tuple (use_list=False). //| :return object: object read from buffer. //| """ - +//| ... +//| STATIC mp_obj_t mod_msgpack_unpack(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer, ARG_ext_hook, ARG_use_list }; STATIC const mp_arg_t allowed_args[] = { From d29184b5a0fb5c54663d48a8e8906564c3d518ad Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Thu, 10 Dec 2020 12:15:43 -0800 Subject: [PATCH 29/82] try without ... in docs --- shared-bindings/msgpack/ExtType.c | 3 --- shared-bindings/msgpack/__init__.c | 3 --- 2 files changed, 6 deletions(-) diff --git a/shared-bindings/msgpack/ExtType.c b/shared-bindings/msgpack/ExtType.c index 6f0a16b999..5dc3d4992e 100644 --- a/shared-bindings/msgpack/ExtType.c +++ b/shared-bindings/msgpack/ExtType.c @@ -35,7 +35,6 @@ //| """Constructor //| :param int code: type code in range 0~127. //| :param bytes data: representation.""" -//| ... //| STATIC mp_obj_t mod_msgpack_exttype_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { mod_msgpack_extype_obj_t *self = m_new_obj(mod_msgpack_extype_obj_t); @@ -62,7 +61,6 @@ STATIC mp_obj_t mod_msgpack_exttype_make_new(const mp_obj_type_t *type, size_t n //| code: int //| """The type code, in range 0~127.""" -//| ... //| STATIC mp_obj_t mod_msgpack_exttype_get_code(mp_obj_t self_in) { mod_msgpack_extype_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -90,7 +88,6 @@ const mp_obj_property_t mod_msgpack_exttype_code_obj = { //| data: bytes //| """Data.""" -//| ... //| STATIC mp_obj_t mod_msgpack_exttype_get_data(mp_obj_t self_in) { mod_msgpack_extype_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/msgpack/__init__.c b/shared-bindings/msgpack/__init__.c index b41b32d45f..5dc45dde2c 100644 --- a/shared-bindings/msgpack/__init__.c +++ b/shared-bindings/msgpack/__init__.c @@ -79,7 +79,6 @@ //| decoded = unpack(buffer, ext_hook=decoder) //| print(f"{data} -> {buffer.getvalue()} -> {decoded}") //| """ -//| ... //| //| def pack(obj: object, buffer: WriteableBuffer, *, default: Union[Callable[[object], None], None] = None) -> None: @@ -90,7 +89,6 @@ //| function called for python objects that do not have //| a representation in msgpack format. //| """ -//| ... //| STATIC mp_obj_t mod_msgpack_pack(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_obj, ARG_buffer, ARG_default }; @@ -121,7 +119,6 @@ MP_DEFINE_CONST_FUN_OBJ_KW(mod_msgpack_pack_obj, 1, mod_msgpack_pack); //| :param Optional[bool] use_list: return array as list or tuple (use_list=False). //| :return object: object read from buffer. //| """ -//| ... //| STATIC mp_obj_t mod_msgpack_unpack(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer, ARG_ext_hook, ARG_use_list }; From c875d7c22d447b9a29bcef62af7b46c902684d72 Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Sat, 19 Dec 2020 19:06:43 -0800 Subject: [PATCH 30/82] speedup pack_bin, ext, str; catch short reads --- shared-module/msgpack/__init__.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/shared-module/msgpack/__init__.c b/shared-module/msgpack/__init__.c index 204312109a..39178d46e1 100644 --- a/shared-module/msgpack/__init__.c +++ b/shared-module/msgpack/__init__.c @@ -67,6 +67,9 @@ STATIC void read(msgpack_stream_t *s, void *buf, mp_uint_t size) { if (ret == 0) { mp_raise_msg(&mp_type_EOFError, NULL); } + if (ret < size) { + mp_raise_ValueError(translate("short read")); + } } STATIC uint8_t read1(msgpack_stream_t *s) { @@ -92,7 +95,7 @@ STATIC uint32_t read4(msgpack_stream_t *s) { } STATIC size_t read_size(msgpack_stream_t *s, uint8_t len_index) { - size_t res; + size_t res = 0; switch (len_index) { case 0: res = (size_t)read1(s); break; case 1: res = (size_t)read2(s); break; @@ -181,9 +184,7 @@ STATIC void pack_int(msgpack_stream_t *s, int32_t x) { STATIC void pack_bin(msgpack_stream_t *s, const uint8_t* data, size_t len) { write_size(s, 0xc4, len); - for (size_t i=0; i 0) write(s, data, len); } STATIC void pack_ext(msgpack_stream_t *s, int8_t code, const uint8_t* data, size_t len) { @@ -201,9 +202,7 @@ STATIC void pack_ext(msgpack_stream_t *s, int8_t code, const uint8_t* data, siz write_size(s, 0xc7, len); } write1(s, code); // type byte - for (size_t i=0; i 0) write(s, data, len); } STATIC void pack_str(msgpack_stream_t *s, const char* str, size_t len) { @@ -212,9 +211,7 @@ STATIC void pack_str(msgpack_stream_t *s, const char* str, size_t len) { } else { write_size(s, 0xd9, len); } - for (size_t l=0; l 0) write(s, str, len); } STATIC void pack_array(msgpack_stream_t *s, size_t len) { From 0914b71653adafccb6bb7f656d3833fd60e9c4ae Mon Sep 17 00:00:00 2001 From: anecdata <16617689+anecdata@users.noreply.github.com> Date: Wed, 30 Dec 2020 09:26:25 -0600 Subject: [PATCH 31/82] remove unneeded set_config (wrong param; called in connect anyway) --- ports/esp32s2/common-hal/wifi/Radio.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/esp32s2/common-hal/wifi/Radio.c index 05506783e7..a9617af653 100644 --- a/ports/esp32s2/common-hal/wifi/Radio.c +++ b/ports/esp32s2/common-hal/wifi/Radio.c @@ -55,8 +55,6 @@ static void start_station(wifi_radio_obj_t *self) { esp_wifi_set_mode(next_mode); self->sta_mode = 1; - - esp_wifi_set_config(WIFI_MODE_STA, &self->sta_config); } bool common_hal_wifi_radio_get_enabled(wifi_radio_obj_t *self) { From d537d94a4c6ca36fba4aa7c11a1de93d2a38cf6b Mon Sep 17 00:00:00 2001 From: anecdata <16617689+anecdata@users.noreply.github.com> Date: Wed, 30 Dec 2020 09:45:15 -0600 Subject: [PATCH 32/82] see what we're missing --- ports/esp32s2/common-hal/wifi/__init__.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ports/esp32s2/common-hal/wifi/__init__.c b/ports/esp32s2/common-hal/wifi/__init__.c index 8de3775375..878c903521 100644 --- a/ports/esp32s2/common-hal/wifi/__init__.c +++ b/ports/esp32s2/common-hal/wifi/__init__.c @@ -78,12 +78,15 @@ static void event_handler(void* arg, esp_event_base_t event_base, radio->last_disconnect_reason = reason; xEventGroupSetBits(radio->event_group_handle, WIFI_DISCONNECTED_BIT); + break; } // Cases to handle later. // case WIFI_EVENT_STA_AUTHMODE_CHANGE: - default: + default: { + ESP_EARLY_LOGW(TAG, "event %d 0x%02x", event_id, event_id); break; + } } } From 7cae612ad08c4da5543e968c326b5f88213b550b Mon Sep 17 00:00:00 2001 From: oon arfiandwi Date: Wed, 30 Dec 2020 05:48:17 +0000 Subject: [PATCH 33/82] Translated using Weblate (Indonesian) Currently translated at 46.1% (410 of 889 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/id/ --- locale/ID.po | 72 ++++++++++++++++++++++++++++------------------------ 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 45b35f1955..47c3310dbe 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-12-23 23:04-0500\n" -"PO-Revision-Date: 2020-10-10 23:51+0000\n" +"PO-Revision-Date: 2020-12-30 22:25+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" "Language: ID\n" @@ -14,13 +14,15 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.3-dev\n" +"X-Generator: Weblate 4.4.1-dev\n" #: main.c msgid "" "\n" "Code done running.\n" msgstr "" +"\n" +"Kode selesai beroperasi.\n" #: main.c msgid "" @@ -62,7 +64,7 @@ msgstr "pin alamat %d dan pin rgb %d menunjukkan tinggi %d, bukan %d" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" -msgstr "" +msgstr "%q gagal: %d" #: shared-bindings/microcontroller/Pin.c msgid "%q in use" @@ -78,7 +80,7 @@ msgstr "%q indeks di luar batas" #: py/obj.c msgid "%q indices must be integers, not %q" -msgstr "" +msgstr "%q indeks harus bilangan bulat, bukan %q" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -86,7 +88,7 @@ msgstr "daftar %q harus berupa daftar" #: shared-bindings/memorymonitor/AllocationAlarm.c msgid "%q must be >= 0" -msgstr "" +msgstr "%q harus >= 0" #: shared-bindings/_bleio/CharacteristicBuffer.c #: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c @@ -102,7 +104,7 @@ msgstr "%q harus berupa tuple dengan panjang 2" #: shared-bindings/canio/Match.c msgid "%q out of range" -msgstr "" +msgstr "%q di luar jangkauan" #: ports/atmel-samd/common-hal/microcontroller/Pin.c msgid "%q pin invalid" @@ -126,23 +128,23 @@ msgstr "" #: py/proto.c msgid "'%q' object does not support '%q'" -msgstr "" +msgstr "Objek '%q' tidak mendukung '%q'" #: py/obj.c msgid "'%q' object does not support item assignment" -msgstr "" +msgstr "Objek '%q' tidak mendukung penugasan item" #: py/obj.c msgid "'%q' object does not support item deletion" -msgstr "" +msgstr "Objek '%q' tidak mendukung penghapusan item" #: py/runtime.c msgid "'%q' object has no attribute '%q'" -msgstr "" +msgstr "Objek '%q' tidak memiliki atribut '%q'" #: py/runtime.c msgid "'%q' object is not an iterator" -msgstr "" +msgstr "Objek '%q' bukan merupakan iterator" #: py/objtype.c py/runtime.c msgid "'%q' object is not callable" @@ -150,7 +152,7 @@ msgstr "" #: py/runtime.c msgid "'%q' object is not iterable" -msgstr "" +msgstr "Objek '%q' tidak dapat diulang" #: py/obj.c msgid "'%q' object is not subscriptable" @@ -224,7 +226,7 @@ msgstr "'await' diluar fungsi" #: py/compile.c msgid "'await', 'async for' or 'async with' outside async function" -msgstr "" +msgstr "'await', 'async for' atau 'async with' di luar fungsi async" #: py/compile.c msgid "'break' outside loop" @@ -256,7 +258,7 @@ msgstr "'return' diluar fungsi" #: py/compile.c msgid "'yield from' inside async function" -msgstr "" +msgstr "'yield from' di dalam fungsi async" #: py/compile.c msgid "'yield' outside function" @@ -285,7 +287,7 @@ msgstr "Sebuah channel hardware interrupt sedang digunakan" #: ports/esp32s2/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" -msgstr "" +msgstr "ADC2 sedang digunakan oleh WiFi" #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format @@ -308,13 +310,13 @@ msgstr "Semua perangkat I2C sedang digunakan" #: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c msgid "All PCNT units in use" -msgstr "" +msgstr "Semua unit PCNT sedang digunakan" #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" -msgstr "" +msgstr "Semua RX FIFO sedang digunakan" #: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" @@ -1825,18 +1827,21 @@ msgid "" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" +"Kekuatan mikrokontroler menurun. Pastikan catu daya Anda menyediakan\n" +"daya yang cukup untuk seluruh rangkaian dan tekan reset (setelah " +"mengeluarkan CIRCUITPY).\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" -msgstr "" +msgstr "Sampel bits_per_sampel tidak cocok dengan mixer" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's channel count does not match the mixer's" -msgstr "" +msgstr "Jumlah saluran sampel tidak cocok dengan mixer" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's sample rate does not match the mixer's" -msgstr "" +msgstr "Tingkat sampel dari sampel tidak cocok dengan mixer" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's signedness does not match the mixer's" @@ -1848,15 +1853,15 @@ msgstr "" #: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c msgid "Tile index out of bounds" -msgstr "" +msgstr "Indeks ubin di luar batas" #: shared-bindings/displayio/TileGrid.c msgid "Tile value out of bounds" -msgstr "" +msgstr "Nilai ubin di luar batas" #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" -msgstr "" +msgstr "Lebar ubin harus persis membagi lebar bitmap" #: shared-bindings/alarm/time/TimeAlarm.c msgid "Time is in the past." @@ -1882,15 +1887,16 @@ msgstr "Terlalu banyak channel dalam sampel" #: shared-module/displayio/__init__.c msgid "Too many display busses" -msgstr "" +msgstr "Terlalu banyak tampilan bus" #: shared-module/displayio/__init__.c msgid "Too many displays" -msgstr "" +msgstr "Terlalu banyak tampilan" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Total data to write is larger than outgoing_packet_length" msgstr "" +"Total data yang akan ditulis lebih besar daripada outgoing_packet_length" #: py/obj.c msgid "Traceback (most recent call last):\n" @@ -1898,35 +1904,35 @@ msgstr "" #: shared-bindings/time/__init__.c msgid "Tuple or struct_time argument required" -msgstr "" +msgstr "Diperlukan argumen Tuple atau struct_time" #: ports/stm/common-hal/busio/UART.c msgid "UART Buffer allocation error" -msgstr "" +msgstr "Kesalahan alokasi Buffer UART" #: ports/stm/common-hal/busio/UART.c msgid "UART De-init error" -msgstr "" +msgstr "Kesalahan UART De-init" #: ports/stm/common-hal/busio/UART.c msgid "UART Init Error" -msgstr "" +msgstr "Kesalahan Init UART" #: ports/stm/common-hal/busio/UART.c msgid "UART Re-init error" -msgstr "" +msgstr "Kesalahan Re-init UART" #: ports/stm/common-hal/busio/UART.c msgid "UART write error" -msgstr "" +msgstr "Kesalahan penulisan UART" #: shared-module/usb_hid/Device.c msgid "USB Busy" -msgstr "" +msgstr "USB Sibuk" #: shared-module/usb_hid/Device.c msgid "USB Error" -msgstr "" +msgstr "Kesalahan USB" #: shared-bindings/_bleio/UUID.c msgid "UUID integer value must be 0-0xffff" From c27030ba7cc7d4fd20d9e8eebefe9f011cddd3e4 Mon Sep 17 00:00:00 2001 From: Hugo Dahl Date: Tue, 29 Dec 2020 22:41:37 +0000 Subject: [PATCH 34/82] Translated using Weblate (Spanish) Currently translated at 96.7% (860 of 889 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/es/ --- locale/es.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/locale/es.po b/locale/es.po index 1e3e3be5b9..9bce0559d4 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,15 +8,15 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-12-23 23:04-0500\n" -"PO-Revision-Date: 2020-11-27 18:34+0000\n" -"Last-Translator: Iván Montiel Cardona \n" +"PO-Revision-Date: 2020-12-30 22:25+0000\n" +"Last-Translator: Hugo Dahl \n" "Language-Team: \n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.4-dev\n" +"X-Generator: Weblate 4.4.1-dev\n" #: main.c msgid "" @@ -1236,7 +1236,7 @@ msgstr "Modo de ejecución inválido." #: shared-module/_bleio/Attribute.c msgid "Invalid security_mode" -msgstr "Modo de seguridad no válido" +msgstr "'security_mode' no válido" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid voice" @@ -1276,7 +1276,7 @@ msgstr "Length debe ser un int" #: py/objslice.c msgid "Length must be non-negative" -msgstr "Longitud no deberia ser negativa" +msgstr "Length no deberia ser negativa" #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." From 334207c3655585f23e8905455fa70d8498ff01c3 Mon Sep 17 00:00:00 2001 From: Hugo Dahl Date: Wed, 30 Dec 2020 01:58:12 +0000 Subject: [PATCH 35/82] Translated using Weblate (French) Currently translated at 100.0% (889 of 889 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 333 ++++++++++++++++++++++++++------------------------- 1 file changed, 168 insertions(+), 165 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index b88bf3b8b9..66e8e9186e 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-12-23 23:04-0500\n" -"PO-Revision-Date: 2020-12-29 20:38+0000\n" +"PO-Revision-Date: 2020-12-30 22:25+0000\n" "Last-Translator: Hugo Dahl \n" "Language: fr\n" "MIME-Version: 1.0\n" @@ -82,7 +82,7 @@ msgstr "%q en cours d'utilisation" #: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c #: py/objstrunicode.c msgid "%q index out of range" -msgstr "index %q hors gamme" +msgstr "index %q hors de portée" #: py/obj.c msgid "%q indices must be integers, not %q" @@ -102,7 +102,7 @@ msgstr "%q doit être >= 0" #: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" -msgstr "%q doit être >=1" +msgstr "%q doit être >= 1" #: shared-module/vectorio/Polygon.c msgid "%q must be a tuple of length 2" @@ -122,11 +122,11 @@ msgstr "%q doit être un chiffre entier (int)" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" -msgstr "%q() prend %d paramêtres positionnels mais %d ont été donnés" +msgstr "%q() prend %d paramètres positionnels mais %d ont été donnés" #: py/argcheck.c msgid "'%q' argument required" -msgstr "paramêtre '%q' requis" +msgstr "paramètre '%q' requis" #: py/runtime.c msgid "'%q' object cannot assign attribute '%q'" @@ -167,7 +167,7 @@ msgstr "l'objet '%q' n'est pas souscriptable" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a label" -msgstr "'%s' attend un label" +msgstr "'%s' attend une étiquette" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format @@ -192,12 +192,12 @@ msgstr "'%s' attend une adresse de la forme [a, b]" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects an integer" -msgstr "'%s' attend un entier" +msgstr "'%s' attend un chiffre entier" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects at most r%d" -msgstr "'%s' attend au plus à r%d" +msgstr "'%s' attend au plus r%d" #: py/emitinlinethumb.c #, c-format @@ -207,16 +207,16 @@ msgstr "'%s' attend {r0, r1, ...}" #: py/emitinlinextensa.c #, c-format msgid "'%s' integer %d is not within range %d..%d" -msgstr "'%s' l'entier %d n'est pas dans la gamme %d..%d" +msgstr "'%s' le chiffre entier %d n'est pas dans la portée %d..%d" #: py/emitinlinethumb.c #, c-format msgid "'%s' integer 0x%x does not fit in mask 0x%x" -msgstr "'%s' l'entier 0x%x ne correspond pas au masque 0x%x" +msgstr "'%s' le chiffre entier 0x%x ne correspond pas au masque 0x%x" #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" -msgstr "'=' alignement non autorisé dans la spéc. de format de chaîne" +msgstr "'=' alignement non permis dans la spécification du format de chaîne" #: shared-module/struct/__init__.c msgid "'S' and 'O' are not supported format types" @@ -224,43 +224,43 @@ msgstr "'S' et 'O' ne sont pas des types de format supportés" #: py/compile.c msgid "'align' requires 1 argument" -msgstr "'align' nécessite 1 argument" +msgstr "'align' nécessite 1 paramètre" #: py/compile.c msgid "'await' outside function" -msgstr "'await' en dehors d'une fonction" +msgstr "'await' dehors d'une fonction" #: py/compile.c msgid "'await', 'async for' or 'async with' outside async function" -msgstr "'await', 'async for' ou 'async with' au dehors d'une fonction async" +msgstr "'await', 'async for' ou 'async with' dehors d'une fonction async" #: py/compile.c msgid "'break' outside loop" -msgstr "'break' en dehors d'une boucle" +msgstr "'break' dehors d'une boucle" #: py/compile.c msgid "'continue' outside loop" -msgstr "'continue' en dehors d'une boucle" +msgstr "'continue' dehors d'une boucle" #: py/objgenerator.c msgid "'coroutine' object is not an iterator" -msgstr "L'objet « coroutine » n'est pas un itérateur" +msgstr "L'objet \"coroutine\" n'est pas un itérateur" #: py/compile.c msgid "'data' requires at least 2 arguments" -msgstr "'data' nécessite au moins 2 arguments" +msgstr "'data' nécessite au moins 2 paramètres" #: py/compile.c msgid "'data' requires integer arguments" -msgstr "'data' nécessite des arguments entiers" +msgstr "'data' nécessite des paramètre de chiffres entiers" #: py/compile.c msgid "'label' requires 1 argument" -msgstr "'label' nécessite 1 argument" +msgstr "'label' nécessite 1 paramètre" #: py/compile.c msgid "'return' outside function" -msgstr "'return' en dehors d'une fonction" +msgstr "'return' dehors d'une fonction" #: py/compile.c msgid "'yield from' inside async function" @@ -268,7 +268,7 @@ msgstr "'yield from' dans une fonction async" #: py/compile.c msgid "'yield' outside function" -msgstr "'yield' en dehors d'une fonction" +msgstr "'yield' dehors d'une fonction" #: py/compile.c msgid "*x must be assignment target" @@ -284,12 +284,12 @@ msgstr "0.0 à une puissance complexe" #: py/modbuiltins.c msgid "3-arg pow() not supported" -msgstr "pow() non supporté avec 3 arguments" +msgstr "pow() non supporté avec 3 paramètres" #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "A hardware interrupt channel is already in use" -msgstr "Un canal d'interruptions matérielles est déjà utilisé" +msgstr "Un canal d'interruptions matériel est déjà utilisé" #: ports/esp32s2/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" @@ -302,7 +302,7 @@ msgstr "L'adresse doit être longue de %d octets" #: shared-bindings/_bleio/Address.c msgid "Address type out of range" -msgstr "Type d'adresse hors plage" +msgstr "Type d'adresse hors portée" #: ports/esp32s2/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" @@ -338,11 +338,11 @@ msgstr "Tous les canaux d'événements sont utilisés" #: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "All sync event channels in use" -msgstr "Tous les canaux d'événements de synchro sont utilisés" +msgstr "Tous les canaux d'événements sync (sync event channels) sont utilisés" #: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" -msgstr "Tous les timers pour cette broche sont utilisés" +msgstr "Tous les minuteurs pour cette broche sont utilisés" #: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -358,7 +358,7 @@ msgstr "Tous les timers pour cette broche sont utilisés" #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c msgid "All timers in use" -msgstr "Tous les timers sont utilisés" +msgstr "Tous les minuteurs sont utilisés" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Already advertising." @@ -390,7 +390,8 @@ msgstr "Fonctionnalité AnalogOut non supportée" #: shared-bindings/analogio/AnalogOut.c msgid "AnalogOut is only 16 bits. Value must be less than 65536." msgstr "" -"AnalogOut est seulement 16 bits. Les valeurs doivent être inf. à 65536." +"AnalogOut est seulement 16 bits. Les valeurs doivent être inférieures à " +"65536." #: ports/atmel-samd/common-hal/analogio/AnalogOut.c msgid "AnalogOut not supported on given pin" @@ -407,7 +408,7 @@ msgstr "Le tableau doit contenir des demi-mots (type 'H')" #: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." -msgstr "Les valeurs du tableau doivent être des octets simples 'bytes'." +msgstr "Les valeurs du tableau doivent être des octets singuliers." #: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" @@ -442,12 +443,12 @@ msgstr "" #: ports/esp32s2/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" -msgstr "Baudrate non prise en charge par le périphérique" +msgstr "Baudrate non supporté par le périphérique" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" -msgstr "Inférieur à la fréquence d'images minimale" +msgstr "Au-dessous de la fréquence d'images minimale" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" @@ -456,7 +457,7 @@ msgstr "'bit clock' et 'word select' doivent partager une horloge" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "Bit depth doit être compris entre 1 et 6 inclus, et non %d" +msgstr "Bit depth doit être entre 1 et 6 inclusivement, et non %d" #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." @@ -468,7 +469,7 @@ msgstr "RX et TX requis pour le contrôle de flux" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" -msgstr "Les deux entrées doivent supporter les interruptions matérielles" +msgstr "Les deux broches doivent supporter les interruptions matérielles" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c @@ -590,7 +591,7 @@ msgstr "Impossible de supprimer les valeurs" #: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c #: ports/nrf/common-hal/digitalio/DigitalInOut.c msgid "Cannot get pull while in output mode" -msgstr "Ne peut être tiré ('pull') en mode 'output'" +msgstr "Ne peut être tiré ('pull') en mode sortie ('output')" #: ports/nrf/common-hal/microcontroller/Processor.c msgid "Cannot get temperature" @@ -608,7 +609,7 @@ msgstr "Les 2 canaux de sortie ne peuvent être sur la même broche" #: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." -msgstr "Ne peut tirer sur une broche d'entrée seule." +msgstr "Ne peut tirer ('pull') sur une broche d'entrée ('input') seule." #: shared-module/bitbangio/SPI.c msgid "Cannot read without MISO pin." @@ -631,7 +632,8 @@ msgstr "" #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." -msgstr "Impossible d'affecter une valeur quand la direction est 'input'." +msgstr "" +"Impossible d'affecter une valeur quand la direction est entrentre ('input')." #: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c @@ -648,12 +650,11 @@ msgstr "Pas de transfert sans broches MOSI et MISO." #: extmod/moductypes.c msgid "Cannot unambiguously get sizeof scalar" -msgstr "Impossible d'obtenir la taille du scalaire sans ambigüité" +msgstr "Impossible d'obtenir la taille (sizeof) du scalaire sans ambigüité" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" -msgstr "" -"Impossible de faire varier la fréquence sur une minuterie déjà utilisée" +msgstr "Impossible de faire varier la fréquence sur un minuteur déjà utilisée" #: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." @@ -682,11 +683,11 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "CircuitPython was unable to allocate the heap.\n" -msgstr "CircuitPython n'as pu faire l'allocation de la pile\n" +msgstr "CircuitPython n'as pu faire l'allocation de la pile.\n" #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." -msgstr "Echec de l'init. de la broche d'horloge." +msgstr "Échec de l'initialization de la broche d'horloge." #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" @@ -703,7 +704,7 @@ msgstr "L'entrée 'Column' doit être un digitalio.DigitalInOut" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c #: shared-bindings/displayio/ParallelBus.c msgid "Command must be an int between 0 and 255" -msgstr "La commande doit être un entier entre 0 et 255" +msgstr "La commande doit être un chiffre entier entre 0 et 255" #: shared-bindings/_bleio/Connection.c msgid "" @@ -723,7 +724,7 @@ msgstr "Code brut corrompu" #: ports/cxd56/common-hal/camera/Camera.c msgid "Could not initialize Camera" -msgstr "Impossible d'initialisé la Camera" +msgstr "Impossible d'initialiser Camera" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" @@ -736,19 +737,19 @@ msgstr "Impossible d'initialiser la carte SD" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/esp32s2/common-hal/busio/UART.c msgid "Could not initialize UART" -msgstr "L'UART n'a pu être initialisé" +msgstr "Impossible d'initialiser UART" #: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize channel" -msgstr "Impossible d'initialiser la chaîne" +msgstr "Impossible d'initialiser le canal" #: ports/esp32s2/common-hal/pwmio/PWMOut.c ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not initialize timer" -msgstr "Impossible d'initialiser la minuterie" +msgstr "Impossible d'initialiser le minuteur" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init channel" -msgstr "Impossible de réinitialiser la chaîne" +msgstr "Impossible de réinitialiser le canal" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Could not re-init timer" @@ -781,7 +782,7 @@ msgstr "Impossible d'allouer le décodeur" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate first buffer" -msgstr "Impossible d'allouer le 1er tampon" +msgstr "Impossible d'allouer le premier tampon" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate input buffer" @@ -790,11 +791,11 @@ msgstr "Impossible d'allouer le tampon d'entrée" #: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate second buffer" -msgstr "Impossible d'allouer le 2e tampon" +msgstr "Impossible d'allouer le deuxième tampon" #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." -msgstr "Crash dans le HardFault_Handler." +msgstr "Échec vers le HardFault_Handler." #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Channel Init Error" @@ -815,11 +816,11 @@ msgstr "La broche 'Data 0' doit être aligné sur l'octet" #: shared-module/audiocore/WaveFile.c msgid "Data chunk must follow fmt chunk" -msgstr "Un bloc de données doit suivre un bloc de format" +msgstr "Un bloc de données doit suivre un bloc fmt" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Data too large for advertisement packet" -msgstr "Données trop volumineuses pour un paquet de diffusion" +msgstr "Données trop volumineuses pour un paquet d'avertissement" #: shared-bindings/audiobusio/PDMIn.c msgid "Destination capacity is smaller than destination_length." @@ -846,7 +847,8 @@ msgstr "La rotation d'affichage doit se faire par incréments de 90 degrés" #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." -msgstr "Le mode Drive n'est pas utilisé quand la direction est 'input'." +msgstr "" +"Le mode Drive n'est pas utilisé quand la direction est entrante ('input')." #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" @@ -885,11 +887,11 @@ msgstr "Un 'DigitalInOut' est attendu" #: shared-bindings/_bleio/Characteristic.c msgid "Expected a Service" -msgstr "Attendu un service" +msgstr "Un Service est attendu" #: shared-bindings/_bleio/Adapter.c msgid "Expected a UART" -msgstr "Un 'UART' est attendu" +msgstr "Un UART est attendu" #: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c #: shared-bindings/_bleio/Service.c @@ -898,7 +900,7 @@ msgstr "Un UUID est attendu" #: shared-bindings/_bleio/Adapter.c msgid "Expected an Address" -msgstr "Attendu une adresse" +msgstr "Un Address est attendu" #: shared-bindings/alarm/__init__.c msgid "Expected an alarm" @@ -912,11 +914,11 @@ msgstr "Tuple de longueur %d attendu, obtenu %d" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." msgstr "" -"Les publicités étendues avec réponse d'analyse ne sont pas prises en charge." +"Les avertissement étendues avec analyse de réponse ne sont pas supportées." #: extmod/ulab/code/fft/fft.c msgid "FFT is defined for ndarrays only" -msgstr "La FFT est définie pour les ndarrays uniquement" +msgstr "La FFT est définie uniquement pour les ndarrays" #: extmod/ulab/code/fft/fft.c msgid "FFT is implemented for linear arrays only" @@ -963,7 +965,7 @@ msgstr "Impossible de se connecter : erreur interne" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: timeout" -msgstr "Impossible de se connecter : délai d'expiration" +msgstr "Impossible de se connecter: délai dépassé" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Failed to init wifi" @@ -980,7 +982,7 @@ msgstr "Impossible de libérer mutex, err 0x%04x" #: supervisor/shared/safe_mode.c msgid "Failed to write internal flash." -msgstr "Échec de l'écriture du flash interne." +msgstr "Échec de l'écriture vers flash interne." #: py/moduerrno.c msgid "File exists" @@ -990,7 +992,7 @@ msgstr "Le fichier existe" #: ports/esp32s2/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" -msgstr "Filtre trop complexe" +msgstr "Filtres trop complexe" #: ports/esp32s2/common-hal/dualbank/__init__.c msgid "Firmware image is invalid" @@ -1003,17 +1005,18 @@ msgstr "Format non supporté" #: shared-module/framebufferio/FramebufferDisplay.c #, c-format msgid "Framebuffer requires %d bytes" -msgstr "Le framebuffer nécessite %d octets" +msgstr "FrameBuffer nécessite %d octets" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" msgstr "" -"La fréquence doit correspondre à PWMOut existant à l'aide de cette minuterie" +"La fréquence doit correspondre à PWMOut existant à l'utilisation de ce " +"minuteur" #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" -msgstr "La fonction nécessite un verrou" +msgstr "La fonction nécessite un verrou ('lock')" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c @@ -1037,11 +1040,11 @@ msgstr "Matériel utilisé, essayez d'autres broches" #: shared-bindings/wifi/Radio.c msgid "Hostname must be between 1 and 253 characters" -msgstr "Hostname doit faire entre 1 et 253 caractères" +msgstr "Hostname doit être entre 1 et 253 caractères" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" -msgstr "opération d'E/S sur un fichier fermé" +msgstr "Opération d'E/S sur un fichier fermé" #: ports/stm/common-hal/busio/I2C.c msgid "I2C Init Error" @@ -1058,14 +1061,14 @@ msgstr "IOs 0, 2 & 4 ne supportent pas l'éleveuse interne en mode someil" #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" -msgstr "IV doit être long de %d octets" +msgstr "IV doit être de longueur de %d octets" #: py/persistentcode.c msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" "mpy-update for more info." msgstr "" -"Fichier .mpy incompatible. Merci de mettre à jour tous les fichiers .mpy." +"Fichier .mpy incompatible. Merci de mettre à jour tous les fichiers .mpy. " "Voir http://adafru.it/mpy-update pour plus d'informations." #: shared-bindings/_pew/PewPew.c @@ -1074,7 +1077,7 @@ msgstr "Taille de tampon incorrecte" #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" -msgstr "L'initialisation a échoué par manque de mémoire" +msgstr "Échec d'initialisation par manque de mémoire" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" @@ -1114,7 +1117,7 @@ msgstr "Broche invalide pour '%q'" #: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c #: ports/stm/common-hal/sdioio/SDCard.c msgid "Invalid %q pin selection" -msgstr "Sélection de pin %q invalide" +msgstr "Sélection de broche %q invalide" #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" @@ -1126,7 +1129,7 @@ msgstr "Fichier BMP invalide" #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" -msgstr "BSSID Invalide" +msgstr "BSSID invalide" #: ports/esp32s2/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c @@ -1145,7 +1148,7 @@ msgstr "Broche invalide" #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" -msgstr "Argument invalide" +msgstr "Paramètre invalide" #: shared-module/displayio/Bitmap.c msgid "Invalid bits per value" @@ -1157,12 +1160,12 @@ msgstr "Longueur de tampon invalide" #: shared-bindings/_pixelbuf/PixelBuf.c msgid "Invalid byteorder string" -msgstr "Chaîne d'octets non valide" +msgstr "Chaîne byteorder non valide" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "Période de capture invalide. Gamme valide : 1 à 500" +msgstr "Période de capture invalide. Portée valide : 1 à 500" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid channel count" @@ -1182,7 +1185,7 @@ msgstr "Taille de bloc de formatage invalide" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "Invalid frequency" -msgstr "fréquence non Valide" +msgstr "Fréquence non valide" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid frequency supplied" @@ -1190,7 +1193,7 @@ msgstr "Fréquence invalide fournie" #: supervisor/shared/safe_mode.c msgid "Invalid memory access." -msgstr "Accès mémoire invalide." +msgstr "Accès à la mémoire invalide." #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c msgid "Invalid number of bits" @@ -1232,7 +1235,7 @@ msgstr "Broches invalides" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "Invalid pins for PWMOut" -msgstr "Broches non valides pour PWMOut" +msgstr "Broches invalides pour PWMOut" #: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c #: shared-bindings/displayio/FourWire.c @@ -1241,7 +1244,7 @@ msgstr "Polarité invalide" #: shared-bindings/_bleio/Characteristic.c msgid "Invalid properties" -msgstr "Propriétés non valides" +msgstr "Propriétés invalides" #: shared-bindings/microcontroller/__init__.c msgid "Invalid run mode." @@ -1249,7 +1252,7 @@ msgstr "Mode de lancement invalide." #: shared-module/_bleio/Attribute.c msgid "Invalid security_mode" -msgstr "'mode_security' non valide" +msgstr "'security_mode' invalide" #: shared-bindings/audiomixer/Mixer.c msgid "Invalid voice" @@ -1265,7 +1268,7 @@ msgstr "Fichier WAVE invalide" #: ports/stm/common-hal/busio/UART.c msgid "Invalid word/bit length" -msgstr "Longueur de mot / bit non valide" +msgstr "Longueur de mot / bit invalide" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" @@ -1285,32 +1288,32 @@ msgstr "'Layer' doit être un 'Group' ou une sous-classe 'TileGrid'." #: py/objslice.c msgid "Length must be an int" -msgstr "La longueur doit être un nombre entier" +msgstr "Length doit être un chiffre entier (int)" #: py/objslice.c msgid "Length must be non-negative" -msgstr "La longueur ne doit pas être négative" +msgstr "Length ne doit pas être négatif" #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." -msgstr "Echec de l'init. de la broche MISO." +msgstr "Échec de l'initialization de la broche MISO." #: shared-module/bitbangio/SPI.c msgid "MOSI pin init failed." -msgstr "Echec de l'init. de la broche MOSI." +msgstr "Échec de l'initialization de la broche MOSI." #: shared-module/displayio/Shape.c #, c-format msgid "Maximum x value when mirrored is %d" -msgstr "La valeur max. de x est %d lors d'une opération miroir" +msgstr "La valeur maximale de x est %d lors d'une opération miroir" #: shared-bindings/canio/Message.c msgid "Messages limited to 8 bytes" -msgstr "Message limité a 8 bytes" +msgstr "Messages limités à 8 octets" #: supervisor/shared/safe_mode.c msgid "MicroPython NLR jump failed. Likely memory corruption." -msgstr "Le saut MicroPython NLR a échoué. Altération probable de la mémoire." +msgstr "Échec du saut MicroPython NLR. Corruption de la mémoire probable." #: supervisor/shared/safe_mode.c msgid "MicroPython fatal error." @@ -1406,7 +1409,7 @@ msgstr "Pas de GCLK libre" #: shared-bindings/os/__init__.c msgid "No hardware random available" -msgstr "Pas de source matérielle d'aléa disponible" +msgstr "Aucunes source de valeurs aléatoire matérielle disponible" #: ports/atmel-samd/common-hal/ps2io/Ps2.c msgid "No hardware support on clk pin" @@ -1423,7 +1426,7 @@ msgstr "Aucune clé n'a été spécifiée" #: shared-bindings/time/__init__.c msgid "No long integer support" -msgstr "Pas de support entier long" +msgstr "Pas de support pour chiffre entier long" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more channels available" @@ -1431,7 +1434,7 @@ msgstr "Pas de canal supplémentaire disponible" #: ports/esp32s2/common-hal/pwmio/PWMOut.c msgid "No more timers available" -msgstr "Pas d'horloge supplémentaire disponible" +msgstr "Plus de minuteurs disponibles" #: ports/stm/common-hal/pwmio/PWMOut.c msgid "No more timers available on this pin." @@ -1447,15 +1450,15 @@ msgstr "Pas de pulldown sur la broche ; 1Mohm recommandé" #: py/moduerrno.c msgid "No space left on device" -msgstr "Il n'y a plus d'espace libre sur le périphérique" +msgstr "Aucun espace libre sur le dispositif" #: py/moduerrno.c msgid "No such file/directory" -msgstr "Fichier/dossier introuvable" +msgstr "Fichier/répertoire introuvable" #: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" -msgstr "Pas de minuterie disponible" +msgstr "Aucun minuteur disponible" #: supervisor/shared/safe_mode.c msgid "Nordic Soft Device failure assertion." @@ -1500,18 +1503,18 @@ msgstr "Uniquement 8 ou 16 bit mono avec " #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" -msgstr "Seules les adresses IPv4 sont prises en charge" +msgstr "Seulement les adresses IPv4 sont supportées" #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "Only IPv4 sockets supported" -msgstr "Seules les sockets IPv4 sont prises en charge" +msgstr "Seulement les sockets IPv4 sont supportés" #: shared-module/displayio/OnDiskBitmap.c #, c-format msgid "" "Only Windows format, uncompressed BMP supported: given header size is %d" msgstr "" -"Seul le format BMP Windows, non compressé est supporté : la taille de " +"Seulement le format BMP Windows, non compressé est supporté : la taille de " "l'entête fournie est %d" #: shared-module/displayio/OnDiskBitmap.c @@ -1520,8 +1523,8 @@ msgid "" "Only monochrome, indexed 4bpp or 8bpp, and 16bpp or greater BMPs supported: " "%d bpp given" msgstr "" -"Prise en charge uniquement des monochromes, 4 bpp ou 8 bpp indexés et 16 bpp " -"ou plus : %d bpp fournis" +"Seulement les BMP monochromes, 4 bpp ou 8 bpp, ou 16 bpp et plus sont " +"supportés: %d bpp fournis" #: ports/esp32s2/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." @@ -1533,7 +1536,7 @@ msgstr "Une seule couleur peut être transparente à la fois" #: shared-bindings/ipaddress/__init__.c msgid "Only raw int supported for ip" -msgstr "IP n'accepte que les entiers bruts" +msgstr "IP n'accepte que les chiffres entiers bruts" #: ports/esp32s2/common-hal/socketpool/SocketPool.c msgid "Out of sockets" @@ -1547,8 +1550,8 @@ msgstr "Le sur-échantillonage doit être un multiple de 8." msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" msgstr "" -"La valeur de cycle PWM doit être entre 0 et 65535 inclus (résolution de 16 " -"bits)" +"La valeur de duty_cycle de PWM doit être entre 0 et 65535 inclusivement (" +"résolution de 16 bits)" #: shared-bindings/pwmio/PWMOut.c msgid "" @@ -1561,7 +1564,7 @@ msgstr "" #: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c #: ports/stm/common-hal/displayio/ParallelBus.c msgid "ParallelBus not yet supported" -msgstr "ParallelBus pas encore pris en charge" +msgstr "ParallelBus pas encore supporté" #: py/moduerrno.c msgid "Permission denied" @@ -1574,7 +1577,7 @@ msgstr "Permission refusée" #: ports/nrf/common-hal/analogio/AnalogIn.c #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Pin does not have ADC capabilities" -msgstr "La broche ne peut être utilisée pour l'ADC" +msgstr "La broche 'pin' ne supporte pas les capacitées ADC" #: shared-bindings/adafruit_bus_device/SPIDevice.c #: shared-bindings/digitalio/DigitalInOut.c @@ -1583,11 +1586,11 @@ msgstr "La broche est entrée uniquement" #: ports/atmel-samd/common-hal/countio/Counter.c msgid "Pin must support hardware interrupts" -msgstr "La broche doit prendre en charge les interruptions matérielles" +msgstr "La broche doit supporter les interruptions matérielles" #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin number already reserved by EXTI" -msgstr "Numéro de broche déjà réservé par EXTI" +msgstr "Numéro de broche 'pin' déjà réservé par EXTI" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -1606,15 +1609,15 @@ msgstr "Ainsi que tout autres modules présents sur le système de fichiers\n" #: shared-module/vectorio/Polygon.c msgid "Polygon needs at least 3 points" -msgstr "Polygone a besoin d’au moins 3 points" +msgstr "Polygon a besoin d’au moins 3 points" #: ports/esp32s2/common-hal/pulseio/PulseOut.c msgid "" "Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " "instead" msgstr "" -"Ce portage n'accepte pas de PWM carrier. Précisez plutôt pin, frequency et " -"duty cycle" +"Ce port n'accepte pas de PWM carrier. Précisez plutôt les valeurs pin, " +"frequency et duty_cycle" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c @@ -1624,12 +1627,12 @@ msgid "" "Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " "instead" msgstr "" -"Ce portage n'accepte pas pins ou frequency. Construisez et passez un PWMOut " -"Carrier à la place" +"Ce port n'accepte pas de broches ou de fréquence. Construisez plutôt en " +"passant un PWMOut Carrier" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" -msgstr "Le tampon de préfixe doit être sur le tas" +msgstr "Le tampon de préfixe doit être sur la pile" #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload.\n" @@ -1640,7 +1643,7 @@ msgstr "" #: main.c msgid "Pretending to deep sleep until alarm, CTRL-C or file write.\n" msgstr "" -"Feinte de someil profond jusqu'à l'alarme, Ctrl-C ou écriture au fichier.\n" +"Feinte de someil profond jusqu'à l'alarme, CTRL-C ou écriture au fichier.\n" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." @@ -1648,34 +1651,34 @@ msgstr "Le tirage 'pull' n'est pas utilisé quand la direction est 'output'." #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" -msgstr "Erreur RNG DeInit" +msgstr "Erreur de désinitiation du RNG (RNG DeInit)" #: ports/stm/common-hal/os/__init__.c msgid "RNG Init Error" -msgstr "Erreur d'initialisation RNG" +msgstr "Erreur d'initialisation du RNG (RNG Init)" #: ports/esp32s2/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" -msgstr "Inversion RS485 spécifiée lorsqu'elle n'est pas en mode RS485" +msgstr "Inversion RS485 spécifiée sans être en mode RS485" #: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c #: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c msgid "RTC calibration is not supported on this board" -msgstr "étalonnage de la RTC non supportée sur cette carte" +msgstr "La calibration du RTC non supportée sur cette carte" #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" -msgstr "RTC non supportée sur cette carte" +msgstr "RTC non supporté sur cette carte" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "RTS / CTS / RS485 Pas encore pris en charge sur cet appareil" +msgstr "RTS / CTS / RS485 Pas encore supporté sur cet appareil" #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" -msgstr "Erreur de génération de nombres aléatoires" +msgstr "Erreur de génération de chiffres aléatoires" #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c @@ -1692,7 +1695,7 @@ msgstr "Objet en lecture seule" #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" -msgstr "Rafraîchissez trop tôt" +msgstr "Rafraîchissement trop tôt" #: shared-bindings/canio/RemoteTransmissionRequest.c msgid "RemoteTransmissionRequests limited to 8 bytes" @@ -1700,7 +1703,7 @@ msgstr "RemoteTransmissionRequests limité à 8 octets" #: shared-bindings/aesio/aes.c msgid "Requested AES mode is unsupported" -msgstr "Le mode AES demandé n'est pas pris en charge" +msgstr "Le mode AES demandé n'est pas supporté" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Right channel unsupported" @@ -1712,11 +1715,11 @@ msgstr "L'entrée de ligne 'Row' doit être un digitalio.DigitalInOut" #: main.c msgid "Running in safe mode! " -msgstr "Tourne en mode sécurisé " +msgstr "Exécution en mode sécurisé! " #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" -msgstr "Le format de carte SD CSD n'est pas pris en charge" +msgstr "Le format de carte SD CSD n'est pas supporté" #: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c @@ -1726,12 +1729,12 @@ msgstr "SDA ou SCL a besoin d'une résistance de tirage ('pull up')" #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" -msgstr "SDIO GetCardInfo erreur %d" +msgstr "Erreur de SDIO GetCardInfo %d" #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO Init Error %d" -msgstr "SDIO Init erreur %d" +msgstr "Erreur d'initialisation SDIO %d" #: ports/stm/common-hal/busio/SPI.c msgid "SPI Init Error" @@ -1748,7 +1751,7 @@ msgstr "Le taux d'échantillonage doit être positif" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #, c-format msgid "Sample rate too high. It must be less than %d" -msgstr "Taux d'échantillonage trop élevé. Doit être inf. à %d" +msgstr "Taux d'échantillonage trop élevé. Doit être inférieur à %d" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Scan already in progess. Stop with stop_scan." @@ -1756,11 +1759,11 @@ msgstr "Scan déjà en cours. Arrêtez avec stop_scan." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected CTS pin not valid" -msgstr "Broche CTS sélectionnée non valide" +msgstr "La broche CTS sélectionnée n'est pas valide" #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Selected RTS pin not valid" -msgstr "Broche RTS sélectionnée non valide" +msgstr "La broche RTS sélectionnée n'est pas valide" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1773,7 +1776,7 @@ msgstr "Un contexte niveau serveur ne peut avoir de hostname" #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" -msgstr "Taille non prise en charge" +msgstr "Taille n'est pas supportée" #: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." @@ -1820,7 +1823,7 @@ msgstr "L'entrée du système doit être gnss.SatelliteSystem" #: ports/stm/common-hal/microcontroller/Processor.c msgid "Temperature read timed out" -msgstr "Temporisation de lecture dépassée" +msgstr "Délais de lecture de température dépassée" #: supervisor/shared/safe_mode.c msgid "" @@ -1835,7 +1838,7 @@ msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode.\n" msgstr "" -"Le module `microcontrôleur` a été utilisé pour démarrer en mode sans échec. " +"Le module `microcontroller` a été utilisé pour démarrer en mode sans échec. " "Appuyez sur reset pour quitter le mode sans échec.\n" #: shared-bindings/rgbmatrix/RGBMatrix.c @@ -1849,7 +1852,7 @@ msgid "" "CIRCUITPY).\n" msgstr "" "La puissance du microcontrôleur a baissé. Assurez-vous que votre " -"alimentation\n" +"alimentation fournit\n" "assez de puissance pour tout le circuit et appuyez sur reset (après avoir " "éjecté CIRCUITPY).\n" @@ -1899,12 +1902,12 @@ msgstr "Le délai est trop long : le délai maximal est de %d secondes" msgid "" "Timer was reserved for internal use - declare PWM pins earlier in the program" msgstr "" -"Timer est reservé pour un usage interne - déclarez la broche PWM plus tôt " -"dans le programme" +"Le minuteur est reservé pour un usage interne - déclarez la broche PWM plus " +"tôt dans le programme" #: supervisor/shared/safe_mode.c msgid "To exit, please reset the board without " -msgstr "Pour quitter, redémarrez la carte SVP sans " +msgstr "Pour quitter, SVP redémarrez la carte sans " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." @@ -1925,11 +1928,11 @@ msgstr "" #: py/obj.c msgid "Traceback (most recent call last):\n" -msgstr "Trace (appels les plus récents en dernier) :\n" +msgstr "Traceback (appels les plus récents en dernier) :\n" #: shared-bindings/time/__init__.c msgid "Tuple or struct_time argument required" -msgstr "Argument de type tuple ou struct_time nécessaire" +msgstr "Paramètre de type tuple ou struct_time requis" #: ports/stm/common-hal/busio/UART.c msgid "UART Buffer allocation error" @@ -1961,7 +1964,7 @@ msgstr "Erreur USB" #: shared-bindings/_bleio/UUID.c msgid "UUID integer value must be 0-0xffff" -msgstr "La valeur entière UUID doit être 0-0xffff" +msgstr "La valeur du chiffre entier de UUID doit être 0-0xffff" #: shared-bindings/_bleio/UUID.c msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" @@ -1971,8 +1974,8 @@ msgstr "" #: shared-bindings/_bleio/UUID.c msgid "UUID value is not str, int or byte buffer" msgstr "" -"la valeur de l'UUID n'est pas une chaîne de caractères, un entier ou un " -"tampon d'octets" +"La valeur de l'UUID n'est pas une chaîne de caractères, un chiffre entier ou " +"un tampon d'octets" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -1981,7 +1984,7 @@ msgstr "Impossible d'allouer des tampons pour une conversion signée" #: ports/esp32s2/common-hal/busio/I2C.c msgid "Unable to create lock" -msgstr "Impossible de créer un verrou" +msgstr "Impossible de créer un verrou ('lock')" #: shared-module/displayio/I2CDisplay.c #, c-format @@ -2003,11 +2006,11 @@ msgstr "Impossible de lire les données de la palette de couleurs" #: shared-bindings/nvm/ByteArray.c msgid "Unable to write to nvm." -msgstr "Impossible d'écrire sur la mémoire non-volatile." +msgstr "Écriture impossible vers nvm." #: shared-bindings/alarm/SleepMemory.c msgid "Unable to write to sleep_memory." -msgstr "Impossibilitée d'écriture à sleep_memory." +msgstr "Écriture impossible vers sleep_memory." #: ports/nrf/common-hal/_bleio/UUID.c msgid "Unexpected nrfx uuid type" @@ -2058,7 +2061,7 @@ msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c #: ports/esp32s2/common-hal/busio/UART.c ports/stm/common-hal/busio/I2C.c msgid "Unsupported baudrate" -msgstr "Débit non supporté" +msgstr "Débit en bauds non supporté" #: shared-module/displayio/display_core.c msgid "Unsupported display bus type" @@ -2116,7 +2119,7 @@ msgstr "WatchDogTimer n'est pas en cours d'exécution" #: shared-bindings/watchdog/WatchDogTimer.c msgid "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgstr "" -"WatchDogTimer.mode ne peut pas être changé une fois réglé pour WatchDogMode." +"WatchDogTimer.mode ne peut pas être changé une fois réglé à WatchDogMode." "RESET" #: shared-bindings/watchdog/WatchDogTimer.c @@ -2152,7 +2155,7 @@ msgstr "Réveil par alarme.\n" #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" -msgstr "Écritures non prises en charge sur la caractéristique" +msgstr "Écritures non supporté vers les Characteristic" #: supervisor/shared/safe_mode.c msgid "You are in safe mode: something unanticipated happened.\n" @@ -2218,19 +2221,19 @@ msgstr "l'argument doit être un ndarray" #: py/argcheck.c shared-bindings/_stage/__init__.c #: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c msgid "argument num/types mismatch" -msgstr "argument num/types ne correspond pas" +msgstr "Nombre/types de paramètres ne correspondent pas" #: py/runtime.c msgid "argument should be a '%q' not a '%q'" -msgstr "l'argument devrait être un(e) '%q', pas '%q'" +msgstr "le paramètre devrait être un(e) '%q', pas '%q'" #: extmod/ulab/code/linalg/linalg.c extmod/ulab/code/numerical/numerical.c msgid "arguments must be ndarrays" -msgstr "les arguments doivent être des ndarrays" +msgstr "les paramètres doivent être des ndarrays" #: extmod/ulab/code/ndarray.c msgid "array and index length must be equal" -msgstr "la longueur du tableau et de l'index doit être égale" +msgstr "la longueur du tableau et de l'index doivent être égaux" #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c @@ -2501,11 +2504,11 @@ msgstr "tampon de caractères trop petit" #: py/modbuiltins.c msgid "chr() arg not in range(0x110000)" -msgstr "argument de chr() hors de la gamme range(0x11000)" +msgstr "paramètre de chr() hors les bornes de range(0x11000)" #: py/modbuiltins.c msgid "chr() arg not in range(256)" -msgstr "argument de chr() hors de la gamme range(256)" +msgstr "paramètre de chr() hors les bornes de range(256)" #: shared-module/vectorio/Circle.c msgid "circle can only be registered in one parent" @@ -2618,7 +2621,7 @@ msgstr "l'argument diff doit être un ndarray" #: extmod/ulab/code/numerical/numerical.c msgid "differentiation order out of range" -msgstr "differentiation order hors plage" +msgstr "differentiation order hors de portée" #: py/modmath.c py/objfloat.c py/objint_longlong.c py/objint_mpz.c py/runtime.c #: shared-bindings/math/__init__.c @@ -2805,7 +2808,7 @@ msgstr "La fonction n'est définie que pour les ndarrays" #: py/argcheck.c #, c-format msgid "function missing %d required positional arguments" -msgstr "il manque %d arguments obligatoires à la fonction" +msgstr "il manque %d argument(s) positionnel(s) requis pour la fonction" #: py/bc.c msgid "function missing keyword-only argument" @@ -2872,7 +2875,7 @@ msgstr "l'index est hors limites" #: extmod/ulab/code/numerical/numerical.c #: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c msgid "index out of range" -msgstr "index hors gamme" +msgstr "index est hors bornes" #: py/obj.c msgid "indices must be integers" @@ -2945,7 +2948,7 @@ msgstr "l'entrée doit être une matrice carrée" #: extmod/ulab/code/numerical/numerical.c msgid "input must be tuple, list, range, or ndarray" -msgstr "l'entrée doit être tuple, list, range ou ndarray" +msgstr "l'entrée 'input' doit être tuple, list, range ou ndarray" #: extmod/ulab/code/poly/poly.c msgid "input vectors must be of equal length" @@ -2970,7 +2973,7 @@ msgstr "interp est défini pour les tableaux 1D de longueur égale" #: shared-bindings/_bleio/Adapter.c #, c-format msgid "interval must be in range %s-%s" -msgstr "l'intervalle doit être dans la plage %s-%s" +msgstr "interval doit être dans la portée %s-%s" #: lib/netutils/netutils.c msgid "invalid arguments" @@ -3067,11 +3070,11 @@ msgstr "label '%q' non supporté" #: py/compile.c msgid "label redefined" -msgstr "label redéfini" +msgstr "étiquette redéfinie" #: py/stream.c msgid "length argument not allowed for this type" -msgstr "argument 'length' non-permis pour ce type" +msgstr "paramètre 'length' non-permis pour ce type" #: shared-bindings/audiomixer/MixerVoice.c msgid "level must be between 0 and 1" @@ -3194,7 +3197,7 @@ msgstr "nom non défini" #: py/compile.c msgid "name reused for argument" -msgstr "nom réutilisé comme argument" +msgstr "nom réutilisé comme paramètre" #: py/emitnative.c msgid "native yield" @@ -3559,7 +3562,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" -msgstr "taux d'échantillonage hors gamme" +msgstr "taux d'échantillonage hors bornes" #: py/modmicropython.c msgid "schedule stack full" @@ -3688,7 +3691,7 @@ msgstr "erreur de syntaxe dans le descripteur d'uctypes" #: shared-bindings/touchio/TouchIn.c msgid "threshold must be in the range 0-65536" -msgstr "le seuil doit être dans la gamme 0-65536" +msgstr "le seuil doit être dans la portée 0-65536" #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" @@ -3721,7 +3724,7 @@ msgstr "Délai d’expiration dépassé en attendant une carte v2" #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" -msgstr "'timestamp' hors bornes pour 'time_t' de la plateforme" +msgstr "timestamp hors bornes pour 'time_t' de la plateforme" #: extmod/ulab/code/ndarray.c msgid "tobytes can be invoked for dense arrays only" @@ -3750,7 +3753,7 @@ msgstr "niveau du déclencheur doit être 0 ou 1" #: extmod/ulab/code/linalg/linalg.c msgid "tuple index out of range" -msgstr "index du tuple hors gamme" +msgstr "index du tuple hors de portée" #: py/obj.c msgid "tuple/list has wrong length" From c056ac3499873bcecf33e89bc51d9d0c397057e3 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Wed, 30 Dec 2020 23:25:22 +0100 Subject: [PATCH 36/82] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 11 ++++++++++- locale/cs.po | 11 ++++++++++- locale/de_DE.po | 11 ++++++++++- locale/el.po | 11 ++++++++++- locale/es.po | 11 ++++++++++- locale/fil.po | 11 ++++++++++- locale/fr.po | 15 ++++++++++++--- locale/hi.po | 11 ++++++++++- locale/it_IT.po | 11 ++++++++++- locale/ja.po | 11 ++++++++++- locale/ko.po | 11 ++++++++++- locale/nl.po | 11 ++++++++++- locale/pl.po | 11 ++++++++++- locale/pt_BR.po | 11 ++++++++++- locale/sv.po | 11 ++++++++++- locale/zh_Latn_pinyin.po | 11 ++++++++++- 16 files changed, 162 insertions(+), 18 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 47c3310dbe..ca26f01bd1 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-23 23:04-0500\n" +"POT-Creation-Date: 2020-12-22 22:54+0530\n" "PO-Revision-Date: 2020-12-30 22:25+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -1190,6 +1190,7 @@ msgstr "Fase tidak valid" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c #: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" @@ -1514,6 +1515,10 @@ msgstr "" msgid "Only one alarm.time alarm can be set." msgstr "" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "Only one alarm.touch alarm can be set." +msgstr "" + #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" msgstr "" @@ -1898,6 +1903,10 @@ msgid "Total data to write is larger than outgoing_packet_length" msgstr "" "Total data yang akan ditulis lebih besar daripada outgoing_packet_length" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "TouchAlarm not available in light sleep" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 7ceb85db72..88380fbea6 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-23 23:04-0500\n" +"POT-Creation-Date: 2020-12-22 22:54+0530\n" "PO-Revision-Date: 2020-12-04 18:33+0000\n" "Last-Translator: vkuthan \n" "Language-Team: LANGUAGE \n" @@ -1172,6 +1172,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c #: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" @@ -1490,6 +1491,10 @@ msgstr "" msgid "Only one alarm.time alarm can be set." msgstr "" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "Only one alarm.touch alarm can be set." +msgstr "" + #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" msgstr "" @@ -1860,6 +1865,10 @@ msgstr "" msgid "Total data to write is larger than outgoing_packet_length" msgstr "" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "TouchAlarm not available in light sleep" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index e481e52c1f..39e1071f90 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-23 23:04-0500\n" +"POT-Creation-Date: 2020-12-22 22:54+0530\n" "PO-Revision-Date: 2020-11-26 03:11+0000\n" "Last-Translator: Daniel Bravo Darriba \n" "Language: de_DE\n" @@ -1187,6 +1187,7 @@ msgstr "Ungültige Phase" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c #: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" @@ -1513,6 +1514,10 @@ msgstr "" msgid "Only one alarm.time alarm can be set." msgstr "" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "Only one alarm.touch alarm can be set." +msgstr "" + #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" msgstr "" @@ -1900,6 +1905,10 @@ msgstr "" "Die Gesamtzahl der zu schreibenden Daten ist größer als " "outgoing_packet_length" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "TouchAlarm not available in light sleep" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Zurückverfolgung (jüngste Aufforderung zuletzt):\n" diff --git a/locale/el.po b/locale/el.po index 80aebe497c..21a0942a6b 100644 --- a/locale/el.po +++ b/locale/el.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-23 23:04-0500\n" +"POT-Creation-Date: 2020-12-22 22:54+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -1169,6 +1169,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c #: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" @@ -1487,6 +1488,10 @@ msgstr "" msgid "Only one alarm.time alarm can be set." msgstr "" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "Only one alarm.touch alarm can be set." +msgstr "" + #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" msgstr "" @@ -1857,6 +1862,10 @@ msgstr "" msgid "Total data to write is larger than outgoing_packet_length" msgstr "" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "TouchAlarm not available in light sleep" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "" diff --git a/locale/es.po b/locale/es.po index 9bce0559d4..bac7d28405 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-23 23:04-0500\n" +"POT-Creation-Date: 2020-12-22 22:54+0530\n" "PO-Revision-Date: 2020-12-30 22:25+0000\n" "Last-Translator: Hugo Dahl \n" "Language-Team: \n" @@ -1190,6 +1190,7 @@ msgstr "Fase inválida" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c #: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" @@ -1514,6 +1515,10 @@ msgstr "" msgid "Only one alarm.time alarm can be set." msgstr "" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "Only one alarm.touch alarm can be set." +msgstr "" + #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" msgstr "Solo un color puede ser transparente a la vez" @@ -1907,6 +1912,10 @@ msgid "Total data to write is larger than outgoing_packet_length" msgstr "" "Los datos totales a escribir son más grandes que outgoing_packet_length" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "TouchAlarm not available in light sleep" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Traceback (ultima llamada reciente):\n" diff --git a/locale/fil.po b/locale/fil.po index 09dcfad660..86386cf1f3 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-23 23:04-0500\n" +"POT-Creation-Date: 2020-12-22 22:54+0530\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -1184,6 +1184,7 @@ msgstr "Mali ang phase" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c #: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" @@ -1505,6 +1506,10 @@ msgstr "" msgid "Only one alarm.time alarm can be set." msgstr "" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "Only one alarm.touch alarm can be set." +msgstr "" + #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" msgstr "" @@ -1877,6 +1882,10 @@ msgstr "" msgid "Total data to write is larger than outgoing_packet_length" msgstr "" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "TouchAlarm not available in light sleep" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Traceback (pinakahuling huling tawag): \n" diff --git a/locale/fr.po b/locale/fr.po index 66e8e9186e..7903b567e0 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-23 23:04-0500\n" +"POT-Creation-Date: 2020-12-22 22:54+0530\n" "PO-Revision-Date: 2020-12-30 22:25+0000\n" "Last-Translator: Hugo Dahl \n" "Language: fr\n" @@ -1206,6 +1206,7 @@ msgstr "Phase invalide" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c #: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" @@ -1530,6 +1531,10 @@ msgstr "" msgid "Only one alarm.time alarm can be set." msgstr "Seulement une alarme alarm.time peut être réglée." +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "Only one alarm.touch alarm can be set." +msgstr "" + #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" msgstr "Une seule couleur peut être transparente à la fois" @@ -1550,8 +1555,8 @@ msgstr "Le sur-échantillonage doit être un multiple de 8." msgid "" "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" msgstr "" -"La valeur de duty_cycle de PWM doit être entre 0 et 65535 inclusivement (" -"résolution de 16 bits)" +"La valeur de duty_cycle de PWM doit être entre 0 et 65535 inclusivement " +"(résolution de 16 bits)" #: shared-bindings/pwmio/PWMOut.c msgid "" @@ -1926,6 +1931,10 @@ msgid "Total data to write is larger than outgoing_packet_length" msgstr "" "Le nombre total de données à écrire est supérieur à outgoing_packet_length" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "TouchAlarm not available in light sleep" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Traceback (appels les plus récents en dernier) :\n" diff --git a/locale/hi.po b/locale/hi.po index 5a75cf4017..34d0238f6b 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-23 23:04-0500\n" +"POT-Creation-Date: 2020-12-22 22:54+0530\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -1169,6 +1169,7 @@ msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c #: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" @@ -1487,6 +1488,10 @@ msgstr "" msgid "Only one alarm.time alarm can be set." msgstr "" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "Only one alarm.touch alarm can be set." +msgstr "" + #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" msgstr "" @@ -1857,6 +1862,10 @@ msgstr "" msgid "Total data to write is larger than outgoing_packet_length" msgstr "" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "TouchAlarm not available in light sleep" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index fe742d588c..dbefb87a8b 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-23 23:04-0500\n" +"POT-Creation-Date: 2020-12-22 22:54+0530\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -1186,6 +1186,7 @@ msgstr "Fase non valida" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c #: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" @@ -1510,6 +1511,10 @@ msgstr "" msgid "Only one alarm.time alarm can be set." msgstr "" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "Only one alarm.touch alarm can be set." +msgstr "" + #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" msgstr "" @@ -1889,6 +1894,10 @@ msgstr "Troppi schermi" msgid "Total data to write is larger than outgoing_packet_length" msgstr "" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "TouchAlarm not available in light sleep" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Traceback (chiamata più recente per ultima):\n" diff --git a/locale/ja.po b/locale/ja.po index dbab57219c..6ccdc158e0 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-23 23:04-0500\n" +"POT-Creation-Date: 2020-12-22 22:54+0530\n" "PO-Revision-Date: 2020-11-27 18:34+0000\n" "Last-Translator: sporeball \n" "Language-Team: none\n" @@ -1182,6 +1182,7 @@ msgstr "不正なphase" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c #: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" @@ -1502,6 +1503,10 @@ msgstr "" msgid "Only one alarm.time alarm can be set." msgstr "" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "Only one alarm.touch alarm can be set." +msgstr "" + #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" msgstr "" @@ -1879,6 +1884,10 @@ msgstr "" msgid "Total data to write is larger than outgoing_packet_length" msgstr "" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "TouchAlarm not available in light sleep" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "トレースバック(最新の呼び出しが末尾):\n" diff --git a/locale/ko.po b/locale/ko.po index e0006f000e..c2272af7b0 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-23 23:04-0500\n" +"POT-Creation-Date: 2020-12-22 22:54+0530\n" "PO-Revision-Date: 2020-10-05 12:12+0000\n" "Last-Translator: Michal Čihař \n" "Language-Team: LANGUAGE \n" @@ -1172,6 +1172,7 @@ msgstr "단계가 잘못되었습니다" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c #: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" @@ -1490,6 +1491,10 @@ msgstr "" msgid "Only one alarm.time alarm can be set." msgstr "" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "Only one alarm.touch alarm can be set." +msgstr "" + #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" msgstr "" @@ -1860,6 +1865,10 @@ msgstr "" msgid "Total data to write is larger than outgoing_packet_length" msgstr "" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "TouchAlarm not available in light sleep" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 57bd8cd0b3..73aeade01c 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-23 23:04-0500\n" +"POT-Creation-Date: 2020-12-22 22:54+0530\n" "PO-Revision-Date: 2020-12-23 20:14+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" @@ -1183,6 +1183,7 @@ msgstr "Ongeldige fase" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c #: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" @@ -1507,6 +1508,10 @@ msgstr "" msgid "Only one alarm.time alarm can be set." msgstr "Slechts één alarm.time alarm kan worden ingesteld." +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "Only one alarm.touch alarm can be set." +msgstr "" + #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" msgstr "Er kan maar één kleur per keer transparant zijn" @@ -1899,6 +1904,10 @@ msgstr "Teveel beeldschermen" msgid "Total data to write is larger than outgoing_packet_length" msgstr "Totale data om te schrijven is groter dan outgoing_packet_length" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "TouchAlarm not available in light sleep" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Traceback (meest recente call laatst):\n" diff --git a/locale/pl.po b/locale/pl.po index fe969af3d1..deefb878b8 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-23 23:04-0500\n" +"POT-Creation-Date: 2020-12-22 22:54+0530\n" "PO-Revision-Date: 2020-12-02 20:29+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" @@ -1182,6 +1182,7 @@ msgstr "Zła faza" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c #: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" @@ -1501,6 +1502,10 @@ msgstr "" msgid "Only one alarm.time alarm can be set." msgstr "" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "Only one alarm.touch alarm can be set." +msgstr "" + #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" msgstr "W danym momencie przezroczysty może być tylko jeden kolor" @@ -1871,6 +1876,10 @@ msgstr "Zbyt wiele wyświetlaczy" msgid "Total data to write is larger than outgoing_packet_length" msgstr "" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "TouchAlarm not available in light sleep" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Ślad wyjątku (najnowsze wywołanie na końcu):\n" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 1d8819a699..dabcd98d12 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-23 23:04-0500\n" +"POT-Creation-Date: 2020-12-22 22:54+0530\n" "PO-Revision-Date: 2020-12-29 16:08+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -1199,6 +1199,7 @@ msgstr "Fase Inválida" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c #: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" @@ -1522,6 +1523,10 @@ msgstr "" msgid "Only one alarm.time alarm can be set." msgstr "Apenas um alarme alarm.time pode ser definido." +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "Only one alarm.touch alarm can be set." +msgstr "" + #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" msgstr "Apenas uma cor pode ser transparente de cada vez" @@ -1922,6 +1927,10 @@ msgid "Total data to write is larger than outgoing_packet_length" msgstr "" "O total dos dados que serão gravados é maior que outgoing_packet_length" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "TouchAlarm not available in light sleep" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Traceback (a última chamada mais recente):\n" diff --git a/locale/sv.po b/locale/sv.po index 0d17fc539c..71b1c3a866 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-23 23:04-0500\n" +"POT-Creation-Date: 2020-12-22 22:54+0530\n" "PO-Revision-Date: 2020-12-28 17:59+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -1182,6 +1182,7 @@ msgstr "Ogiltig fas" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c #: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" @@ -1506,6 +1507,10 @@ msgstr "" msgid "Only one alarm.time alarm can be set." msgstr "Endast ett alarm.time kan ställas in." +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "Only one alarm.touch alarm can be set." +msgstr "" + #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" msgstr "Bara en färg kan vara genomskinlig i taget" @@ -1897,6 +1902,10 @@ msgstr "För många displayer" msgid "Total data to write is larger than outgoing_packet_length" msgstr "Total data som ska skrivas är större än outgoing_packet_length" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "TouchAlarm not available in light sleep" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Traceback (senaste anrop):\n" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index ff1d89a313..b372b067a4 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-23 23:04-0500\n" +"POT-Creation-Date: 2020-12-22 22:54+0530\n" "PO-Revision-Date: 2020-11-19 01:28+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -1180,6 +1180,7 @@ msgstr "Jiēduàn wúxiào" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c #: ports/esp32s2/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c #: shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid pin" @@ -1503,6 +1504,10 @@ msgstr "" msgid "Only one alarm.time alarm can be set." msgstr "" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "Only one alarm.touch alarm can be set." +msgstr "" + #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" msgstr "Yīcì zhǐ néng yǒuyī zhǒng yánsè shì tòumíng de" @@ -1887,6 +1892,10 @@ msgstr "Xiǎnshì tài duō" msgid "Total data to write is larger than outgoing_packet_length" msgstr "Yào xiě rù de zǒng shùjù dàyú outgoing_packet_length" +#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +msgid "TouchAlarm not available in light sleep" +msgstr "" + #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Traceback (Zuìjìn yīcì dǎ diànhuà):\n" From 43f93b097fd39f4cba10a5ac0736f2fc6b5db61c Mon Sep 17 00:00:00 2001 From: askpatricw <4002194+askpatrickw@users.noreply.github.com> Date: Thu, 31 Dec 2020 17:50:41 -0800 Subject: [PATCH 37/82] release and pre-release FeatherS2 NSync --- .../boards/unexpectedmaker_feathers2/mpconfigboard.h | 1 - ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c | 1 + .../mpconfigboard.h | 10 ++++++++++ .../boards/unexpectedmaker_feathers2_prerelease/pins.c | 3 ++- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h index b68a31b9e5..e100ac118e 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h @@ -30,7 +30,6 @@ #define MICROPY_HW_MCU_NAME "ESP32S2" #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) - #define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") #define AUTORESET_DELAY_MS 500 diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c b/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c index c294fb9d3c..191ef5ffde 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c @@ -12,6 +12,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO13) }, { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, { MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) }, { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO12) }, diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h index 93d901becb..d550ff64fe 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h @@ -36,3 +36,13 @@ // #define MICROPY_HW_APA102_MOSI (&pin_GPIO40) // #define MICROPY_HW_APA102_SCK (&pin_GPIO45) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO38) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO33) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO36) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO35) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO37) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO44) +#define DEFAULT_UART_BUS_TX (&pin_GPIO43) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c index a1036f8506..d4179a2b85 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c @@ -26,7 +26,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) }, { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO5) }, - { MP_ROM_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO36) }, @@ -86,6 +86,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_GPIO40) }, // MTDO { MP_ROM_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_GPIO45) }, + { MP_ROM_QSTR(MP_QSTR_LDO2), MP_ROM_PTR(&pin_GPIO21) }, { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, From 220501e159998ee873bb93fba87f654bc378f4ef Mon Sep 17 00:00:00 2001 From: askpatricw <4002194+askpatrickw@users.noreply.github.com> Date: Thu, 31 Dec 2020 18:02:44 -0800 Subject: [PATCH 38/82] dupe LED entries --- ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c | 1 - ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c | 1 - 2 files changed, 2 deletions(-) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c b/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c index 191ef5ffde..439726f5ab 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c @@ -91,7 +91,6 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) }, - { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, { MP_ROM_QSTR(MP_QSTR_AMB), MP_ROM_PTR(&pin_GPIO4) }, diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c index d4179a2b85..977ec845da 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c @@ -91,7 +91,6 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) }, - { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, { MP_ROM_QSTR(MP_QSTR_AMB), MP_ROM_PTR(&pin_GPIO4) }, From 80e5899b306692e4aa7ff49b9e8d0b36a9d280bf Mon Sep 17 00:00:00 2001 From: Hugo Dahl Date: Thu, 31 Dec 2020 04:03:13 +0000 Subject: [PATCH 39/82] Translated using Weblate (French) Currently translated at 100.0% (891 of 891 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 7903b567e0..c25da7888f 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-12-22 22:54+0530\n" -"PO-Revision-Date: 2020-12-30 22:25+0000\n" +"PO-Revision-Date: 2021-01-01 04:29+0000\n" "Last-Translator: Hugo Dahl \n" "Language: fr\n" "MIME-Version: 1.0\n" @@ -1533,7 +1533,7 @@ msgstr "Seulement une alarme alarm.time peut être réglée." #: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c msgid "Only one alarm.touch alarm can be set." -msgstr "" +msgstr "Seulement une alarme alarm.touch peut être réglée." #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" @@ -1933,7 +1933,7 @@ msgstr "" #: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c msgid "TouchAlarm not available in light sleep" -msgstr "" +msgstr "TouchAlarm n'est pas disponible en mode someil léger" #: py/obj.c msgid "Traceback (most recent call last):\n" @@ -3818,11 +3818,11 @@ msgstr "indentation inattendue" #: py/bc.c msgid "unexpected keyword argument" -msgstr "argument nommé inattendu" +msgstr "paramètre nommé inattendu" #: py/bc.c py/objnamedtuple.c msgid "unexpected keyword argument '%q'" -msgstr "argument nommé '%q' inattendu" +msgstr "paramètre nommé '%q' inattendu" #: py/lexer.c msgid "unicode name escapes" @@ -3865,12 +3865,12 @@ msgstr "type %q non pris on charge" #: py/emitinlinethumb.c #, c-format msgid "unsupported Thumb instruction '%s' with %d arguments" -msgstr "instruction Thumb '%s' non supportée avec %d arguments" +msgstr "instruction Thumb '%s' non supportée avec %d paramètres" #: py/emitinlinextensa.c #, c-format msgid "unsupported Xtensa instruction '%s' with %d arguments" -msgstr "instruction Xtensa '%s' non supportée avec %d arguments" +msgstr "instruction Xtensa '%s' non supportée avec %d paramètres" #: py/objstr.c #, c-format @@ -3908,7 +3908,7 @@ msgstr "conflit au réveil" #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "watchdog not initialized" -msgstr "chien de garde non initialisé" +msgstr "chien de garde (watchdog) non initialisé" #: shared-bindings/watchdog/WatchDogTimer.c msgid "watchdog timeout must be greater than 0" @@ -3920,7 +3920,7 @@ msgstr "width doit être plus grand que zero" #: shared-bindings/_bleio/Adapter.c msgid "window must be <= interval" -msgstr "la fenêtre doit être <= intervalle" +msgstr "la fenêtre (window) doit être <= intervalle (interval)" #: extmod/ulab/code/numerical/numerical.c msgid "wrong axis index" From 71cc9b60ea9a0bd4232586cecd7f18734d5b7548 Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Thu, 31 Dec 2020 03:58:34 +0000 Subject: [PATCH 40/82] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (891 of 891 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index dabcd98d12..73922b3d35 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-12-22 22:54+0530\n" -"PO-Revision-Date: 2020-12-29 16:08+0000\n" +"PO-Revision-Date: 2021-01-01 04:29+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -1525,7 +1525,7 @@ msgstr "Apenas um alarme alarm.time pode ser definido." #: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c msgid "Only one alarm.touch alarm can be set." -msgstr "" +msgstr "Apenas um alarme alarm.touch pode ser definido." #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" @@ -1929,7 +1929,7 @@ msgstr "" #: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c msgid "TouchAlarm not available in light sleep" -msgstr "" +msgstr "O TouchAlarm não está disponívle no modo light sleep" #: py/obj.c msgid "Traceback (most recent call last):\n" From df4c028d29e5a48180975d17471db81dc4717442 Mon Sep 17 00:00:00 2001 From: "@brrzap" Date: Fri, 1 Jan 2021 19:49:20 -0500 Subject: [PATCH 41/82] _pixelbuf: error check in brightness setter (fix #3753) --- shared-bindings/_pixelbuf/PixelBuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/_pixelbuf/PixelBuf.c b/shared-bindings/_pixelbuf/PixelBuf.c index 88e8aa8010..a4b5b5b1b3 100644 --- a/shared-bindings/_pixelbuf/PixelBuf.c +++ b/shared-bindings/_pixelbuf/PixelBuf.c @@ -185,7 +185,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(pixelbuf_pixelbuf_get_brightness_obj, pixelbuf_pixelbu STATIC mp_obj_t pixelbuf_pixelbuf_obj_set_brightness(mp_obj_t self_in, mp_obj_t value) { - mp_float_t brightness = mp_obj_float_get(value); + mp_float_t brightness = mp_obj_get_float(value); if (brightness > 1) { brightness = 1; } else if (brightness < 0) { From 2ce07209dff9f509bd5f401b8eb3a1639667e680 Mon Sep 17 00:00:00 2001 From: askpatricw <4002194+askpatrickw@users.noreply.github.com> Date: Fri, 1 Jan 2021 17:23:11 -0800 Subject: [PATCH 42/82] changes based on UM's input --- ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c | 3 --- .../esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c | 3 --- 2 files changed, 6 deletions(-) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c b/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c index 439726f5ab..7dd8521530 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c @@ -86,12 +86,9 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_GPIO40) }, // MTDO { MP_ROM_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_GPIO45) }, - { MP_ROM_QSTR(MP_QSTR_LDO2), MP_ROM_PTR(&pin_GPIO21) }, { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, - { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) }, - { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, { MP_ROM_QSTR(MP_QSTR_AMB), MP_ROM_PTR(&pin_GPIO4) }, diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c index 977ec845da..4fb71a85df 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c @@ -86,12 +86,9 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_GPIO40) }, // MTDO { MP_ROM_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_GPIO45) }, - { MP_ROM_QSTR(MP_QSTR_LDO2), MP_ROM_PTR(&pin_GPIO21) }, { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, - { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) }, - { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, { MP_ROM_QSTR(MP_QSTR_AMB), MP_ROM_PTR(&pin_GPIO4) }, From 9d5587fb084c3eb8ebf4f6fdd20c2b88607ad261 Mon Sep 17 00:00:00 2001 From: oon arfiandwi Date: Sat, 2 Jan 2021 04:36:18 +0000 Subject: [PATCH 43/82] Translated using Weblate (Indonesian) Currently translated at 47.2% (421 of 891 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/id/ --- locale/ID.po | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index ca26f01bd1..5f80f1f140 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-12-22 22:54+0530\n" -"PO-Revision-Date: 2020-12-30 22:25+0000\n" +"PO-Revision-Date: 2021-01-03 05:29+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" "Language: ID\n" @@ -1850,11 +1850,11 @@ msgstr "Tingkat sampel dari sampel tidak cocok dengan mixer" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's signedness does not match the mixer's" -msgstr "" +msgstr "signedness dari sampel tidak cocok dengan mixer" #: shared-bindings/displayio/TileGrid.c msgid "Tile height must exactly divide bitmap height" -msgstr "" +msgstr "Tinggi tile harus persis membagi tinggi bitmap" #: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c msgid "Tile index out of bounds" @@ -1909,7 +1909,7 @@ msgstr "" #: py/obj.c msgid "Traceback (most recent call last):\n" -msgstr "" +msgstr "Traceback (bagian terakhir dari panggilan terkini):\n" #: shared-bindings/time/__init__.c msgid "Tuple or struct_time argument required" @@ -1945,15 +1945,15 @@ msgstr "Kesalahan USB" #: shared-bindings/_bleio/UUID.c msgid "UUID integer value must be 0-0xffff" -msgstr "" +msgstr "Nilai integer UUID harus 0-0xffff" #: shared-bindings/_bleio/UUID.c msgid "UUID string not 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" -msgstr "" +msgstr "String UUID bukan 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'" #: shared-bindings/_bleio/UUID.c msgid "UUID value is not str, int or byte buffer" -msgstr "" +msgstr "Nilai UUID bukan str, int atau byte buffer" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -1967,7 +1967,7 @@ msgstr "" #: shared-module/displayio/I2CDisplay.c #, c-format msgid "Unable to find I2C Display at %x" -msgstr "" +msgstr "Tidak dapat menemukan Tampilan I2C di %x" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -1976,15 +1976,15 @@ msgstr "Tidak dapat menemukan GCLK yang kosong" #: py/parse.c msgid "Unable to init parser" -msgstr "" +msgstr "Tidak dapat memulai parser" #: shared-module/displayio/OnDiskBitmap.c msgid "Unable to read color palette data" -msgstr "" +msgstr "Tidak dapat membaca data palet warna" #: shared-bindings/nvm/ByteArray.c msgid "Unable to write to nvm." -msgstr "" +msgstr "Tidak dapat menulis ke nvm." #: shared-bindings/alarm/SleepMemory.c msgid "Unable to write to sleep_memory." @@ -1992,7 +1992,7 @@ msgstr "" #: ports/nrf/common-hal/_bleio/UUID.c msgid "Unexpected nrfx uuid type" -msgstr "" +msgstr "Tipe urf nrfx tak sesuai" #: ports/esp32s2/common-hal/socketpool/Socket.c #, c-format From 9286f268318e316e31d836447371d07ae0e70c5c Mon Sep 17 00:00:00 2001 From: Benjamin Shockley Date: Sun, 3 Jan 2021 10:42:58 -0600 Subject: [PATCH 44/82] Added CP Dotstart Lib to Build Added the CircuitPython dotstar library to the Mini SAM M4 build so users do not have to include the library to utilize the built-in APA102 LED. --- ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk b/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk index 393adf8397..321ee5f476 100644 --- a/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk @@ -15,3 +15,6 @@ LONGINT_IMPL = MPZ CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANG_APA102 = 1 + +#Include these Python libraries in firmware. +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar From 10f178d1621a31962b6f818bf73c9b00bc8b9ccd Mon Sep 17 00:00:00 2001 From: Seon Rozenblum Date: Mon, 4 Jan 2021 10:06:32 +1100 Subject: [PATCH 45/82] Fixed incorrect pin assignment on header IO13 is for blue LED IO14 is the correct pin header between IO18 and IO12 The silk is wrong (shows IO13), but hardware is correct as IO14, but IO14 was not included in pins.c Silk will be updated on next PCB production run --- .../boards/unexpectedmaker_feathers2/pins.c | 21 ++++++++++--------- .../pins.c | 21 ++++++++++--------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c b/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c index 7dd8521530..bef2001bac 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c @@ -9,10 +9,9 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO18) }, { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO18) }, - { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO13) }, - { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO13) }, - { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO14) }, { MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) }, { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO12) }, @@ -83,14 +82,16 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO11) }, { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO11) }, - { MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_GPIO40) }, // MTDO - { MP_ROM_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_GPIO45) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, // Blue LED - { MP_ROM_QSTR(MP_QSTR_LDO2), MP_ROM_PTR(&pin_GPIO21) }, - { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_GPIO40) }, // APA102 + { MP_ROM_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_GPIO45) }, // APA102 - { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, - { MP_ROM_QSTR(MP_QSTR_AMB), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_LDO2), MP_ROM_PTR(&pin_GPIO21) }, // Second LDO Enable control + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, // Second LDO Enable control + + { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, // Ambient Light Sensor + { MP_ROM_QSTR(MP_QSTR_AMB), MP_ROM_PTR(&pin_GPIO4) }, // Ambient Light Sensor { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c index 4fb71a85df..57ac27aeb9 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c @@ -9,10 +9,9 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO18) }, { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO18) }, - { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO13) }, - { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO13) }, - { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO14) }, { MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) }, { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO12) }, @@ -83,14 +82,16 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO11) }, { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO11) }, - { MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_GPIO40) }, // MTDO - { MP_ROM_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_GPIO45) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, // Blue LED - { MP_ROM_QSTR(MP_QSTR_LDO2), MP_ROM_PTR(&pin_GPIO21) }, - { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_GPIO40) }, // APA102 + { MP_ROM_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_GPIO45) }, // APA102 - { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, - { MP_ROM_QSTR(MP_QSTR_AMB), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_LDO2), MP_ROM_PTR(&pin_GPIO21) }, // Second LDO Enable control + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, // Second LDO Enable control + + { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, // Ambient Light Sensor + { MP_ROM_QSTR(MP_QSTR_AMB), MP_ROM_PTR(&pin_GPIO4) }, // Ambient Light Sensor { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, From ec02102409b3935d0efa6c6f132b7f38c414ff03 Mon Sep 17 00:00:00 2001 From: jerryneedell Date: Mon, 4 Jan 2021 07:41:25 -0500 Subject: [PATCH 46/82] implment use of DotStar for staus led --- .../unexpectedmaker_feathers2/mpconfigboard.h | 4 +- .../esp32s2/common-hal/microcontroller/Pin.c | 43 +++++++++++++++++-- .../esp32s2/common-hal/microcontroller/Pin.h | 4 +- 3 files changed, 45 insertions(+), 6 deletions(-) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h index e100ac118e..6b1a0c4aa5 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h @@ -34,8 +34,8 @@ #define AUTORESET_DELAY_MS 500 -// #define MICROPY_HW_APA102_MOSI (&pin_GPIO40) -// #define MICROPY_HW_APA102_SCK (&pin_GPIO45) +#define MICROPY_HW_APA102_MOSI (&pin_GPIO40) +#define MICROPY_HW_APA102_SCK (&pin_GPIO45) #define DEFAULT_I2C_BUS_SCL (&pin_GPIO9) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO8) diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.c b/ports/esp32s2/common-hal/microcontroller/Pin.c index fca89ce8ec..fd01d68e1f 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.c +++ b/ports/esp32s2/common-hal/microcontroller/Pin.c @@ -37,13 +37,14 @@ #ifdef MICROPY_HW_NEOPIXEL bool neopixel_in_use; #endif +#ifdef MICROPY_HW_APA102_MOSI +bool apa102_sck_in_use; +bool apa102_mosi_in_use; +#endif STATIC uint32_t never_reset_pins[2]; STATIC uint32_t in_use[2]; -bool apa102_mosi_in_use; -bool apa102_sck_in_use; - STATIC void floating_gpio_reset(gpio_num_t pin_number) { // This is the same as gpio_reset_pin(), but without the pullup. // Note that gpio_config resets the iomatrix to GPIO_FUNC as well. @@ -86,6 +87,20 @@ void reset_pin_number(gpio_num_t pin_number) { return; } #endif + #ifdef MICROPY_HW_APA102_MOSI + if (pin_number == MICROPY_HW_APA102_MOSI->number || + pin_number == MICROPY_HW_APA102_SCK->number) { + apa102_mosi_in_use = apa102_mosi_in_use && pin_number != MICROPY_HW_APA102_MOSI->number; + apa102_sck_in_use = apa102_sck_in_use && pin_number != MICROPY_HW_APA102_SCK->number; + if (!apa102_sck_in_use && !apa102_mosi_in_use) { + rgb_led_status_init(); + } + return; + } + #endif + + + } void common_hal_reset_pin(const mcu_pin_obj_t* pin) { @@ -110,6 +125,11 @@ void reset_all_pins(void) { #ifdef MICROPY_HW_NEOPIXEL neopixel_in_use = false; #endif + #ifdef MICROPY_HW_APA102_MOSI + apa102_sck_in_use = false; + apa102_mosi_in_use = false; + #endif + } void claim_pin(const mcu_pin_obj_t* pin) { @@ -119,6 +139,15 @@ void claim_pin(const mcu_pin_obj_t* pin) { neopixel_in_use = true; } #endif + #ifdef MICROPY_HW_APA102_MOSI + if (pin == MICROPY_HW_APA102_MOSI) { + apa102_mosi_in_use = true; + } + if (pin == MICROPY_HW_APA102_SCK) { + apa102_sck_in_use = true; + } + #endif + } void common_hal_mcu_pin_claim(const mcu_pin_obj_t* pin) { @@ -131,6 +160,14 @@ bool pin_number_is_free(gpio_num_t pin_number) { return !neopixel_in_use; } #endif + #ifdef MICROPY_HW_APA102_MOSI + if (pin_number == MICROPY_HW_APA102_MOSI->number) { + return !apa102_mosi_in_use; + } + if (pin_number == MICROPY_HW_APA102_SCK->number) { + return !apa102_sck_in_use; + } + #endif uint8_t offset = pin_number / 32; uint32_t mask = 1 << (pin_number % 32); diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.h b/ports/esp32s2/common-hal/microcontroller/Pin.h index f6c0087031..65f57a82d4 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.h +++ b/ports/esp32s2/common-hal/microcontroller/Pin.h @@ -31,8 +31,10 @@ #include "peripherals/pins.h" -extern bool apa102_mosi_in_use; +#ifdef MICROPY_HW_APA102_MOSI extern bool apa102_sck_in_use; +extern bool apa102_mosi_in_use; +#endif #ifdef MICROPY_HW_NEOPIXEL extern bool neopixel_in_use; From 09bf58407fc09a308154105636694b65b51cb760 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 4 Jan 2021 12:50:08 -0600 Subject: [PATCH 47/82] ulab: update to 1.6.0 This fixes several problems I encountered. --- extmod/ulab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/ulab b/extmod/ulab index aa7e741530..c4b06e419f 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit aa7e741530df471d206a4a321823a37a913a0eb8 +Subproject commit c4b06e419f3d515478b05bb8ce03ebdb29cddec4 From f87ce01b8f451be00a1cf9b546ecd9919cf2148c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 4 Jan 2021 12:55:39 -0600 Subject: [PATCH 48/82] make translate --- locale/circuitpython.pot | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 880b1c74c0..f319b82f8b 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-22 22:54+0530\n" +"POT-Creation-Date: 2021-01-04 12:55-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1863,10 +1863,6 @@ msgstr "" msgid "Total data to write is larger than outgoing_packet_length" msgstr "" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -msgid "TouchAlarm not available in light sleep" -msgstr "" - #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "" @@ -2502,6 +2498,10 @@ msgstr "" msgid "data must be of equal length" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "data type not understood" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -2812,7 +2812,7 @@ msgid "input and output shapes are not compatible" msgstr "" #: extmod/ulab/code/ulab_create.c -msgid "input argument must be an integer or a 2-tuple" +msgid "input argument must be an integer, a tuple, or a list" msgstr "" #: extmod/ulab/code/fft/fft.c @@ -3055,6 +3055,10 @@ msgstr "" msgid "maxiter should be > 0" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "median argument must be an ndarray" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3284,10 +3288,6 @@ msgstr "" msgid "operation is implemented for 1D Boolean arrays only" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "operation is not implemented for flattened array" -msgstr "" - #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -3631,6 +3631,10 @@ msgstr "" msgid "too many arguments provided with the given format" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "too many dimensions" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "too many indices" msgstr "" @@ -3640,6 +3644,10 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "" +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" msgstr "" @@ -3648,10 +3656,6 @@ msgstr "" msgid "trigger level must be 0 or 1" msgstr "" -#: extmod/ulab/code/linalg/linalg.c -msgid "tuple index out of range" -msgstr "" - #: py/obj.c msgid "tuple/list has wrong length" msgstr "" From 4135ccb100779011ee9f11e6e68750f00c362aa7 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Mon, 4 Jan 2021 21:25:02 +0100 Subject: [PATCH 49/82] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 32 ++++++++++++++++------------ locale/cs.po | 32 ++++++++++++++++------------ locale/de_DE.po | 40 +++++++++++++++++++++------------- locale/el.po | 32 ++++++++++++++++------------ locale/es.po | 43 ++++++++++++++++++++++++------------- locale/fil.po | 35 ++++++++++++++++++------------ locale/fr.po | 46 +++++++++++++++++++++++++++------------- locale/hi.po | 32 ++++++++++++++++------------ locale/it_IT.po | 35 ++++++++++++++++++------------ locale/ja.po | 32 ++++++++++++++++------------ locale/ko.po | 32 ++++++++++++++++------------ locale/nl.po | 43 ++++++++++++++++++++++++------------- locale/pl.po | 35 ++++++++++++++++++------------ locale/pt_BR.po | 46 +++++++++++++++++++++++++++------------- locale/sv.po | 43 ++++++++++++++++++++++++------------- locale/zh_Latn_pinyin.po | 40 +++++++++++++++++++++------------- 16 files changed, 367 insertions(+), 231 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 5f80f1f140..9fc91305ee 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-22 22:54+0530\n" +"POT-Creation-Date: 2021-01-04 12:55-0600\n" "PO-Revision-Date: 2021-01-03 05:29+0000\n" "Last-Translator: oon arfiandwi \n" "Language-Team: LANGUAGE \n" @@ -1903,10 +1903,6 @@ msgid "Total data to write is larger than outgoing_packet_length" msgstr "" "Total data yang akan ditulis lebih besar daripada outgoing_packet_length" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -msgid "TouchAlarm not available in light sleep" -msgstr "" - #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Traceback (bagian terakhir dari panggilan terkini):\n" @@ -2550,6 +2546,10 @@ msgstr "" msgid "data must be of equal length" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "data type not understood" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -2860,7 +2860,7 @@ msgid "input and output shapes are not compatible" msgstr "" #: extmod/ulab/code/ulab_create.c -msgid "input argument must be an integer or a 2-tuple" +msgid "input argument must be an integer, a tuple, or a list" msgstr "" #: extmod/ulab/code/fft/fft.c @@ -3103,6 +3103,10 @@ msgstr "" msgid "maxiter should be > 0" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "median argument must be an ndarray" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3333,10 +3337,6 @@ msgstr "" msgid "operation is implemented for 1D Boolean arrays only" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "operation is not implemented for flattened array" -msgstr "" - #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -3681,6 +3681,10 @@ msgstr "" msgid "too many arguments provided with the given format" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "too many dimensions" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "too many indices" msgstr "" @@ -3690,6 +3694,10 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "" +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" msgstr "" @@ -3698,10 +3706,6 @@ msgstr "" msgid "trigger level must be 0 or 1" msgstr "" -#: extmod/ulab/code/linalg/linalg.c -msgid "tuple index out of range" -msgstr "" - #: py/obj.c msgid "tuple/list has wrong length" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 88380fbea6..c72a781bee 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-22 22:54+0530\n" +"POT-Creation-Date: 2021-01-04 12:55-0600\n" "PO-Revision-Date: 2020-12-04 18:33+0000\n" "Last-Translator: vkuthan \n" "Language-Team: LANGUAGE \n" @@ -1865,10 +1865,6 @@ msgstr "" msgid "Total data to write is larger than outgoing_packet_length" msgstr "" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -msgid "TouchAlarm not available in light sleep" -msgstr "" - #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "" @@ -2504,6 +2500,10 @@ msgstr "" msgid "data must be of equal length" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "data type not understood" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -2814,7 +2814,7 @@ msgid "input and output shapes are not compatible" msgstr "" #: extmod/ulab/code/ulab_create.c -msgid "input argument must be an integer or a 2-tuple" +msgid "input argument must be an integer, a tuple, or a list" msgstr "" #: extmod/ulab/code/fft/fft.c @@ -3057,6 +3057,10 @@ msgstr "" msgid "maxiter should be > 0" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "median argument must be an ndarray" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3286,10 +3290,6 @@ msgstr "" msgid "operation is implemented for 1D Boolean arrays only" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "operation is not implemented for flattened array" -msgstr "" - #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -3633,6 +3633,10 @@ msgstr "" msgid "too many arguments provided with the given format" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "too many dimensions" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "too many indices" msgstr "" @@ -3642,6 +3646,10 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "" +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" msgstr "" @@ -3650,10 +3658,6 @@ msgstr "" msgid "trigger level must be 0 or 1" msgstr "" -#: extmod/ulab/code/linalg/linalg.c -msgid "tuple index out of range" -msgstr "" - #: py/obj.c msgid "tuple/list has wrong length" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 39e1071f90..0dd7119993 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-22 22:54+0530\n" +"POT-Creation-Date: 2021-01-04 12:55-0600\n" "PO-Revision-Date: 2020-11-26 03:11+0000\n" "Last-Translator: Daniel Bravo Darriba \n" "Language: de_DE\n" @@ -1905,10 +1905,6 @@ msgstr "" "Die Gesamtzahl der zu schreibenden Daten ist größer als " "outgoing_packet_length" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -msgid "TouchAlarm not available in light sleep" -msgstr "" - #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Zurückverfolgung (jüngste Aufforderung zuletzt):\n" @@ -2569,6 +2565,10 @@ msgstr "" msgid "data must be of equal length" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "data type not understood" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "Dezimalzahlen nicht unterstützt" @@ -2882,8 +2882,8 @@ msgid "input and output shapes are not compatible" msgstr "" #: extmod/ulab/code/ulab_create.c -msgid "input argument must be an integer or a 2-tuple" -msgstr "Das Eingabeargument muss eine Ganzzahl oder ein 2-Tupel sein" +msgid "input argument must be an integer, a tuple, or a list" +msgstr "" #: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" @@ -3131,6 +3131,10 @@ msgstr "" msgid "maxiter should be > 0" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "median argument must be an ndarray" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3362,10 +3366,6 @@ msgstr "Operanden konnten nicht zusammen gesendet werden" msgid "operation is implemented for 1D Boolean arrays only" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "operation is not implemented for flattened array" -msgstr "" - #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "Die Operation ist für ndarrays nicht implementiert" @@ -3714,6 +3714,10 @@ msgstr "" msgid "too many arguments provided with the given format" msgstr "zu viele Argumente mit dem angegebenen Format" +#: extmod/ulab/code/ulab_create.c +msgid "too many dimensions" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "too many indices" msgstr "zu viele Indizes" @@ -3723,6 +3727,10 @@ msgstr "zu viele Indizes" msgid "too many values to unpack (expected %d)" msgstr "zu viele Werte zum Auspacken (erwartet %d)" +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" msgstr "" @@ -3731,10 +3739,6 @@ msgstr "" msgid "trigger level must be 0 or 1" msgstr "" -#: extmod/ulab/code/linalg/linalg.c -msgid "tuple index out of range" -msgstr "Tupelindex außerhalb des Bereichs" - #: py/obj.c msgid "tuple/list has wrong length" msgstr "tupel/list hat falsche Länge" @@ -3953,6 +3957,12 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "input argument must be an integer or a 2-tuple" +#~ msgstr "Das Eingabeargument muss eine Ganzzahl oder ein 2-Tupel sein" + +#~ msgid "tuple index out of range" +#~ msgstr "Tupelindex außerhalb des Bereichs" + #~ msgid "" #~ "\n" #~ "Code done running. Waiting for reload.\n" diff --git a/locale/el.po b/locale/el.po index 21a0942a6b..acf4241d19 100644 --- a/locale/el.po +++ b/locale/el.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-22 22:54+0530\n" +"POT-Creation-Date: 2021-01-04 12:55-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -1862,10 +1862,6 @@ msgstr "" msgid "Total data to write is larger than outgoing_packet_length" msgstr "" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -msgid "TouchAlarm not available in light sleep" -msgstr "" - #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "" @@ -2501,6 +2497,10 @@ msgstr "" msgid "data must be of equal length" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "data type not understood" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -2811,7 +2811,7 @@ msgid "input and output shapes are not compatible" msgstr "" #: extmod/ulab/code/ulab_create.c -msgid "input argument must be an integer or a 2-tuple" +msgid "input argument must be an integer, a tuple, or a list" msgstr "" #: extmod/ulab/code/fft/fft.c @@ -3054,6 +3054,10 @@ msgstr "" msgid "maxiter should be > 0" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "median argument must be an ndarray" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3283,10 +3287,6 @@ msgstr "" msgid "operation is implemented for 1D Boolean arrays only" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "operation is not implemented for flattened array" -msgstr "" - #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -3630,6 +3630,10 @@ msgstr "" msgid "too many arguments provided with the given format" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "too many dimensions" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "too many indices" msgstr "" @@ -3639,6 +3643,10 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "" +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" msgstr "" @@ -3647,10 +3655,6 @@ msgstr "" msgid "trigger level must be 0 or 1" msgstr "" -#: extmod/ulab/code/linalg/linalg.c -msgid "tuple index out of range" -msgstr "" - #: py/obj.c msgid "tuple/list has wrong length" msgstr "" diff --git a/locale/es.po b/locale/es.po index bac7d28405..90fbc5631b 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-22 22:54+0530\n" +"POT-Creation-Date: 2021-01-04 12:55-0600\n" "PO-Revision-Date: 2020-12-30 22:25+0000\n" "Last-Translator: Hugo Dahl \n" "Language-Team: \n" @@ -1912,10 +1912,6 @@ msgid "Total data to write is larger than outgoing_packet_length" msgstr "" "Los datos totales a escribir son más grandes que outgoing_packet_length" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -msgid "TouchAlarm not available in light sleep" -msgstr "" - #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Traceback (ultima llamada reciente):\n" @@ -2567,6 +2563,10 @@ msgstr "los datos deben permitir iteración" msgid "data must be of equal length" msgstr "los datos deben ser de igual tamaño" +#: extmod/ulab/code/ndarray.c +msgid "data type not understood" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "números decimales no soportados" @@ -2879,8 +2879,8 @@ msgid "input and output shapes are not compatible" msgstr "Formas de entrada y salida no son compactibles" #: extmod/ulab/code/ulab_create.c -msgid "input argument must be an integer or a 2-tuple" -msgstr "el argumento de entrada debe ser un entero o una tupla de par" +msgid "input argument must be an integer, a tuple, or a list" +msgstr "" #: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" @@ -3125,6 +3125,10 @@ msgstr "maxiter tiene que ser > 0" msgid "maxiter should be > 0" msgstr "maxiter debe ser > 0" +#: extmod/ulab/code/numerical/numerical.c +msgid "median argument must be an ndarray" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3357,10 +3361,6 @@ msgstr "los operandos no se pueden transmitir juntos" msgid "operation is implemented for 1D Boolean arrays only" msgstr "operación solo está implementada para arrays booleanos de 1D" -#: extmod/ulab/code/numerical/numerical.c -msgid "operation is not implemented for flattened array" -msgstr "operación no está implementada para arrays aplanados" - #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "la operación no está implementada para ndarrays" @@ -3707,6 +3707,10 @@ msgstr "tobytes solo pueden ser invocados por arrays densos" msgid "too many arguments provided with the given format" msgstr "demasiados argumentos provistos con el formato dado" +#: extmod/ulab/code/ulab_create.c +msgid "too many dimensions" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "too many indices" msgstr "demasiados índices" @@ -3716,6 +3720,10 @@ msgstr "demasiados índices" msgid "too many values to unpack (expected %d)" msgstr "demasiados valores para descomprimir (%d esperado)" +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" msgstr "trapz está definido para arreglos 1D de igual tamaño" @@ -3724,10 +3732,6 @@ msgstr "trapz está definido para arreglos 1D de igual tamaño" msgid "trigger level must be 0 or 1" msgstr "" -#: extmod/ulab/code/linalg/linalg.c -msgid "tuple index out of range" -msgstr "tuple index fuera de rango" - #: py/obj.c msgid "tuple/list has wrong length" msgstr "tupla/lista tiene una longitud incorrecta" @@ -3942,6 +3946,15 @@ msgstr "zi debe ser de tipo flotante" msgid "zi must be of shape (n_section, 2)" msgstr "zi debe ser una forma (n_section,2)" +#~ msgid "input argument must be an integer or a 2-tuple" +#~ msgstr "el argumento de entrada debe ser un entero o una tupla de par" + +#~ msgid "operation is not implemented for flattened array" +#~ msgstr "operación no está implementada para arrays aplanados" + +#~ msgid "tuple index out of range" +#~ msgstr "tuple index fuera de rango" + #~ msgid "" #~ "\n" #~ "Code done running. Waiting for reload.\n" diff --git a/locale/fil.po b/locale/fil.po index 86386cf1f3..d82731e316 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-22 22:54+0530\n" +"POT-Creation-Date: 2021-01-04 12:55-0600\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -1882,10 +1882,6 @@ msgstr "" msgid "Total data to write is larger than outgoing_packet_length" msgstr "" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -msgid "TouchAlarm not available in light sleep" -msgstr "" - #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Traceback (pinakahuling huling tawag): \n" @@ -2538,6 +2534,10 @@ msgstr "" msgid "data must be of equal length" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "data type not understood" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "decimal numbers hindi sinusuportahan" @@ -2854,7 +2854,7 @@ msgid "input and output shapes are not compatible" msgstr "" #: extmod/ulab/code/ulab_create.c -msgid "input argument must be an integer or a 2-tuple" +msgid "input argument must be an integer, a tuple, or a list" msgstr "" #: extmod/ulab/code/fft/fft.c @@ -3101,6 +3101,10 @@ msgstr "" msgid "maxiter should be > 0" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "median argument must be an ndarray" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3331,10 +3335,6 @@ msgstr "" msgid "operation is implemented for 1D Boolean arrays only" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "operation is not implemented for flattened array" -msgstr "" - #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -3683,6 +3683,10 @@ msgstr "" msgid "too many arguments provided with the given format" msgstr "masyadong maraming mga argumento na ibinigay sa ibinigay na format" +#: extmod/ulab/code/ulab_create.c +msgid "too many dimensions" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "too many indices" msgstr "" @@ -3692,6 +3696,10 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "masyadong maraming values para i-unpact (umaasa ng %d)" +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" msgstr "" @@ -3700,10 +3708,6 @@ msgstr "" msgid "trigger level must be 0 or 1" msgstr "" -#: extmod/ulab/code/linalg/linalg.c -msgid "tuple index out of range" -msgstr "indeks ng tuple wala sa sakop" - #: py/obj.c msgid "tuple/list has wrong length" msgstr "mali ang haba ng tuple/list" @@ -3920,6 +3924,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "tuple index out of range" +#~ msgstr "indeks ng tuple wala sa sakop" + #~ msgid "Press any key to enter the REPL. Use CTRL-D to reload." #~ msgstr "" #~ "Pindutin ang anumang key upang pumasok sa REPL. Gamitin ang CTRL-D upang " diff --git a/locale/fr.po b/locale/fr.po index c25da7888f..187ee6f92d 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-22 22:54+0530\n" +"POT-Creation-Date: 2021-01-04 12:55-0600\n" "PO-Revision-Date: 2021-01-01 04:29+0000\n" "Last-Translator: Hugo Dahl \n" "Language: fr\n" @@ -1931,10 +1931,6 @@ msgid "Total data to write is larger than outgoing_packet_length" msgstr "" "Le nombre total de données à écrire est supérieur à outgoing_packet_length" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -msgid "TouchAlarm not available in light sleep" -msgstr "TouchAlarm n'est pas disponible en mode someil léger" - #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Traceback (appels les plus récents en dernier) :\n" @@ -2597,6 +2593,10 @@ msgstr "les données doivent être les objets iterables" msgid "data must be of equal length" msgstr "les données doivent être de longueur égale" +#: extmod/ulab/code/ndarray.c +msgid "data type not understood" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "nombres décimaux non supportés" @@ -2912,8 +2912,8 @@ msgid "input and output shapes are not compatible" msgstr "les formes d'entrée et de sortie ne sont pas compatibles" #: extmod/ulab/code/ulab_create.c -msgid "input argument must be an integer or a 2-tuple" -msgstr "l'argument d'entrée doit être un entier ou un tuple 2" +msgid "input argument must be an integer, a tuple, or a list" +msgstr "" #: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" @@ -3159,6 +3159,10 @@ msgstr "maxiter doit être > 0" msgid "maxiter should be > 0" msgstr "maxiter devrait être > 0" +#: extmod/ulab/code/numerical/numerical.c +msgid "median argument must be an ndarray" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3390,10 +3394,6 @@ msgstr "les opérandes ne pouvaient pas être diffusés ensemble" msgid "operation is implemented for 1D Boolean arrays only" msgstr "opération implémentée que pour des tableaux 1D booléennes" -#: extmod/ulab/code/numerical/numerical.c -msgid "operation is not implemented for flattened array" -msgstr "l'opération n'est pas implémentée pour un tableau applatit" - #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "l'opération n'est pas implémentée sur les ndarrays" @@ -3743,6 +3743,10 @@ msgstr "tobytes ne peut être appelé que pour des tableaux dense" msgid "too many arguments provided with the given format" msgstr "trop d'arguments fournis avec ce format" +#: extmod/ulab/code/ulab_create.c +msgid "too many dimensions" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "too many indices" msgstr "trop d'indices" @@ -3752,6 +3756,10 @@ msgstr "trop d'indices" msgid "too many values to unpack (expected %d)" msgstr "trop de valeur à dégrouper (%d attendues)" +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" msgstr "trapz n'est défini que pour des tableaux 1D de longueur égale" @@ -3760,10 +3768,6 @@ msgstr "trapz n'est défini que pour des tableaux 1D de longueur égale" msgid "trigger level must be 0 or 1" msgstr "niveau du déclencheur doit être 0 ou 1" -#: extmod/ulab/code/linalg/linalg.c -msgid "tuple index out of range" -msgstr "index du tuple hors de portée" - #: py/obj.c msgid "tuple/list has wrong length" msgstr "tuple/liste a une mauvaise longueur" @@ -3978,6 +3982,18 @@ msgstr "zi doit être de type float" msgid "zi must be of shape (n_section, 2)" msgstr "zi doit être de forme (n_section, 2)" +#~ msgid "TouchAlarm not available in light sleep" +#~ msgstr "TouchAlarm n'est pas disponible en mode someil léger" + +#~ msgid "input argument must be an integer or a 2-tuple" +#~ msgstr "l'argument d'entrée doit être un entier ou un tuple 2" + +#~ msgid "operation is not implemented for flattened array" +#~ msgstr "l'opération n'est pas implémentée pour un tableau applatit" + +#~ msgid "tuple index out of range" +#~ msgstr "index du tuple hors de portée" + #~ msgid "" #~ "\n" #~ "Code done running. Waiting for reload.\n" diff --git a/locale/hi.po b/locale/hi.po index 34d0238f6b..ba82ca8958 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-22 22:54+0530\n" +"POT-Creation-Date: 2021-01-04 12:55-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -1862,10 +1862,6 @@ msgstr "" msgid "Total data to write is larger than outgoing_packet_length" msgstr "" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -msgid "TouchAlarm not available in light sleep" -msgstr "" - #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "" @@ -2501,6 +2497,10 @@ msgstr "" msgid "data must be of equal length" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "data type not understood" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -2811,7 +2811,7 @@ msgid "input and output shapes are not compatible" msgstr "" #: extmod/ulab/code/ulab_create.c -msgid "input argument must be an integer or a 2-tuple" +msgid "input argument must be an integer, a tuple, or a list" msgstr "" #: extmod/ulab/code/fft/fft.c @@ -3054,6 +3054,10 @@ msgstr "" msgid "maxiter should be > 0" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "median argument must be an ndarray" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3283,10 +3287,6 @@ msgstr "" msgid "operation is implemented for 1D Boolean arrays only" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "operation is not implemented for flattened array" -msgstr "" - #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -3630,6 +3630,10 @@ msgstr "" msgid "too many arguments provided with the given format" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "too many dimensions" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "too many indices" msgstr "" @@ -3639,6 +3643,10 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "" +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" msgstr "" @@ -3647,10 +3655,6 @@ msgstr "" msgid "trigger level must be 0 or 1" msgstr "" -#: extmod/ulab/code/linalg/linalg.c -msgid "tuple index out of range" -msgstr "" - #: py/obj.c msgid "tuple/list has wrong length" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index dbefb87a8b..c0b2aa931f 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-22 22:54+0530\n" +"POT-Creation-Date: 2021-01-04 12:55-0600\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -1894,10 +1894,6 @@ msgstr "Troppi schermi" msgid "Total data to write is larger than outgoing_packet_length" msgstr "" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -msgid "TouchAlarm not available in light sleep" -msgstr "" - #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Traceback (chiamata più recente per ultima):\n" @@ -2541,6 +2537,10 @@ msgstr "" msgid "data must be of equal length" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "data type not understood" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "numeri decimali non supportati" @@ -2856,7 +2856,7 @@ msgid "input and output shapes are not compatible" msgstr "" #: extmod/ulab/code/ulab_create.c -msgid "input argument must be an integer or a 2-tuple" +msgid "input argument must be an integer, a tuple, or a list" msgstr "" #: extmod/ulab/code/fft/fft.c @@ -3104,6 +3104,10 @@ msgstr "" msgid "maxiter should be > 0" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "median argument must be an ndarray" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3337,10 +3341,6 @@ msgstr "" msgid "operation is implemented for 1D Boolean arrays only" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "operation is not implemented for flattened array" -msgstr "" - #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -3691,6 +3691,10 @@ msgstr "" msgid "too many arguments provided with the given format" msgstr "troppi argomenti forniti con il formato specificato" +#: extmod/ulab/code/ulab_create.c +msgid "too many dimensions" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "too many indices" msgstr "" @@ -3700,6 +3704,10 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "troppi valori da scompattare (%d attesi)" +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" msgstr "" @@ -3708,10 +3716,6 @@ msgstr "" msgid "trigger level must be 0 or 1" msgstr "" -#: extmod/ulab/code/linalg/linalg.c -msgid "tuple index out of range" -msgstr "indice della tupla fuori intervallo" - #: py/obj.c msgid "tuple/list has wrong length" msgstr "tupla/lista ha la lunghezza sbagliata" @@ -3928,6 +3932,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "tuple index out of range" +#~ msgstr "indice della tupla fuori intervallo" + #~ msgid "Press any key to enter the REPL. Use CTRL-D to reload." #~ msgstr "" #~ "Premi un qualunque tasto per entrare nel REPL. Usa CTRL-D per ricaricare." diff --git a/locale/ja.po b/locale/ja.po index 6ccdc158e0..770752e995 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-22 22:54+0530\n" +"POT-Creation-Date: 2021-01-04 12:55-0600\n" "PO-Revision-Date: 2020-11-27 18:34+0000\n" "Last-Translator: sporeball \n" "Language-Team: none\n" @@ -1884,10 +1884,6 @@ msgstr "" msgid "Total data to write is larger than outgoing_packet_length" msgstr "" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -msgid "TouchAlarm not available in light sleep" -msgstr "" - #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "トレースバック(最新の呼び出しが末尾):\n" @@ -2526,6 +2522,10 @@ msgstr "dataはイテレート可能でなければなりません" msgid "data must be of equal length" msgstr "dataは同じ長さでなければなりません" +#: extmod/ulab/code/ndarray.c +msgid "data type not understood" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -2839,7 +2839,7 @@ msgid "input and output shapes are not compatible" msgstr "" #: extmod/ulab/code/ulab_create.c -msgid "input argument must be an integer or a 2-tuple" +msgid "input argument must be an integer, a tuple, or a list" msgstr "" #: extmod/ulab/code/fft/fft.c @@ -3082,6 +3082,10 @@ msgstr "" msgid "maxiter should be > 0" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "median argument must be an ndarray" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3311,10 +3315,6 @@ msgstr "" msgid "operation is implemented for 1D Boolean arrays only" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "operation is not implemented for flattened array" -msgstr "" - #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "この演算はndarray上で実装されていません" @@ -3661,6 +3661,10 @@ msgstr "" msgid "too many arguments provided with the given format" msgstr "指定された書式に対して引数が多すぎます" +#: extmod/ulab/code/ulab_create.c +msgid "too many dimensions" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "too many indices" msgstr "インデクスが多すぎます" @@ -3670,6 +3674,10 @@ msgstr "インデクスが多すぎます" msgid "too many values to unpack (expected %d)" msgstr "アンパックする値が多すぎます (%d個を期待)" +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" msgstr "trapzは同じ長さの1次元arrayに対して定義されています" @@ -3678,10 +3686,6 @@ msgstr "trapzは同じ長さの1次元arrayに対して定義されています" msgid "trigger level must be 0 or 1" msgstr "" -#: extmod/ulab/code/linalg/linalg.c -msgid "tuple index out of range" -msgstr "" - #: py/obj.c msgid "tuple/list has wrong length" msgstr "タプル/リストの長さが正しくありません" diff --git a/locale/ko.po b/locale/ko.po index c2272af7b0..97ede047a6 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-22 22:54+0530\n" +"POT-Creation-Date: 2021-01-04 12:55-0600\n" "PO-Revision-Date: 2020-10-05 12:12+0000\n" "Last-Translator: Michal Čihař \n" "Language-Team: LANGUAGE \n" @@ -1865,10 +1865,6 @@ msgstr "" msgid "Total data to write is larger than outgoing_packet_length" msgstr "" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -msgid "TouchAlarm not available in light sleep" -msgstr "" - #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "" @@ -2505,6 +2501,10 @@ msgstr "" msgid "data must be of equal length" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "data type not understood" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "" @@ -2815,7 +2815,7 @@ msgid "input and output shapes are not compatible" msgstr "" #: extmod/ulab/code/ulab_create.c -msgid "input argument must be an integer or a 2-tuple" +msgid "input argument must be an integer, a tuple, or a list" msgstr "" #: extmod/ulab/code/fft/fft.c @@ -3058,6 +3058,10 @@ msgstr "" msgid "maxiter should be > 0" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "median argument must be an ndarray" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3287,10 +3291,6 @@ msgstr "" msgid "operation is implemented for 1D Boolean arrays only" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "operation is not implemented for flattened array" -msgstr "" - #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -3634,6 +3634,10 @@ msgstr "" msgid "too many arguments provided with the given format" msgstr "" +#: extmod/ulab/code/ulab_create.c +msgid "too many dimensions" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "too many indices" msgstr "" @@ -3643,6 +3647,10 @@ msgstr "" msgid "too many values to unpack (expected %d)" msgstr "" +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" msgstr "" @@ -3651,10 +3659,6 @@ msgstr "" msgid "trigger level must be 0 or 1" msgstr "" -#: extmod/ulab/code/linalg/linalg.c -msgid "tuple index out of range" -msgstr "" - #: py/obj.c msgid "tuple/list has wrong length" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 73aeade01c..3fce132120 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-22 22:54+0530\n" +"POT-Creation-Date: 2021-01-04 12:55-0600\n" "PO-Revision-Date: 2020-12-23 20:14+0000\n" "Last-Translator: _fonzlate \n" "Language-Team: none\n" @@ -1904,10 +1904,6 @@ msgstr "Teveel beeldschermen" msgid "Total data to write is larger than outgoing_packet_length" msgstr "Totale data om te schrijven is groter dan outgoing_packet_length" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -msgid "TouchAlarm not available in light sleep" -msgstr "" - #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Traceback (meest recente call laatst):\n" @@ -2556,6 +2552,10 @@ msgstr "data moet itereerbaar zijn" msgid "data must be of equal length" msgstr "data moet van gelijke lengte zijn" +#: extmod/ulab/code/ndarray.c +msgid "data type not understood" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "decimale getallen zijn niet ondersteund" @@ -2869,8 +2869,8 @@ msgid "input and output shapes are not compatible" msgstr "in- en uitvoervormen zijn niet compatibel" #: extmod/ulab/code/ulab_create.c -msgid "input argument must be an integer or a 2-tuple" -msgstr "invoerargument moet een integer of 2-tuple zijn" +msgid "input argument must be an integer, a tuple, or a list" +msgstr "" #: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" @@ -3115,6 +3115,10 @@ msgstr "maxiter moet groter dan 0 zijn" msgid "maxiter should be > 0" msgstr "maxiter moet groter dan 0 zijn" +#: extmod/ulab/code/numerical/numerical.c +msgid "median argument must be an ndarray" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3344,10 +3348,6 @@ msgstr "operands konden niet samen verzonden worden" msgid "operation is implemented for 1D Boolean arrays only" msgstr "operatie is alleen geïmplementeerd voor 1D Booleaanse arrays" -#: extmod/ulab/code/numerical/numerical.c -msgid "operation is not implemented for flattened array" -msgstr "operatie is niet geïmplementeerd voor vlakke array" - #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "bewerking is voor ndarrays niet geïmplementeerd" @@ -3694,6 +3694,10 @@ msgstr "tobytes kunnen alleen ingeroepen worden voor gesloten arrays" msgid "too many arguments provided with the given format" msgstr "te veel argumenten opgegeven bij dit formaat" +#: extmod/ulab/code/ulab_create.c +msgid "too many dimensions" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "too many indices" msgstr "te veel indices" @@ -3703,6 +3707,10 @@ msgstr "te veel indices" msgid "too many values to unpack (expected %d)" msgstr "te veel waarden om uit te pakken (%d verwacht)" +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" msgstr "trapz is gedefinieerd voor eendimensionale arrays van gelijke lengte" @@ -3711,10 +3719,6 @@ msgstr "trapz is gedefinieerd voor eendimensionale arrays van gelijke lengte" msgid "trigger level must be 0 or 1" msgstr "triggerniveau moet 0 of 1 zijn" -#: extmod/ulab/code/linalg/linalg.c -msgid "tuple index out of range" -msgstr "tuple index buiten bereik" - #: py/obj.c msgid "tuple/list has wrong length" msgstr "tuple of lijst heeft onjuiste lengte" @@ -3929,6 +3933,15 @@ msgstr "zi moet van type float zijn" msgid "zi must be of shape (n_section, 2)" msgstr "zi moet vorm (n_section, 2) hebben" +#~ msgid "input argument must be an integer or a 2-tuple" +#~ msgstr "invoerargument moet een integer of 2-tuple zijn" + +#~ msgid "operation is not implemented for flattened array" +#~ msgstr "operatie is niet geïmplementeerd voor vlakke array" + +#~ msgid "tuple index out of range" +#~ msgstr "tuple index buiten bereik" + #~ msgid "" #~ "\n" #~ "Code done running. Waiting for reload.\n" diff --git a/locale/pl.po b/locale/pl.po index deefb878b8..80d5cf90bd 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-22 22:54+0530\n" +"POT-Creation-Date: 2021-01-04 12:55-0600\n" "PO-Revision-Date: 2020-12-02 20:29+0000\n" "Last-Translator: Maciej Stankiewicz \n" "Language-Team: pl\n" @@ -1876,10 +1876,6 @@ msgstr "Zbyt wiele wyświetlaczy" msgid "Total data to write is larger than outgoing_packet_length" msgstr "" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -msgid "TouchAlarm not available in light sleep" -msgstr "" - #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Ślad wyjątku (najnowsze wywołanie na końcu):\n" @@ -2521,6 +2517,10 @@ msgstr "" msgid "data must be of equal length" msgstr "" +#: extmod/ulab/code/ndarray.c +msgid "data type not understood" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "liczby dziesiętne nieobsługiwane" @@ -2832,7 +2832,7 @@ msgid "input and output shapes are not compatible" msgstr "" #: extmod/ulab/code/ulab_create.c -msgid "input argument must be an integer or a 2-tuple" +msgid "input argument must be an integer, a tuple, or a list" msgstr "" #: extmod/ulab/code/fft/fft.c @@ -3075,6 +3075,10 @@ msgstr "" msgid "maxiter should be > 0" msgstr "" +#: extmod/ulab/code/numerical/numerical.c +msgid "median argument must be an ndarray" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3304,10 +3308,6 @@ msgstr "operandy nie mogły być rozgłaszane razem" msgid "operation is implemented for 1D Boolean arrays only" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "operation is not implemented for flattened array" -msgstr "" - #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "" @@ -3653,6 +3653,10 @@ msgstr "" msgid "too many arguments provided with the given format" msgstr "zbyt wiele argumentów podanych dla tego formatu" +#: extmod/ulab/code/ulab_create.c +msgid "too many dimensions" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "too many indices" msgstr "zbyt wiele indeksów" @@ -3662,6 +3666,10 @@ msgstr "zbyt wiele indeksów" msgid "too many values to unpack (expected %d)" msgstr "zbyt wiele wartości do rozpakowania (oczekiwano %d)" +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" msgstr "" @@ -3670,10 +3678,6 @@ msgstr "" msgid "trigger level must be 0 or 1" msgstr "" -#: extmod/ulab/code/linalg/linalg.c -msgid "tuple index out of range" -msgstr "indeks krotki poza zakresem" - #: py/obj.c msgid "tuple/list has wrong length" msgstr "krotka/lista ma złą długość" @@ -3888,6 +3892,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "tuple index out of range" +#~ msgstr "indeks krotki poza zakresem" + #~ msgid "" #~ "\n" #~ "Code done running. Waiting for reload.\n" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 73922b3d35..43c5626b27 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-22 22:54+0530\n" +"POT-Creation-Date: 2021-01-04 12:55-0600\n" "PO-Revision-Date: 2021-01-01 04:29+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" @@ -1927,10 +1927,6 @@ msgid "Total data to write is larger than outgoing_packet_length" msgstr "" "O total dos dados que serão gravados é maior que outgoing_packet_length" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -msgid "TouchAlarm not available in light sleep" -msgstr "O TouchAlarm não está disponívle no modo light sleep" - #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Traceback (a última chamada mais recente):\n" @@ -2584,6 +2580,10 @@ msgstr "os dados devem ser iteráveis" msgid "data must be of equal length" msgstr "os dados devem ser de igual comprimento" +#: extmod/ulab/code/ndarray.c +msgid "data type not understood" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "os números decimais não são compatíveis" @@ -2897,8 +2897,8 @@ msgid "input and output shapes are not compatible" msgstr "as formas de entrada e saída não são compatíveis" #: extmod/ulab/code/ulab_create.c -msgid "input argument must be an integer or a 2-tuple" -msgstr "o argumento da entrada deve ser um número inteiro ou uma tupla de 2" +msgid "input argument must be an integer, a tuple, or a list" +msgstr "" #: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" @@ -3143,6 +3143,10 @@ msgstr "maxiter deve ser > 0" msgid "maxiter should be > 0" msgstr "maxiter pode ser > 0" +#: extmod/ulab/code/numerical/numerical.c +msgid "median argument must be an ndarray" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3375,10 +3379,6 @@ msgstr "os operandos não puderam ser transmitidos juntos" msgid "operation is implemented for 1D Boolean arrays only" msgstr "A operação é implementada apenas para matrizes booleanas 1D" -#: extmod/ulab/code/numerical/numerical.c -msgid "operation is not implemented for flattened array" -msgstr "a operação não é implementada para a matriz achatada" - #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "a operação não foi implementada nos ndarrays" @@ -3728,6 +3728,10 @@ msgstr "os tobytes podem ser invocados apenas nas matrizes densas" msgid "too many arguments provided with the given format" msgstr "Muitos argumentos fornecidos com o formato dado" +#: extmod/ulab/code/ulab_create.c +msgid "too many dimensions" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "too many indices" msgstr "índices demais" @@ -3737,6 +3741,10 @@ msgstr "índices demais" msgid "too many values to unpack (expected %d)" msgstr "valores demais para descompactar (esperado %d)" +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" msgstr "o trapz está definido para 1D arrays de igual tamanho" @@ -3745,10 +3753,6 @@ msgstr "o trapz está definido para 1D arrays de igual tamanho" msgid "trigger level must be 0 or 1" msgstr "nível do gatilho deve ser 0 ou 1" -#: extmod/ulab/code/linalg/linalg.c -msgid "tuple index out of range" -msgstr "o índice da tupla está fora do intervalo" - #: py/obj.c msgid "tuple/list has wrong length" msgstr "a tupla/lista está com tamanho incorreto" @@ -3963,6 +3967,18 @@ msgstr "zi deve ser de um tipo float" msgid "zi must be of shape (n_section, 2)" msgstr "zi deve estar na forma (n_section, 2)" +#~ msgid "TouchAlarm not available in light sleep" +#~ msgstr "O TouchAlarm não está disponívle no modo light sleep" + +#~ msgid "input argument must be an integer or a 2-tuple" +#~ msgstr "o argumento da entrada deve ser um número inteiro ou uma tupla de 2" + +#~ msgid "operation is not implemented for flattened array" +#~ msgstr "a operação não é implementada para a matriz achatada" + +#~ msgid "tuple index out of range" +#~ msgstr "o índice da tupla está fora do intervalo" + #~ msgid "" #~ "\n" #~ "Code done running. Waiting for reload.\n" diff --git a/locale/sv.po b/locale/sv.po index 71b1c3a866..c3d8c8a702 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-22 22:54+0530\n" +"POT-Creation-Date: 2021-01-04 12:55-0600\n" "PO-Revision-Date: 2020-12-28 17:59+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" @@ -1902,10 +1902,6 @@ msgstr "För många displayer" msgid "Total data to write is larger than outgoing_packet_length" msgstr "Total data som ska skrivas är större än outgoing_packet_length" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -msgid "TouchAlarm not available in light sleep" -msgstr "" - #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Traceback (senaste anrop):\n" @@ -2551,6 +2547,10 @@ msgstr "data måste vara itererbar" msgid "data must be of equal length" msgstr "data måste vara av samma längd" +#: extmod/ulab/code/ndarray.c +msgid "data type not understood" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "decimaltal stöds inte" @@ -2864,8 +2864,8 @@ msgid "input and output shapes are not compatible" msgstr "indata- och utdataformer är inte kompatibla" #: extmod/ulab/code/ulab_create.c -msgid "input argument must be an integer or a 2-tuple" -msgstr "indataargumentet måste vara ett heltal eller en 2-tupel" +msgid "input argument must be an integer, a tuple, or a list" +msgstr "" #: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" @@ -3110,6 +3110,10 @@ msgstr "maxiter måste vara > 0" msgid "maxiter should be > 0" msgstr "maxiter bör vara > 0" +#: extmod/ulab/code/numerical/numerical.c +msgid "median argument must be an ndarray" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3339,10 +3343,6 @@ msgstr "operander kan inte sändas tillsammans" msgid "operation is implemented for 1D Boolean arrays only" msgstr "operationen är enbart implementerad för 1D Boolean-matriser" -#: extmod/ulab/code/numerical/numerical.c -msgid "operation is not implemented for flattened array" -msgstr "operationen inte implementeras för tillplattad matris" - #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "åtgärden är inte implementerad för ndarray:er" @@ -3689,6 +3689,10 @@ msgstr "tobyte kan enbart anropas för täta matriser" msgid "too many arguments provided with the given format" msgstr "för många argument för det givna formatet" +#: extmod/ulab/code/ulab_create.c +msgid "too many dimensions" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "too many indices" msgstr "för många index" @@ -3698,6 +3702,10 @@ msgstr "för många index" msgid "too many values to unpack (expected %d)" msgstr "för många värden att packa upp (förväntat %d)" +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" msgstr "trapz är definierad för 1D-matriser med samma längd" @@ -3706,10 +3714,6 @@ msgstr "trapz är definierad för 1D-matriser med samma längd" msgid "trigger level must be 0 or 1" msgstr "triggernivå måste vara 0 eller 1" -#: extmod/ulab/code/linalg/linalg.c -msgid "tuple index out of range" -msgstr "tupelindex utanför intervallet" - #: py/obj.c msgid "tuple/list has wrong length" msgstr "tupel/lista har fel längd" @@ -3924,6 +3928,15 @@ msgstr "zi måste vara av typ float" msgid "zi must be of shape (n_section, 2)" msgstr "zi måste vara i formen (n_section, 2)" +#~ msgid "input argument must be an integer or a 2-tuple" +#~ msgstr "indataargumentet måste vara ett heltal eller en 2-tupel" + +#~ msgid "operation is not implemented for flattened array" +#~ msgstr "operationen inte implementeras för tillplattad matris" + +#~ msgid "tuple index out of range" +#~ msgstr "tupelindex utanför intervallet" + #~ msgid "" #~ "\n" #~ "Code done running. Waiting for reload.\n" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index b372b067a4..596855cf6a 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-22 22:54+0530\n" +"POT-Creation-Date: 2021-01-04 12:55-0600\n" "PO-Revision-Date: 2020-11-19 01:28+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -1892,10 +1892,6 @@ msgstr "Xiǎnshì tài duō" msgid "Total data to write is larger than outgoing_packet_length" msgstr "Yào xiě rù de zǒng shùjù dàyú outgoing_packet_length" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -msgid "TouchAlarm not available in light sleep" -msgstr "" - #: py/obj.c msgid "Traceback (most recent call last):\n" msgstr "Traceback (Zuìjìn yīcì dǎ diànhuà):\n" @@ -2543,6 +2539,10 @@ msgstr "shùjù bìxū shì kě diédài de" msgid "data must be of equal length" msgstr "shùjù chángdù bìxū xiāngděng" +#: extmod/ulab/code/ndarray.c +msgid "data type not understood" +msgstr "" + #: py/parsenum.c msgid "decimal numbers not supported" msgstr "bù zhīchí xiǎoshù shù" @@ -2855,8 +2855,8 @@ msgid "input and output shapes are not compatible" msgstr "" #: extmod/ulab/code/ulab_create.c -msgid "input argument must be an integer or a 2-tuple" -msgstr "shūrù cānshù bìxū shì zhěngshù huò 2 yuán zǔ" +msgid "input argument must be an integer, a tuple, or a list" +msgstr "" #: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" @@ -3099,6 +3099,10 @@ msgstr "maxiter bì xū > 0" msgid "maxiter should be > 0" msgstr "maxiter yìng wéi > 0" +#: extmod/ulab/code/numerical/numerical.c +msgid "median argument must be an ndarray" +msgstr "" + #: py/runtime.c #, c-format msgid "memory allocation failed, allocating %u bytes" @@ -3328,10 +3332,6 @@ msgstr "cāozuò shǔ bùnéng yīqǐ guǎngbò" msgid "operation is implemented for 1D Boolean arrays only" msgstr "" -#: extmod/ulab/code/numerical/numerical.c -msgid "operation is not implemented for flattened array" -msgstr "" - #: extmod/ulab/code/numerical/numerical.c msgid "operation is not implemented on ndarrays" msgstr "cāozuò wèi zài ndarrays shàng shíxiàn" @@ -3677,6 +3677,10 @@ msgstr "" msgid "too many arguments provided with the given format" msgstr "tígōng jǐ dìng géshì de cānshù tài duō" +#: extmod/ulab/code/ulab_create.c +msgid "too many dimensions" +msgstr "" + #: extmod/ulab/code/ndarray.c msgid "too many indices" msgstr "suǒyǐn tài duō" @@ -3686,6 +3690,10 @@ msgstr "suǒyǐn tài duō" msgid "too many values to unpack (expected %d)" msgstr "dǎkāi tài duō zhí (yùqí %d)" +#: extmod/ulab/code/approx/approx.c +msgid "trapz is defined for 1D arrays" +msgstr "" + #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" msgstr "Trapz shì wèi děng zhǎng de 1D shùzǔ dìngyì de" @@ -3694,10 +3702,6 @@ msgstr "Trapz shì wèi děng zhǎng de 1D shùzǔ dìngyì de" msgid "trigger level must be 0 or 1" msgstr "" -#: extmod/ulab/code/linalg/linalg.c -msgid "tuple index out of range" -msgstr "yuán zǔ suǒyǐn chāochū fànwéi" - #: py/obj.c msgid "tuple/list has wrong length" msgstr "yuán zǔ/lièbiǎo chángdù cuòwù" @@ -3912,6 +3916,12 @@ msgstr "zi bìxū wèi fú diǎn xíng" msgid "zi must be of shape (n_section, 2)" msgstr "zi bìxū jùyǒu xíngzhuàng (n_section,2)" +#~ msgid "input argument must be an integer or a 2-tuple" +#~ msgstr "shūrù cānshù bìxū shì zhěngshù huò 2 yuán zǔ" + +#~ msgid "tuple index out of range" +#~ msgstr "yuán zǔ suǒyǐn chāochū fànwéi" + #~ msgid "" #~ "\n" #~ "Code done running. Waiting for reload.\n" From bbd4de33d1c9b9da8984b68889428cbbeb602612 Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Mon, 4 Jan 2021 15:53:39 -0500 Subject: [PATCH 50/82] Add adafruit_bus_device to CPX builds. --- .../atmel-samd/boards/circuitplayground_express/mpconfigboard.mk | 1 + .../boards/circuitplayground_express_crickit/mpconfigboard.mk | 1 + .../boards/circuitplayground_express_displayio/mpconfigboard.mk | 1 + 3 files changed, 3 insertions(+) diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk index 5389fc89a5..13ec9e861c 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk @@ -21,6 +21,7 @@ SUPEROPT_GC = 0 CFLAGS_INLINE_LIMIT = 55 # Include these Python libraries in firmware. +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk index 31e10d736c..7aa45eb39e 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk @@ -25,6 +25,7 @@ CFLAGS_INLINE_LIMIT = 50 # Include these Python libraries in firmware. +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Crickit FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk index 36b49b0eef..3a43093a98 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk @@ -26,6 +26,7 @@ SUPEROPT_GC = 0 CFLAGS_INLINE_LIMIT = 55 # Include these Python libraries in firmware. +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel From ce55822680b3b4005f370bbd735d50402cd48925 Mon Sep 17 00:00:00 2001 From: DavePutz Date: Mon, 4 Jan 2021 15:50:09 -0600 Subject: [PATCH 51/82] Fix size of memset in board_reset_user_neopixels() --- supervisor/shared/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/shared/board.c b/supervisor/shared/board.c index 30603aa66c..6d648510e7 100644 --- a/supervisor/shared/board.c +++ b/supervisor/shared/board.c @@ -36,7 +36,7 @@ void board_reset_user_neopixels(const mcu_pin_obj_t* pin, size_t count) { // Turn off on-board NeoPixel string uint8_t empty[count * 3]; - memset(empty, 0, count); + memset(empty, 0, count * 3); digitalio_digitalinout_obj_t neopixel_pin; common_hal_digitalio_digitalinout_construct(&neopixel_pin, pin); common_hal_digitalio_digitalinout_switch_to_output(&neopixel_pin, false, From 90a299bb1e6c80971b576dc51dd50bca6220b6f7 Mon Sep 17 00:00:00 2001 From: Bernhard Boser Date: Tue, 5 Jan 2021 11:17:09 -0800 Subject: [PATCH 52/82] added //| to (hopefully) get CI to pass --- locale/circuitpython.pot | 6 +++++- shared-bindings/msgpack/ExtType.c | 2 ++ shared-bindings/msgpack/__init__.c | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index cea26c6bac..578257e2d0 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-08 09:56-0800\n" +"POT-Creation-Date: 2021-01-05 11:08-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3438,6 +3438,10 @@ msgstr "" msgid "shape must be a tuple" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "short read" +msgstr "" + #: py/objstr.c msgid "sign not allowed in string format specifier" msgstr "" diff --git a/shared-bindings/msgpack/ExtType.c b/shared-bindings/msgpack/ExtType.c index 5dc3d4992e..e9ddd32bce 100644 --- a/shared-bindings/msgpack/ExtType.c +++ b/shared-bindings/msgpack/ExtType.c @@ -61,6 +61,7 @@ STATIC mp_obj_t mod_msgpack_exttype_make_new(const mp_obj_type_t *type, size_t n //| code: int //| """The type code, in range 0~127.""" +//| ... //| STATIC mp_obj_t mod_msgpack_exttype_get_code(mp_obj_t self_in) { mod_msgpack_extype_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -88,6 +89,7 @@ const mp_obj_property_t mod_msgpack_exttype_code_obj = { //| data: bytes //| """Data.""" +//| ... //| STATIC mp_obj_t mod_msgpack_exttype_get_data(mp_obj_t self_in) { mod_msgpack_extype_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/msgpack/__init__.c b/shared-bindings/msgpack/__init__.c index 5dc45dde2c..e1b6b8fce6 100644 --- a/shared-bindings/msgpack/__init__.c +++ b/shared-bindings/msgpack/__init__.c @@ -89,6 +89,7 @@ //| function called for python objects that do not have //| a representation in msgpack format. //| """ +//| ... //| STATIC mp_obj_t mod_msgpack_pack(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_obj, ARG_buffer, ARG_default }; @@ -119,6 +120,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(mod_msgpack_pack_obj, 1, mod_msgpack_pack); //| :param Optional[bool] use_list: return array as list or tuple (use_list=False). //| :return object: object read from buffer. //| """ +//| ... //| STATIC mp_obj_t mod_msgpack_unpack(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_buffer, ARG_ext_hook, ARG_use_list }; From 0057e1dc2cf9e848e7aa616f2b4c82e9f61b936a Mon Sep 17 00:00:00 2001 From: Wellington Terumi Uemura Date: Tue, 5 Jan 2021 02:27:28 +0000 Subject: [PATCH 53/82] Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (892 of 892 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/pt_BR/ --- locale/pt_BR.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 43c5626b27..3c6c595620 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-01-01 04:29+0000\n" +"PO-Revision-Date: 2021-01-05 21:03+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -2582,7 +2582,7 @@ msgstr "os dados devem ser de igual comprimento" #: extmod/ulab/code/ndarray.c msgid "data type not understood" -msgstr "" +msgstr "o tipo do dado não foi compreendido" #: py/parsenum.c msgid "decimal numbers not supported" @@ -2898,7 +2898,7 @@ msgstr "as formas de entrada e saída não são compatíveis" #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer, a tuple, or a list" -msgstr "" +msgstr "argumento da entrada deve ser um número inteiro, uma tupla ou uma lista" #: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" @@ -3145,7 +3145,7 @@ msgstr "maxiter pode ser > 0" #: extmod/ulab/code/numerical/numerical.c msgid "median argument must be an ndarray" -msgstr "" +msgstr "o argumento mediano deve ser um ndarray" #: py/runtime.c #, c-format @@ -3730,7 +3730,7 @@ msgstr "Muitos argumentos fornecidos com o formato dado" #: extmod/ulab/code/ulab_create.c msgid "too many dimensions" -msgstr "" +msgstr "dimensões demais" #: extmod/ulab/code/ndarray.c msgid "too many indices" @@ -3743,7 +3743,7 @@ msgstr "valores demais para descompactar (esperado %d)" #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays" -msgstr "" +msgstr "Trapz está definido para arrays 1D" #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" From 794327254e4c80a5d3c462b16a82d8ede1c1da6a Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Mon, 4 Jan 2021 21:13:33 +0000 Subject: [PATCH 54/82] Translated using Weblate (Swedish) Currently translated at 100.0% (892 of 892 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/sv/ --- locale/sv.po | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/locale/sv.po b/locale/sv.po index c3d8c8a702..6a19dc5ad5 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2020-12-28 17:59+0000\n" +"PO-Revision-Date: 2021-01-05 21:03+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -21,12 +21,16 @@ msgid "" "\n" "Code done running.\n" msgstr "" +"\n" +"Koden har kört klart.\n" #: main.c msgid "" "\n" "Code stopped by auto-reload.\n" msgstr "" +"\n" +"Koden stoppades av auto-omladdning.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -546,15 +550,16 @@ msgstr "Anropa super().__init__() innan du använder det ursprungliga objektet." #: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." -msgstr "" +msgstr "Kan bara larma på RTC-IO från djupsömn." #: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on one low pin while others alarm high from deep sleep." msgstr "" +"Kan bara larma från djup sömn på låg för en pinne medan andra larmar på hög." #: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on two low pins from deep sleep." -msgstr "" +msgstr "Kan bara larma från djup sömn på två låga pinnar." #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "Can't set CCCD on local Characteristic" @@ -591,7 +596,7 @@ msgstr "Det går inte att mata ut båda kanalerna på samma pinne" #: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." -msgstr "" +msgstr "Kan bara använda pull på pinne för input." #: shared-module/bitbangio/SPI.c msgid "Cannot read without MISO pin." @@ -639,7 +644,7 @@ msgstr "Det går inte att ändra frekvensen på en timer som redan används" #: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." -msgstr "" +msgstr "Kan inte vakna på nivåskift, enbart nivå." #: shared-module/bitbangio/SPI.c msgid "Cannot write without MOSI pin." @@ -1509,7 +1514,7 @@ msgstr "Endast ett alarm.time kan ställas in." #: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c msgid "Only one alarm.touch alarm can be set." -msgstr "" +msgstr "Endast ett larm av typ alarm.touch kan ställas in." #: shared-module/displayio/ColorConverter.c msgid "Only one color can be transparent at a time" @@ -1621,7 +1626,7 @@ msgstr "" #: main.c msgid "Pretending to deep sleep until alarm, CTRL-C or file write.\n" -msgstr "" +msgstr "Fingerar djup sömn tills larm, Ctrl-C eller filskrivning.\n" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." @@ -2549,7 +2554,7 @@ msgstr "data måste vara av samma längd" #: extmod/ulab/code/ndarray.c msgid "data type not understood" -msgstr "" +msgstr "datatyp inte förstådd" #: py/parsenum.c msgid "decimal numbers not supported" @@ -2865,7 +2870,7 @@ msgstr "indata- och utdataformer är inte kompatibla" #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer, a tuple, or a list" -msgstr "" +msgstr "indataargument måste vara integer, en tuple eller list" #: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" @@ -3112,7 +3117,7 @@ msgstr "maxiter bör vara > 0" #: extmod/ulab/code/numerical/numerical.c msgid "median argument must be an ndarray" -msgstr "" +msgstr "argumentet median måste vara en ndarray" #: py/runtime.c #, c-format @@ -3691,7 +3696,7 @@ msgstr "för många argument för det givna formatet" #: extmod/ulab/code/ulab_create.c msgid "too many dimensions" -msgstr "" +msgstr "för många dimensioner" #: extmod/ulab/code/ndarray.c msgid "too many indices" @@ -3704,7 +3709,7 @@ msgstr "för många värden att packa upp (förväntat %d)" #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays" -msgstr "" +msgstr "trapz är definierat för 1D-matriser" #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" From 9eb2ca02a57cea7ed44f3e144e446cab15a90354 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 5 Jan 2021 22:03:19 +0100 Subject: [PATCH 55/82] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/pt_BR.po | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 3c6c595620..f399ade167 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -2898,7 +2898,8 @@ msgstr "as formas de entrada e saída não são compatíveis" #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer, a tuple, or a list" -msgstr "argumento da entrada deve ser um número inteiro, uma tupla ou uma lista" +msgstr "" +"argumento da entrada deve ser um número inteiro, uma tupla ou uma lista" #: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" From 98c9492a8c5da5a40e92c60e0f891b6c3038355d Mon Sep 17 00:00:00 2001 From: anecdata <16617689+anecdata@users.noreply.github.com> Date: Tue, 5 Jan 2021 18:39:51 -0600 Subject: [PATCH 56/82] change ESP_EARLY_LOG* to ESP_LOG* throughout event_handler --- ports/esp32s2/common-hal/wifi/__init__.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ports/esp32s2/common-hal/wifi/__init__.c b/ports/esp32s2/common-hal/wifi/__init__.c index 878c903521..08d7a164f4 100644 --- a/ports/esp32s2/common-hal/wifi/__init__.c +++ b/ports/esp32s2/common-hal/wifi/__init__.c @@ -47,23 +47,23 @@ static void event_handler(void* arg, esp_event_base_t event_base, if (event_base == WIFI_EVENT) { switch (event_id) { case WIFI_EVENT_SCAN_DONE: - ESP_EARLY_LOGW(TAG, "scan"); + ESP_LOGW(TAG, "scan"); xEventGroupSetBits(radio->event_group_handle, WIFI_SCAN_DONE_BIT); break; case WIFI_EVENT_STA_START: - ESP_EARLY_LOGW(TAG, "start"); + ESP_LOGW(TAG, "start"); break; case WIFI_EVENT_STA_STOP: - ESP_EARLY_LOGW(TAG, "stop"); + ESP_LOGW(TAG, "stop"); break; case WIFI_EVENT_STA_CONNECTED: - ESP_EARLY_LOGW(TAG, "connected"); + ESP_LOGW(TAG, "connected"); break; case WIFI_EVENT_STA_DISCONNECTED: { - ESP_EARLY_LOGW(TAG, "disconnected"); + ESP_LOGW(TAG, "disconnected"); wifi_event_sta_disconnected_t* d = (wifi_event_sta_disconnected_t*) event_data; uint8_t reason = d->reason; - ESP_EARLY_LOGW(TAG, "reason %d 0x%02x", reason, reason); + ESP_LOGW(TAG, "reason %d 0x%02x", reason, reason); if (radio->retries_left > 0 && (reason == WIFI_REASON_AUTH_EXPIRE || reason == WIFI_REASON_NOT_AUTHED || @@ -71,7 +71,7 @@ static void event_handler(void* arg, esp_event_base_t event_base, reason == WIFI_REASON_CONNECTION_FAIL || reason == WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT)) { radio->retries_left--; - ESP_EARLY_LOGI(TAG, "Retrying connect. %d retries remaining", radio->retries_left); + ESP_LOGI(TAG, "Retrying connect. %d retries remaining", radio->retries_left); esp_wifi_connect(); return; } @@ -84,14 +84,14 @@ static void event_handler(void* arg, esp_event_base_t event_base, // Cases to handle later. // case WIFI_EVENT_STA_AUTHMODE_CHANGE: default: { - ESP_EARLY_LOGW(TAG, "event %d 0x%02x", event_id, event_id); + ESP_LOGW(TAG, "event %d 0x%02x", event_id, event_id); break; } } } if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) { - ESP_EARLY_LOGW(TAG, "got ip"); + ESP_LOGW(TAG, "got ip"); radio->retries_left = radio->starting_retries; xEventGroupSetBits(radio->event_group_handle, WIFI_CONNECTED_BIT); } From 9a1d864331effd793b0a95bdac592f04b0032178 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 6 Jan 2021 11:09:06 -0500 Subject: [PATCH 57/82] overflowed tick counter needs 64 bits everywhere --- ports/atmel-samd/supervisor/port.c | 4 ++-- ports/nrf/supervisor/port.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 7d02789e82..b9977fdc46 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -431,7 +431,7 @@ uint32_t port_get_saved_word(void) { static volatile uint64_t overflowed_ticks = 0; static volatile bool _ticks_enabled = false; -static uint32_t _get_count(uint32_t* overflow_count) { +static uint32_t _get_count(uint64_t* overflow_count) { #ifdef SAM_D5X_E5X while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COUNTSYNC | RTC_MODE0_SYNCBUSY_COUNT)) != 0) {} #endif @@ -500,7 +500,7 @@ void RTC_Handler(void) { } uint64_t port_get_raw_ticks(uint8_t* subticks) { - uint32_t overflow_count; + uint64_t overflow_count; uint32_t current_ticks = _get_count(&overflow_count); if (subticks != NULL) { *subticks = (current_ticks % 16) * 2; diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 00485d8588..78bb20ce6c 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -276,7 +276,7 @@ uint32_t port_get_saved_word(void) { uint64_t port_get_raw_ticks(uint8_t* subticks) { common_hal_mcu_disable_interrupts(); uint32_t rtc = nrfx_rtc_counter_get(&rtc_instance); - uint32_t overflow_count = overflow_tracker.overflowed_ticks; + uint64_t overflow_count = overflow_tracker.overflowed_ticks; common_hal_mcu_enable_interrupts(); if (subticks != NULL) { From cdad59fbc2d681d06a21aefedb00a6b6946cce1c Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 6 Jan 2021 09:03:58 -0800 Subject: [PATCH 58/82] Fix doc build with extra blank lines --- shared-bindings/msgpack/__init__.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/shared-bindings/msgpack/__init__.c b/shared-bindings/msgpack/__init__.c index e1b6b8fce6..f5c47bb218 100644 --- a/shared-bindings/msgpack/__init__.c +++ b/shared-bindings/msgpack/__init__.c @@ -41,7 +41,8 @@ //| //| Not implemented: 64-bit int, uint, float. //| -//| Example 1: +//| Example 1:: +//| //| import msgpack //| from io import BytesIO //| @@ -50,7 +51,7 @@ //| b.seek(0) //| print(msgpack.unpack(b)) //| -//| Example 2: handling objects +//| Example 2: handling objects:: //| //| from msgpack import pack, unpack, ExtType //| from io import BytesIO @@ -78,11 +79,13 @@ //| buffer.seek(0) //| decoded = unpack(buffer, ext_hook=decoder) //| print(f"{data} -> {buffer.getvalue()} -> {decoded}") +//| //| """ //| //| def pack(obj: object, buffer: WriteableBuffer, *, default: Union[Callable[[object], None], None] = None) -> None: //| """Ouput object to buffer in msgpack format. +//| //| :param object obj: Object to convert to msgpack format. //| :param ~_typing.WriteableBuffer buffer: buffer to write into //| :param Optional[~_typing.Callable[[object], None]] default: @@ -114,10 +117,12 @@ MP_DEFINE_CONST_FUN_OBJ_KW(mod_msgpack_pack_obj, 1, mod_msgpack_pack); //| def unpack(buffer: ReadableBuffer, *, ext_hook: Union[Callable[[int, bytes], object], None] = None, use_list: bool=True) -> object: //| """Unpack and return one object from buffer. +//| //| :param ~_typing.ReadableBuffer buffer: buffer to read from //| :param Optional[~_typing.Callable[[int, bytes], object]] ext_hook: function called for objects in //| msgpack ext format. //| :param Optional[bool] use_list: return array as list or tuple (use_list=False). +//| //| :return object: object read from buffer. //| """ //| ... From 9db0a4f2658a00e5fd712b5afbffcc36292bb5ba Mon Sep 17 00:00:00 2001 From: caternuson Date: Wed, 6 Jan 2021 09:17:19 -0800 Subject: [PATCH 59/82] add magtag accelo irq pin --- ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c b/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c index 0cefb6dfbc..645dc12a1b 100644 --- a/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c +++ b/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c @@ -49,6 +49,8 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, - { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].epaper_display)} + { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].epaper_display)}, + + { MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_INTERRUPT), MP_ROM_PTR(&pin_GPIO9) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From 66d87782be3793fd179b12fa864e71509f1dbf6f Mon Sep 17 00:00:00 2001 From: BennyE Date: Wed, 6 Jan 2021 23:52:30 +0100 Subject: [PATCH 60/82] Adding authmode keyword --- ports/esp32s2/common-hal/wifi/Network.c | 35 +++++++++++++++++++++++++ shared-bindings/wifi/Network.c | 16 +++++++++++ shared-bindings/wifi/Network.h | 1 + shared-bindings/wifi/Radio.c | 2 +- 4 files changed, 53 insertions(+), 1 deletion(-) diff --git a/ports/esp32s2/common-hal/wifi/Network.c b/ports/esp32s2/common-hal/wifi/Network.c index 2674df0651..0289ad4ebb 100644 --- a/ports/esp32s2/common-hal/wifi/Network.c +++ b/ports/esp32s2/common-hal/wifi/Network.c @@ -54,3 +54,38 @@ mp_obj_t common_hal_wifi_network_get_country(wifi_network_obj_t *self) { // 2 instead of strlen(cstr) as this gives us only the country-code return mp_obj_new_str(cstr, 2); } + +mp_obj_t common_hal_wifi_network_get_authmode(wifi_network_obj_t *self) { + char authmode[16]; + switch (self->record.authmode) { + case WIFI_AUTH_OPEN: + strcpy(authmode, "OPEN"); + break; + case WIFI_AUTH_WEP: + strcpy(authmode, "WEP"); + break; + case WIFI_AUTH_WPA_PSK: + strcpy(authmode, "WPA_PSK"); + break; + case WIFI_AUTH_WPA2_PSK: + strcpy(authmode, "WPA2_PSK"); + break; + case WIFI_AUTH_WPA_WPA2_PSK: + strcpy(authmode, "WPA_WPA2_PSK"); + break; + case WIFI_AUTH_WPA2_ENTERPRISE: + strcpy(authmode, "WPA2_ENTERPRISE"); + break; + case WIFI_AUTH_WPA3_PSK: + strcpy(authmode, "WPA3_PSK"); + break; + case WIFI_AUTH_WPA2_WPA3_PSK: + strcpy(authmode, "WPA2_WPA3_PSK"); + break; + default: + strcpy(authmode, "UNKNOWN"); + break; + } + const char* cstr = (const char*) authmode; + return mp_obj_new_str(cstr, strlen(cstr)); +} diff --git a/shared-bindings/wifi/Network.c b/shared-bindings/wifi/Network.c index 009712ad19..0f3006f2ea 100644 --- a/shared-bindings/wifi/Network.c +++ b/shared-bindings/wifi/Network.c @@ -124,6 +124,21 @@ const mp_obj_property_t wifi_network_country_obj = { (mp_obj_t)&mp_const_none_obj }, }; +//| authmode: str +//| """String id of the authmode""" +//| +STATIC mp_obj_t wifi_network_get_authmode(mp_obj_t self) { + return common_hal_wifi_network_get_authmode(self); + +} +MP_DEFINE_CONST_FUN_OBJ_1(wifi_network_get_authmode_obj, wifi_network_get_authmode); + +const mp_obj_property_t wifi_network_authmode_obj = { + .base.type = &mp_type_property, + .proxy = { (mp_obj_t)&wifi_network_get_authmode_obj, + (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&mp_const_none_obj }, +}; STATIC const mp_rom_map_elem_t wifi_network_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_ssid), MP_ROM_PTR(&wifi_network_ssid_obj) }, @@ -131,6 +146,7 @@ STATIC const mp_rom_map_elem_t wifi_network_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_rssi), MP_ROM_PTR(&wifi_network_rssi_obj) }, { MP_ROM_QSTR(MP_QSTR_channel), MP_ROM_PTR(&wifi_network_channel_obj) }, { MP_ROM_QSTR(MP_QSTR_country), MP_ROM_PTR(&wifi_network_country_obj) }, + { MP_ROM_QSTR(MP_QSTR_authmode), MP_ROM_PTR(&wifi_network_authmode_obj) }, }; STATIC MP_DEFINE_CONST_DICT(wifi_network_locals_dict, wifi_network_locals_dict_table); diff --git a/shared-bindings/wifi/Network.h b/shared-bindings/wifi/Network.h index e672e3108a..0f07e7b555 100644 --- a/shared-bindings/wifi/Network.h +++ b/shared-bindings/wifi/Network.h @@ -40,5 +40,6 @@ extern mp_obj_t common_hal_wifi_network_get_bssid(wifi_network_obj_t *self); extern mp_obj_t common_hal_wifi_network_get_rssi(wifi_network_obj_t *self); extern mp_obj_t common_hal_wifi_network_get_channel(wifi_network_obj_t *self); extern mp_obj_t common_hal_wifi_network_get_country(wifi_network_obj_t *self); +extern mp_obj_t common_hal_wifi_network_get_authmode(wifi_network_obj_t *self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_WIFI_NETWORK_H diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index 723572a321..63f507067a 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -295,7 +295,7 @@ const mp_obj_property_t wifi_radio_ipv4_dns_obj = { }; //| ap_info: Optional[Network] -//| """Network object containing BSSID, SSID, channel, country and RSSI when connected to an access point. None otherwise.""" +//| """Network object containing BSSID, SSID, authmode, channel, country and RSSI when connected to an access point. None otherwise.""" //| STATIC mp_obj_t wifi_radio_get_ap_info(mp_obj_t self) { return common_hal_wifi_radio_get_ap_info(self); From 092331eee148977bef5de974906194e17640257d Mon Sep 17 00:00:00 2001 From: brendan <2bndy5@gmail.com> Date: Wed, 6 Jan 2021 15:19:40 -0800 Subject: [PATCH 61/82] convert esp32s2 readme to rst --- ports/esp32s2/README.md | 84 ----------------------------------- ports/esp32s2/README.rst | 94 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 84 deletions(-) delete mode 100644 ports/esp32s2/README.md create mode 100644 ports/esp32s2/README.rst diff --git a/ports/esp32s2/README.md b/ports/esp32s2/README.md deleted file mode 100644 index f5a2bfe5ca..0000000000 --- a/ports/esp32s2/README.md +++ /dev/null @@ -1,84 +0,0 @@ -# Circuitpython on ESP32-S2 # - -This port adds the ESP32-S2 line of modules from Espressif to Circuitpython. ESP32-S2 modules are low power, single-core Wi-Fi microcontroller SoCs designed for IoT applications. - -## How this port is organized: ## - -- **bindings/** contains some required bindings to the ESP-IDF for exceptions and memory. -- **boards/** contains the configuration files for each development board and breakout available on the port. -- **common-hal/** contains the port-specific module implementations, used by shared-module and shared-bindings. -- **esp-idf/** contains the Espressif IoT development framework installation, including all the drivers for the port. -- **modules/** contains information specific to certain ESP32-S2 hardware modules, such as the pins used for flash and RAM on the WROVER and WROOM. -- **peripherals/** contains peripheral setup files and peripheral mapping information, sorted by family and sub-variant. Most files in this directory can be generated with the python scripts in **tools/**. -- **supervisor/** contains port-specific implementations of internal flash, serial and USB, as well as the **port.c** file, which initializes the port at startup. -- **tools/** includes useful python scripts for debugging and other purposes. - -At the root level, refer to **mpconfigboard.h** and **mpconfigport.mk** for port specific settings and a list of enabled circuitpython modules. - -## Connecting to the ESP32-S2 ## - -The USB port built into ESP32-S2 boards such as the Saola is not the native USB of the board, but a debugging and programming interface. The actual ESP32-S2 native USB which exposes the Circuitpython drive and CDC connection is located on IO pins 19 and 20: - -| GPIO | USB | -| ---- | ----------- | -| 20 | D+ (green) | -| 19 | D- (white) | -| GND | GND (black) | -| 5V | +5V (red) | - -Connect these pins using a [USB adapter](https://www.adafruit.com/product/4090) or [breakout cable](https://www.adafruit.com/product/4448) to access the Circuitpython drive. - -## Building and flashing ## - -Before building or flashing the ESP32-S2, you must [install the esp-idf](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/get-started/index.html). This must be re-done every time the esp-idf is updated, but not every time you build. Run `cd ports/esp32s2` from `circuitpython/` to move to the esp32s2 port root, and run: - -``` -./esp-idf/install.sh -``` - -After this initial installation, you must add the esp-idf tools to your path. You must also do this **any time you open a new bash environment for building or flashing**: - -``` -. esp-idf/export.sh -``` - -When Circuitpython updates the ESP-IDF to a new release, you may need to run this installation process again. The exact commands used may also vary based on your bash environment. - -Building boards such as the Saola is typically done through `make flash`. The default port is `tty.SLAB_USBtoUART`, which will only work on certain Mac setups. On most machines, both Mac and Linux, you will need to set the port yourself by running `ls /dev/tty.usb*` and selecting the one that only appears when your development board is plugged in. An example make command with the port setting is as follows: - -``` -make BOARD=espressif_saola_1_wrover flash PORT=/dev/tty.usbserial-1421120 -``` - -## Debugging ## - -The ESP32-S2 supports JTAG debugging over OpenOCD using a JLink or other probe hardware. The official tutorials can be found on the Espressif website [here](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/api-guides/jtag-debugging/index.html), but they are mostly for the ESP32-S2 Kaluga, which has built-in debugging. - -OpenOCD is automatically installed and added to your bash environment during the esp-idf installation and setup process. You can double check that it is installed by using `openocd --version`, as per the tutorial. Attach the JTAG probe pins according to the [instructions](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/api-guides/jtag-debugging/configure-other-jtag.html) for JTAG debugging on boards that do not contain an integrated debugger. - -Once the debugger is connected physically, you must run OpenOCD with attached configuration files specifying the **interface** (your debugger probe) and either a **target** or a **board** (targets are for SoCs only, and can be used when a full board configuration file doesn't exist). You can find the path location of these files by checking the `OPENOCD_SCRIPTS` environmental variable by running `echo $OPENOCD_SCRIPTS` in bash. Interfaces will be in the `interface/` directory, and targets and boards in the `target/` and `board/` directories, respectively. - -**Note:** Unfortunately, there are no board files for the esp32-s2 other than the Kaluga, and the included `target/esp32s2.cfg` target file will not work by default on the Jlink for boards like the Saola 1, as the default speed is incorrect. In addition, these files are covered under the GPL and cannot be included in Circuitpython. Thus, you must make a copy of the esp32s2.cfg file yourself and add the following line manually, under `transport select jtag` at the start of the file: - -``` -adapter_khz 1000 -``` - -Once this is complete, your final OpenOCD command may look something like this: - -`openocd -f interface/jlink.cfg -f SOMEPATH/copied-esp32s2-saola-1.cfg` - -Where `SOMEPATH` is the location of your copied configuration file (this can be placed in the port/boards director with a prefix to ignore it with `.gitignore`, for instance). Interface, target and board config files sourced from espressif only need their paths from the $OPENOCD_SCRIPTS location, you don't need to include their full path. Once OpenOCD is running, connect to GDB with: - -`xtensa-esp32s2-elf-gdb build-espressif_saola_1_wrover/firmware.elf` - -And follow the Espressif GDB tutorial [instructions](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/api-guides/jtag-debugging/using-debugger.html) for connecting, or add them to your `gdbinit`: - -``` -target remote :3333 -set remote hardware-watchpoint-limit 2 -mon reset halt -flushregs -thb app_main -c -``` diff --git a/ports/esp32s2/README.rst b/ports/esp32s2/README.rst new file mode 100644 index 0000000000..d62e336795 --- /dev/null +++ b/ports/esp32s2/README.rst @@ -0,0 +1,94 @@ +Circuitpython on ESP32-S2 +======================================= + +This port adds the ESP32-S2 line of modules from Espressif to Circuitpython. ESP32-S2 modules are low power, single-core Wi-Fi microcontroller SoCs designed for IoT applications. + +How this port is organized: +--------------------------------------- + +- **bindings/** contains some required bindings to the ESP-IDF for exceptions and memory. +- **boards/** contains the configuration files for each development board and breakout available on the port. +- **common-hal/** contains the port-specific module implementations, used by shared-module and shared-bindings. +- **esp-idf/** contains the Espressif IoT development framework installation, including all the drivers for the port. +- **modules/** contains information specific to certain ESP32-S2 hardware modules, such as the pins used for flash and RAM on the WROVER and WROOM. +- **peripherals/** contains peripheral setup files and peripheral mapping information, sorted by family and sub-variant. Most files in this directory can be generated with the python scripts in **tools/**. +- **supervisor/** contains port-specific implementations of internal flash, serial and USB, as well as the **port.c** file, which initializes the port at startup. +- **tools/** includes useful python scripts for debugging and other purposes. + +At the root level, refer to **mpconfigboard.h** and **mpconfigport.mk** for port specific settings and a list of enabled circuitpython modules. + +Connecting to the ESP32-S2 +--------------------------------------- + +The USB port built into ESP32-S2 boards such as the Saola is not the native USB of the board, but a debugging and programming interface. The actual ESP32-S2 native USB which exposes the Circuitpython drive and CDC connection is located on IO pins 19 and 20: + +.. csv-table:: + :header: GPIO, USB + + 20, "D+ (green)" + 19, "D- (white)" + GND, "GND (black)" + 5V, "+5V (red)" + +Connect these pins using a `USB adapter `_ or `breakout cable `_ to access the Circuitpython drive. + +Building and flashing +--------------------------------------- + +Before building or flashing the ESP32-S2, you must `install the esp-idf `_. This must be re-done every time the esp-idf is updated, but not every time you build. Run ``cd ports/esp32s2`` from ``circuitpython/`` to move to the esp32s2 port root, and run: + +.. code-block:: + + ./esp-idf/install.sh + +After this initial installation, you must add the esp-idf tools to your path. You must also do this **any time you open a new bash environment for building or flashing**: + +.. code-block:: + + . esp-idf/export.sh + +When Circuitpython updates the ESP-IDF to a new release, you may need to run this installation process again. The exact commands used may also vary based on your bash environment. + +Building boards such as the Saola is typically done through ``make flash``. The default port is ``tty.SLAB_USBtoUART``, which will only work on certain Mac setups. On most machines, both Mac and Linux, you will need to set the port yourself by running ``ls /dev/tty.usb*`` and selecting the one that only appears when your development board is plugged in. An example make command with the port setting is as follows: + +.. code-block:: + + make BOARD=espressif_saola_1_wrover flash PORT=/dev/tty.usbserial-1421120 + +Debugging +--------------------------------------- + +The ESP32-S2 supports JTAG debugging over OpenOCD using a JLink or other probe hardware. The official tutorials can be found on the Espressif website `here `_, but they are mostly for the ESP32-S2 Kaluga, which has built-in debugging. + +OpenOCD is automatically installed and added to your bash environment during the esp-idf installation and setup process. You can double check that it is installed by using ``openocd --version``, as per the tutorial. Attach the JTAG probe pins according to the `instructions for JTAG debugging `_ on boards that do not contain an integrated debugger. + +Once the debugger is connected physically, you must run OpenOCD with attached configuration files specifying the **interface** (your debugger probe) and either a **target** or a **board** (targets are for SoCs only, and can be used when a full board configuration file doesn't exist). You can find the path location of these files by checking the ``OPENOCD_SCRIPTS`` environmental variable by running ``echo $OPENOCD_SCRIPTS`` in bash. Interfaces will be in the ``interface/`` directory, and targets and boards in the ``target/`` and ``board/`` directories, respectively. + +**Note:** Unfortunately, there are no board files for the esp32-s2 other than the Kaluga, and the included ``target/esp32s2.cfg`` target file will not work by default on the Jlink for boards like the Saola 1, as the default speed is incorrect. In addition, these files are covered under the GPL and cannot be included in Circuitpython. Thus, you must make a copy of the esp32s2.cfg file yourself and add the following line manually, under ``transport select jtag`` at the start of the file: + +.. code-block:: + + adapter_khz 1000 + +Once this is complete, your final OpenOCD command may look something like this: + +.. code-block:: + + openocd -f interface/jlink.cfg -f SOMEPATH/copied-esp32s2-saola-1.cfg + +Where `SOMEPATH` is the location of your copied configuration file (this can be placed in the port/boards directory with a prefix to ignore it with `.gitignore`, for instance). Interface, target and board config files sourced from espressif only need their paths from the $OPENOCD_SCRIPTS location, you don't need to include their full path. Once OpenOCD is running, connect to GDB with: + +.. code-block:: + + xtensa-esp32s2-elf-gdb build-espressif_saola_1_wrover/firmware.elf + +And follow the Espressif GDB tutorial `instructions for connecting `_, or add them to your ``gdbinit``: + +.. code-block:: + + target remote :3333 + set remote hardware-watchpoint-limit 2 + mon reset halt + flushregs + thb app_main + c From 18122e0455023070e64fa6be9b07afbd28da894d Mon Sep 17 00:00:00 2001 From: brendan <2bndy5@gmail.com> Date: Wed, 6 Jan 2021 15:28:19 -0800 Subject: [PATCH 62/82] missed a couple inline code snippets --- ports/esp32s2/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32s2/README.rst b/ports/esp32s2/README.rst index d62e336795..827aba41b7 100644 --- a/ports/esp32s2/README.rst +++ b/ports/esp32s2/README.rst @@ -76,7 +76,7 @@ Once this is complete, your final OpenOCD command may look something like this: openocd -f interface/jlink.cfg -f SOMEPATH/copied-esp32s2-saola-1.cfg -Where `SOMEPATH` is the location of your copied configuration file (this can be placed in the port/boards directory with a prefix to ignore it with `.gitignore`, for instance). Interface, target and board config files sourced from espressif only need their paths from the $OPENOCD_SCRIPTS location, you don't need to include their full path. Once OpenOCD is running, connect to GDB with: +Where ``SOMEPATH`` is the location of your copied configuration file (this can be placed in the port/boards directory with a prefix to ignore it with ``.gitignore``, for instance). Interface, target and board config files sourced from espressif only need their paths from the $OPENOCD_SCRIPTS location, you don't need to include their full path. Once OpenOCD is running, connect to GDB with: .. code-block:: From 30ed8d136cea63eda2b518c3bbdfde2d79d9bf2c Mon Sep 17 00:00:00 2001 From: Hugo Dahl Date: Wed, 6 Jan 2021 00:59:12 +0000 Subject: [PATCH 63/82] Translated using Weblate (French) Currently translated at 100.0% (892 of 892 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/fr/ --- locale/fr.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/locale/fr.po b/locale/fr.po index 187ee6f92d..e898631ea9 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-01-01 04:29+0000\n" +"PO-Revision-Date: 2021-01-07 01:29+0000\n" "Last-Translator: Hugo Dahl \n" "Language: fr\n" "MIME-Version: 1.0\n" @@ -2595,7 +2595,7 @@ msgstr "les données doivent être de longueur égale" #: extmod/ulab/code/ndarray.c msgid "data type not understood" -msgstr "" +msgstr "le type de donnée n'est pas reconnu" #: py/parsenum.c msgid "decimal numbers not supported" @@ -2913,7 +2913,7 @@ msgstr "les formes d'entrée et de sortie ne sont pas compatibles" #: extmod/ulab/code/ulab_create.c msgid "input argument must be an integer, a tuple, or a list" -msgstr "" +msgstr "Paramètre entrant doit être un chiffre entier, un tuple, ou une liste" #: extmod/ulab/code/fft/fft.c msgid "input array length must be power of 2" @@ -3161,7 +3161,7 @@ msgstr "maxiter devrait être > 0" #: extmod/ulab/code/numerical/numerical.c msgid "median argument must be an ndarray" -msgstr "" +msgstr "Paramètre pour median doit être un ndarray" #: py/runtime.c #, c-format @@ -3745,7 +3745,7 @@ msgstr "trop d'arguments fournis avec ce format" #: extmod/ulab/code/ulab_create.c msgid "too many dimensions" -msgstr "" +msgstr "Trop de dimensions" #: extmod/ulab/code/ndarray.c msgid "too many indices" @@ -3758,7 +3758,7 @@ msgstr "trop de valeur à dégrouper (%d attendues)" #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays" -msgstr "" +msgstr "trapz est défini pour tableaux à une dimension" #: extmod/ulab/code/approx/approx.c msgid "trapz is defined for 1D arrays of equal length" From a03f35e093e8c54da0a5781988596694c2f81e6c Mon Sep 17 00:00:00 2001 From: Dennis Schweer Date: Thu, 7 Jan 2021 15:49:14 +0000 Subject: [PATCH 64/82] Translated using Weblate (German) Currently translated at 84.4% (753 of 892 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/de/ --- locale/de_DE.po | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index 0dd7119993..a1d0726433 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -6,20 +6,22 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2020-11-26 03:11+0000\n" -"Last-Translator: Daniel Bravo Darriba \n" +"PO-Revision-Date: 2021-01-07 18:01+0000\n" +"Last-Translator: Dennis Schweer \n" "Language: de_DE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.4-dev\n" +"X-Generator: Weblate 4.4.1-dev\n" #: main.c msgid "" "\n" "Code done running.\n" msgstr "" +"\n" +"Programm wird ausgeführt.\n" #: main.c msgid "" @@ -129,7 +131,7 @@ msgstr "'%q' Objekt unterstützt '%q' nicht" #: py/obj.c msgid "'%q' object does not support item assignment" -msgstr "" +msgstr "'%q' Objekt unterschützt keine Elementzuweisung" #: py/obj.c msgid "'%q' object does not support item deletion" @@ -141,7 +143,7 @@ msgstr "'%q' Objekt hat kein Attribut '%q'" #: py/runtime.c msgid "'%q' object is not an iterator" -msgstr "" +msgstr "'%q' Objekt ist kein Iterator" #: py/objtype.c py/runtime.c msgid "'%q' object is not callable" @@ -235,7 +237,7 @@ msgstr "'continue' außerhalb einer Schleife" #: py/objgenerator.c msgid "'coroutine' object is not an iterator" -msgstr "" +msgstr "'coroutine' Objekt ist kein Iterator" #: py/compile.c msgid "'data' requires at least 2 arguments" @@ -307,7 +309,7 @@ msgstr "Alle I2C-Peripheriegeräte sind in Benutzung" #: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c #: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c msgid "All PCNT units in use" -msgstr "" +msgstr "Alle PCNT Einheiten sind in Benutzung" #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/esp32s2/common-hal/canio/Listener.c @@ -710,7 +712,7 @@ msgstr "Konnte Kamera nicht initialisieren" #: ports/cxd56/common-hal/gnss/GNSS.c msgid "Could not initialize GNSS" -msgstr "" +msgstr "GNSS konnte nicht initialisiert werden" #: ports/cxd56/common-hal/sdioio/SDCard.c msgid "Could not initialize SDCard" @@ -837,7 +839,7 @@ msgstr "Die EZB arbeitet jeweils nur mit 16 Bytes" #: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" -msgstr "" +msgstr "ESP-IDF Speicherallozierung fehlgeschlagen" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c #: ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -903,7 +905,7 @@ msgstr "FFT ist nur für ndarrays definiert" #: extmod/ulab/code/fft/fft.c msgid "FFT is implemented for linear arrays only" -msgstr "" +msgstr "FFT ist nur für lineare Arrays implementiert" #: ports/esp32s2/common-hal/socketpool/Socket.c msgid "Failed SSL handshake" @@ -934,7 +936,7 @@ msgstr "Konnte keine RX Buffer mit %d allozieren" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" -msgstr "" +msgstr "Zuweisung des Wifi Speichers ist fehlgeschlagen" #: ports/esp32s2/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" @@ -950,7 +952,7 @@ msgstr "Verbindung nicht erfolgreich: timeout" #: ports/esp32s2/common-hal/wifi/__init__.c msgid "Failed to init wifi" -msgstr "" +msgstr "Wifi Initialisierung ist fehlgeschlagen" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" @@ -1037,7 +1039,7 @@ msgstr "I2SOut nicht verfügbar" #: ports/esp32s2/common-hal/alarm/pin/__init__.c msgid "IOs 0, 2 & 4 do not support internal pullup in sleep" -msgstr "" +msgstr "IOs 0, 2 & 4 unterstützen keinen internen Pull up im sleep-Modus" #: shared-bindings/aesio/aes.c #, c-format @@ -1058,7 +1060,7 @@ msgstr "Inkorrekte Puffergröße" #: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" -msgstr "" +msgstr "Initialisierung aufgrund von Speichermangel fehlgeschlagen" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" @@ -3858,7 +3860,7 @@ msgstr "nicht unterstütztes Formatzeichen '%c' (0x%x) bei Index %d" #: py/runtime.c msgid "unsupported type for %q: '%q'" -msgstr "" +msgstr "nicht unterstützer Typ für %q: '%q'" #: py/runtime.c msgid "unsupported type for operator" @@ -3866,7 +3868,7 @@ msgstr "nicht unterstützter Typ für Operator" #: py/runtime.c msgid "unsupported types for %q: '%q', '%q'" -msgstr "" +msgstr "nicht unterstützte Typen für %q: '%q', '%q'" #: py/objint.c #, c-format @@ -3911,7 +3913,7 @@ msgstr "" #: extmod/ulab/code/vector/vectorise.c msgid "wrong input type" -msgstr "" +msgstr "falscher Eingabetyp" #: extmod/ulab/code/ulab_create.c py/objstr.c msgid "wrong number of arguments" @@ -3927,7 +3929,7 @@ msgstr "falscher Operandentyp" #: extmod/ulab/code/vector/vectorise.c msgid "wrong output type" -msgstr "" +msgstr "Falscher Ausgabetyp" #: shared-module/displayio/Shape.c msgid "x value out of bounds" From e4129ecf00071a8b7b9f2b97f0522ba6bbeb0253 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 7 Jan 2021 14:40:11 -0600 Subject: [PATCH 65/82] Makefile: Remove POT-Creation-Date from circuitpython.pot This line is only a magnet for conflicts; the date that circuitpython.pot was modified can be extracted from git metadata. Additionally, when we add "make translate" checking to pre-commit, this will avoid spurious changes since the most straightforward implementation would otherwise update this line every time pre-commit executed. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a1807c308f..adb206d7bc 100644 --- a/Makefile +++ b/Makefile @@ -222,7 +222,7 @@ pseudoxml: all-source: locale/circuitpython.pot: all-source - find $(TRANSLATE_SOURCES) -type d \( $(TRANSLATE_SOURCES_EXC) \) -prune -o -type f \( -iname "*.c" -o -iname "*.h" \) -print | (LC_ALL=C sort) | xgettext -f- -L C -s --add-location=file --keyword=translate -o circuitpython.pot -p locale + find $(TRANSLATE_SOURCES) -type d \( $(TRANSLATE_SOURCES_EXC) \) -prune -o -type f \( -iname "*.c" -o -iname "*.h" \) -print | (LC_ALL=C sort) | xgettext -f- -L C -s --add-location=file --keyword=translate -o - | sed -e '/"POT-Creation-Date: /d' > $@ # Historically, `make translate` updated the .pot file and ran msgmerge. # However, this was a frequent source of merge conflicts. Weblate can perform From e79ee785ac45abc1ee53d9cdbfd30f2290ee7bd9 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 7 Jan 2021 14:40:51 -0600 Subject: [PATCH 66/82] circuitpython.pot: regenerate without timestamp --- locale/circuitpython.pot | 1 - 1 file changed, 1 deletion(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index f319b82f8b..63dc92d18a 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,6 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-01-04 12:55-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" From 1dda33dc418cae1a0047df0241762ebdb3d87e8a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 7 Jan 2021 14:41:11 -0600 Subject: [PATCH 67/82] pre-commit: Add checking of 'make translate' status .. when this check completes with an error, circuitpython.pot has been updated and the changes can be staged. --- .pre-commit-config.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 322f37da46..82d89eaa3e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,3 +11,10 @@ repos: exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|ports/esp32s2/esp-idf-config/.*|ports/esp32s2/boards/.*/sdkconfig)' - id: trailing-whitespace exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*)' +- repo: local + hooks: + - id: translations + name: Check Translations + entry: sh -c "make translate" + language: system + always_run: true From 115f3e08677520806b95dfc92e4462d119854023 Mon Sep 17 00:00:00 2001 From: BennyE Date: Thu, 7 Jan 2021 23:05:16 +0100 Subject: [PATCH 68/82] Updated code as per helpful suggestion --- ports/esp32s2/common-hal/wifi/Network.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ports/esp32s2/common-hal/wifi/Network.c b/ports/esp32s2/common-hal/wifi/Network.c index 0289ad4ebb..83c675a190 100644 --- a/ports/esp32s2/common-hal/wifi/Network.c +++ b/ports/esp32s2/common-hal/wifi/Network.c @@ -56,34 +56,34 @@ mp_obj_t common_hal_wifi_network_get_country(wifi_network_obj_t *self) { } mp_obj_t common_hal_wifi_network_get_authmode(wifi_network_obj_t *self) { - char authmode[16]; + const char* authmode = ""; switch (self->record.authmode) { case WIFI_AUTH_OPEN: - strcpy(authmode, "OPEN"); + authmode = "OPEN"; break; case WIFI_AUTH_WEP: - strcpy(authmode, "WEP"); + authmode = "WEP"; break; case WIFI_AUTH_WPA_PSK: - strcpy(authmode, "WPA_PSK"); + authmode = "WPA_PSK"; break; case WIFI_AUTH_WPA2_PSK: - strcpy(authmode, "WPA2_PSK"); + authmode = "WPA2_PSK"; break; case WIFI_AUTH_WPA_WPA2_PSK: - strcpy(authmode, "WPA_WPA2_PSK"); + authmode = "WPA_WPA2_PSK"; break; case WIFI_AUTH_WPA2_ENTERPRISE: - strcpy(authmode, "WPA2_ENTERPRISE"); + authmode = "WPA2_ENTERPRISE"; break; case WIFI_AUTH_WPA3_PSK: - strcpy(authmode, "WPA3_PSK"); + authmode = "WPA3_PSK"; break; case WIFI_AUTH_WPA2_WPA3_PSK: - strcpy(authmode, "WPA2_WPA3_PSK"); + authmode = "WPA2_WPA3_PSK"; break; default: - strcpy(authmode, "UNKNOWN"); + authmode = "UNKNOWN"; break; } const char* cstr = (const char*) authmode; From 39c166ba6a72d6e95aaf2865ff3e7cade39d04a2 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 8 Jan 2021 13:30:11 -0500 Subject: [PATCH 69/82] update tinyusb; _ticks_enabled only for SAMD21 --- lib/tinyusb | 2 +- ports/atmel-samd/supervisor/port.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/tinyusb b/lib/tinyusb index 218b80e63a..cfcffe94ce 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit 218b80e63ab6ff87c1851e403f08b3d716d68f5e +Subproject commit cfcffe94ce62f5ef1fb5aef4641924d64dc4b1c0 diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index b9977fdc46..02b9e38743 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -429,7 +429,9 @@ uint32_t port_get_saved_word(void) { // TODO: Move this to an RTC backup register so we can preserve it when only the BACKUP power domain // is enabled. static volatile uint64_t overflowed_ticks = 0; +#ifdef SAMD21 static volatile bool _ticks_enabled = false; +#endif static uint32_t _get_count(uint64_t* overflow_count) { #ifdef SAM_D5X_E5X @@ -537,9 +539,11 @@ void port_disable_tick(void) { // they'll wake us up earlier. If we don't, we'll mess up ticks by overwriting // the next RTC wake up time. void port_interrupt_after_ticks(uint32_t ticks) { + #ifdef SAMD21 if (_ticks_enabled) { return; } + #endif _port_interrupt_after_ticks(ticks); } From 7556f38f04d641445a484133696664fc781a5c58 Mon Sep 17 00:00:00 2001 From: jerryneedell Date: Fri, 8 Jan 2021 14:40:06 -0500 Subject: [PATCH 70/82] initialize LDO2 in board_init() --- ports/esp32s2/boards/unexpectedmaker_feathers2/board.c | 8 ++++++++ ports/esp32s2/common-hal/microcontroller/Pin.c | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/board.c b/ports/esp32s2/boards/unexpectedmaker_feathers2/board.c index d8fd3a0a2b..ac08190a5b 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/board.c +++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/board.c @@ -27,6 +27,8 @@ #include "supervisor/board.h" #include "mpconfigboard.h" #include "shared-bindings/microcontroller/Pin.h" +#include "components/driver/include/driver/gpio.h" +#include "components/soc/include/hal/gpio_hal.h" void board_init(void) { // USB @@ -47,6 +49,12 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO30); common_hal_never_reset_pin(&pin_GPIO31); common_hal_never_reset_pin(&pin_GPIO32); + + + // Add LDO2 to never reset list, set to output and enable + common_hal_never_reset_pin(&pin_GPIO21); + gpio_set_direction(pin_GPIO21.number, GPIO_MODE_DEF_OUTPUT); + gpio_set_level(pin_GPIO21.number, true); } bool board_requests_safe_mode(void) { diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.c b/ports/esp32s2/common-hal/microcontroller/Pin.c index fd01d68e1f..66677d1ea1 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.c +++ b/ports/esp32s2/common-hal/microcontroller/Pin.c @@ -171,7 +171,8 @@ bool pin_number_is_free(gpio_num_t pin_number) { uint8_t offset = pin_number / 32; uint32_t mask = 1 << (pin_number % 32); - return (never_reset_pins[offset] & mask) == 0 && (in_use[offset] & mask) == 0; + //return (never_reset_pins[offset] & mask) == 0 && (in_use[offset] & mask) == 0; + return (in_use[offset] & mask) == 0; } bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t *pin) { From de5b138dcffce7c8f7cf8d30321713ee82ce995c Mon Sep 17 00:00:00 2001 From: jerryneedell Date: Fri, 8 Jan 2021 14:46:37 -0500 Subject: [PATCH 71/82] remove commented line --- ports/esp32s2/common-hal/microcontroller/Pin.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.c b/ports/esp32s2/common-hal/microcontroller/Pin.c index 66677d1ea1..6889720e84 100644 --- a/ports/esp32s2/common-hal/microcontroller/Pin.c +++ b/ports/esp32s2/common-hal/microcontroller/Pin.c @@ -171,7 +171,6 @@ bool pin_number_is_free(gpio_num_t pin_number) { uint8_t offset = pin_number / 32; uint32_t mask = 1 << (pin_number % 32); - //return (never_reset_pins[offset] & mask) == 0 && (in_use[offset] & mask) == 0; return (in_use[offset] & mask) == 0; } From 06ab848a0d78594d17b49022174bf0e023b68c60 Mon Sep 17 00:00:00 2001 From: anecdata <16617689+anecdata@users.noreply.github.com> Date: Fri, 8 Jan 2021 16:48:25 -0600 Subject: [PATCH 72/82] added platform --- ports/esp32s2/mpconfigport.h | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/esp32s2/mpconfigport.h b/ports/esp32s2/mpconfigport.h index db7393d8ef..9c0fd9da3e 100644 --- a/ports/esp32s2/mpconfigport.h +++ b/ports/esp32s2/mpconfigport.h @@ -32,6 +32,7 @@ #define MICROPY_PY_UJSON (1) #define MICROPY_USE_INTERNAL_PRINTF (0) +#define MICROPY_PY_SYS_PLATFORM "Espressif ESP32-S2" #include "py/circuitpy_mpconfig.h" From 7b4558b750df85026e1801bb661343101da9df5a Mon Sep 17 00:00:00 2001 From: Caio Henrique de Queiroz Katayama Date: Fri, 8 Jan 2021 19:17:17 -0500 Subject: [PATCH 73/82] Fix socket.recvfrom_into() --- ports/esp32s2/common-hal/socketpool/Socket.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ports/esp32s2/common-hal/socketpool/Socket.c b/ports/esp32s2/common-hal/socketpool/Socket.c index 32c5fc72f2..5e943f8fd0 100644 --- a/ports/esp32s2/common-hal/socketpool/Socket.c +++ b/ports/esp32s2/common-hal/socketpool/Socket.c @@ -178,7 +178,7 @@ mp_uint_t common_hal_socketpool_socket_recvfrom_into(socketpool_socket_obj_t* se struct sockaddr_in source_addr; socklen_t socklen = sizeof(source_addr); - int bytes_received = lwip_recvfrom(self->num, buf, len - 1, 0, (struct sockaddr *)&source_addr, &socklen); + int bytes_received = lwip_recvfrom(self->num, buf, len, 0, (struct sockaddr *)&source_addr, &socklen); memcpy((void *)ip, (void*)&source_addr.sin_addr.s_addr, sizeof source_addr.sin_addr.s_addr); *port = source_addr.sin_port; @@ -186,10 +186,9 @@ mp_uint_t common_hal_socketpool_socket_recvfrom_into(socketpool_socket_obj_t* se if (bytes_received < 0) { mp_raise_BrokenPipeError(); return 0; - } else { - buf[bytes_received] = 0; // Null-terminate whatever we received - return bytes_received; } + + return bytes_received; } void common_hal_socketpool_socket_close(socketpool_socket_obj_t* self) { From 96dd3d3fef30ce632312ba592b84e2b9f5d84399 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 8 Jan 2021 18:21:27 -0600 Subject: [PATCH 74/82] ensure gettext program is available to pre-commit --- .github/workflows/pre-commit.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 8caf56d268..20c76c1249 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -15,6 +15,8 @@ jobs: steps: - uses: actions/checkout@v1 - uses: actions/setup-python@v1 + - name: Install deps + run: sudo apt-get update && sudo apt-get install -y gettext - name: set PY run: echo >>$GITHUB_ENV PY="$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" - uses: actions/cache@v1 From 288c54c70a8b6a6682ae9ac8c0a5483c3968d433 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 8 Jan 2021 18:54:02 -0600 Subject: [PATCH 75/82] need to find strings in ulab --- .github/workflows/pre-commit.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 20c76c1249..af62072c89 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -17,6 +17,8 @@ jobs: - uses: actions/setup-python@v1 - name: Install deps run: sudo apt-get update && sudo apt-get install -y gettext + - name: Populate selected submodules + run: git submodule update --init extmod/ulab - name: set PY run: echo >>$GITHUB_ENV PY="$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" - uses: actions/cache@v1 From dd10c534c526b8c8709127e7f13fbdad71a47c39 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 8 Jan 2021 22:32:23 -0500 Subject: [PATCH 76/82] restore len(alarm.sleep_memory) and bool(alarm.sleep_memory) --- shared-bindings/alarm/SleepMemory.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/shared-bindings/alarm/SleepMemory.c b/shared-bindings/alarm/SleepMemory.c index bec0b76658..aed24827ad 100644 --- a/shared-bindings/alarm/SleepMemory.c +++ b/shared-bindings/alarm/SleepMemory.c @@ -53,6 +53,25 @@ //| """Not used. Access the sole instance through `alarm.sleep_memory`.""" //| ... //| +//| def __bool__(self) -> bool: +//| """``sleep_memory`` is ``True`` if its length is greater than zero. +//| This is an easy way to check for its existence. +//| """ +//| ... +//| +//| def __len__(self) -> int: +//| """Return the length. This is used by (`len`)""" +//| ... +//| +STATIC mp_obj_t alarm_sleep_memory_unary_op(mp_unary_op_t op, mp_obj_t self_in) { + alarm_sleep_memory_obj_t *self = MP_OBJ_TO_PTR(self_in); + uint16_t len = common_hal_alarm_sleep_memory_get_length(self); + switch (op) { + case MP_UNARY_OP_BOOL: return mp_obj_new_bool(len != 0); + case MP_UNARY_OP_LEN: return MP_OBJ_NEW_SMALL_INT(len); + default: return MP_OBJ_NULL; // op not supported + } +} STATIC const mp_rom_map_elem_t alarm_sleep_memory_locals_dict_table[] = { }; @@ -154,6 +173,7 @@ const mp_obj_type_t alarm_sleep_memory_type = { { &mp_type_type }, .name = MP_QSTR_SleepMemory, .subscr = alarm_sleep_memory_subscr, + .unary_op = alarm_sleep_memory_unary_op, .print = NULL, .locals_dict = (mp_obj_t)&alarm_sleep_memory_locals_dict, }; From 255ffa979cd62063bcbabbc64e3c4fb8d1c0f216 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 8 Jan 2021 22:16:58 -0500 Subject: [PATCH 77/82] avoid inline compile errors --- py/circuitpy_defns.mk | 8 ++++++++ supervisor/shared/translate.c | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index d6d192a957..8e8751036d 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -58,6 +58,14 @@ BASE_CFLAGS = \ # -H +# Set a global CIRCUITPY_DEBUG flag. +# Don't just call it "DEBUG": too many libraries use plain DEBUG. +ifneq ($(DEBUG),) +CFLAGS += -DCIRCUITPY_DEBUG=$(DEBUG) +else +CFLAGS += -DCIRCUITPY_DEBUG=0 +endif + ### # Handle frozen modules. diff --git a/supervisor/shared/translate.c b/supervisor/shared/translate.c index 44544c98dd..8bd3c5acde 100644 --- a/supervisor/shared/translate.c +++ b/supervisor/shared/translate.c @@ -122,7 +122,12 @@ char* decompress(const compressed_string_t* compressed, char* decompressed) { return decompressed; } -inline __attribute__((always_inline)) const compressed_string_t* translate(const char* original) { +inline +// gcc10 -flto has issues with this being always_inline for debug builds. +#if CIRCUITPY_DEBUG < 1 + __attribute__((always_inline)) +#endif +const compressed_string_t* translate(const char* original) { #ifndef NO_QSTR #define QDEF(id, str) #define TRANSLATION(id, firstbyte, ...) if (strcmp(original, id) == 0) { static const compressed_string_t v = { .data = firstbyte, .tail = { __VA_ARGS__ } }; return &v; } else From 13efbf24e58b2be940cad44e4f0816d6daa67202 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sat, 9 Jan 2021 10:33:56 -0600 Subject: [PATCH 78/82] disable msgpack on boards without room --- ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk | 1 + ports/atmel-samd/boards/stackrduino_m0_pro/mpconfigboard.mk | 1 + ports/nrf/boards/pca10100/mpconfigboard.mk | 1 + 3 files changed, 3 insertions(+) diff --git a/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk b/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk index a63f142742..8773c5771d 100644 --- a/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk +++ b/ports/atmel-samd/boards/qtpy_m0_haxpress/mpconfigboard.mk @@ -17,6 +17,7 @@ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_MSGPACK = 0 SUPEROPT_GC = 0 diff --git a/ports/atmel-samd/boards/stackrduino_m0_pro/mpconfigboard.mk b/ports/atmel-samd/boards/stackrduino_m0_pro/mpconfigboard.mk index 704d265141..734be2d145 100644 --- a/ports/atmel-samd/boards/stackrduino_m0_pro/mpconfigboard.mk +++ b/ports/atmel-samd/boards/stackrduino_m0_pro/mpconfigboard.mk @@ -16,6 +16,7 @@ CIRCUITPY_BITBANGIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_MSGPACK = 0 CIRCUITPY_VECTORIO = 0 CIRCUITPY_BUSDEVICE = 0 diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk index 86ba654548..76d15e6081 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.mk +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -15,6 +15,7 @@ CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_MSGPACK = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_PIXELBUF = 0 From 908e02439d79b7dd9d29f7465833aead504c257c Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sat, 9 Jan 2021 15:04:23 -0500 Subject: [PATCH 79/82] Look up TCC resolution as necessary --- ports/atmel-samd/common-hal/pwmio/PWMOut.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ports/atmel-samd/common-hal/pwmio/PWMOut.c b/ports/atmel-samd/common-hal/pwmio/PWMOut.c index 2e538ccdc3..b5142c21e1 100644 --- a/ports/atmel-samd/common-hal/pwmio/PWMOut.c +++ b/ports/atmel-samd/common-hal/pwmio/PWMOut.c @@ -44,6 +44,7 @@ # define _TCC_SIZE(unused, n) TCC ## n ## _SIZE, # define TCC_SIZES { REPEAT_MACRO(_TCC_SIZE, 0, TCC_INST_NUM) } +static const uint8_t tcc_sizes[TCC_INST_NUM] = TCC_SIZES; static uint32_t tcc_periods[TCC_INST_NUM]; static uint32_t tc_periods[TC_INST_NUM]; @@ -233,8 +234,7 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t* self, resolution = 16; } else { // TCC resolution varies so look it up. - const uint8_t _tcc_sizes[TCC_INST_NUM] = TCC_SIZES; - resolution = _tcc_sizes[timer->index]; + resolution = tcc_sizes[timer->index]; } // First determine the divisor that gets us the highest resolution. uint32_t system_clock = common_hal_mcu_processor_get_frequency(); @@ -421,7 +421,8 @@ void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t* self, if (t->is_tc) { resolution = 16; } else { - resolution = 24; + // TCC resolution varies so look it up. + resolution = tcc_sizes[t->index]; } uint32_t system_clock = common_hal_mcu_processor_get_frequency(); uint32_t new_top; From 53e4d78a3cf42b4a8766d8d2d8315464b80b9632 Mon Sep 17 00:00:00 2001 From: BennyE Date: Sun, 10 Jan 2021 17:18:43 +0100 Subject: [PATCH 80/82] Update ports/esp32s2/common-hal/wifi/Network.c Avoid to use yet another variable. Co-authored-by: Scott Shawcroft --- ports/esp32s2/common-hal/wifi/Network.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/esp32s2/common-hal/wifi/Network.c b/ports/esp32s2/common-hal/wifi/Network.c index 83c675a190..b6eb6bb433 100644 --- a/ports/esp32s2/common-hal/wifi/Network.c +++ b/ports/esp32s2/common-hal/wifi/Network.c @@ -86,6 +86,5 @@ mp_obj_t common_hal_wifi_network_get_authmode(wifi_network_obj_t *self) { authmode = "UNKNOWN"; break; } - const char* cstr = (const char*) authmode; - return mp_obj_new_str(cstr, strlen(cstr)); + return mp_obj_new_str(authmode, strlen(authmode)); } From 6928de0364fa6682bd39b48b1bac9a566773f3fd Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 10 Jan 2021 13:54:08 -0500 Subject: [PATCH 81/82] merge from upstream and update to 6.0.x --- docs/robots.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/robots.txt b/docs/robots.txt index 39a4eaeed9..ad3189d42c 100644 --- a/docs/robots.txt +++ b/docs/robots.txt @@ -1,6 +1,6 @@ User-agent: * Allow: /*/latest/ Allow: /en/latest/ # Fallback for bots that don't understand wildcards -Allow: /*/5.3.x/ -Allow: /en/5.3.x/ # Fallback for bots that don't understand wildcards +Allow: /*/6.0.x/ +Allow: /en/6.0.x/ # Fallback for bots that don't understand wildcards Disallow: / From 0593e464bfa52eda31ff53772f6e7f8150f6b01c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 11 Jan 2021 13:52:46 -0600 Subject: [PATCH 82/82] ulab: bump to version 1.6.1 --- extmod/ulab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extmod/ulab b/extmod/ulab index c4b06e419f..d62d07ea0b 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit c4b06e419f3d515478b05bb8ce03ebdb29cddec4 +Subproject commit d62d07ea0b9597535428ebe6012da6b0d6608bf9