Skip to content

Commit 361f057

Browse files
Merge branch 'master' of github.com:adafruit/circuitpython into translate-german
2 parents 3e97d3e + 5c3fcc7 commit 361f057

File tree

149 files changed

+6324
-22745
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+6324
-22745
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*.bin
88
*.map
99
*.hex
10-
!ports/nrf/**/bootloader/**/*.hex
1110
*.dis
1211
*.exe
1312

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,6 @@
8080
path = lib/tinyusb
8181
url = https://github.com/hathach/tinyusb.git
8282
branch = develop
83+
[submodule "tools/huffman"]
84+
path = tools/huffman
85+
url = https://github.com/tannewt/huffman.git

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ env:
3030
- TRAVIS_BOARD=pirkey_m0
3131
- TRAVIS_BOARD=gemma_m0
3232
- TRAVIS_BOARD=hallowing_m0_express
33-
- TRAVIS_BOARD=feather52832
33+
- TRAVIS_BOARD=feather_nrf52832
34+
- TRAVIS_BOARD=feather_nrf52840_express
3435

3536
addons:
3637
artifacts:
@@ -54,7 +55,7 @@ before_script:
5455
- ([[ -z "$TRAVIS_BOARD" || $TRAVIS_BOARD = "feather_huzzah" ]] || (wget https://s3.amazonaws.com/adafruit-circuit-python/gcc-arm-embedded_7-2018q2-1~trusty1_amd64.deb && sudo dpkg -i gcc-arm-embedded*_amd64.deb))
5556

5657
# For nrf builds
57-
- ([[ $TRAVIS_BOARD != "feather52832" && $TRAVIS_BOARD != "pca10056" ]] || sudo ports/nrf/drivers/bluetooth/download_ble_stack.sh)
58+
- ([[ $TRAVIS_BOARD != "feather_nrf52832" && $TRAVIS_BOARD != "feather_nrf52840_express" && $TRAVIS_BOARD != "pca10056" ]] || sudo ports/nrf/drivers/bluetooth/download_ble_stack.sh)
5859
# For huzzah builds
5960
- if [[ $TRAVIS_BOARD = "feather_huzzah" ]]; then wget https://github.com/jepler/esp-open-sdk/releases/download/2018-06-10/xtensa-lx106-elf-standalone.tar.gz && tar xavf xtensa-lx106-elf-standalone.tar.gz; PATH=$(readlink -f xtensa-lx106-elf/bin):$PATH; fi
6061
# For coverage testing (upgrade is used to get latest urllib3 version)

extmod/machine_i2c.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
#include "py/runtime.h"
3434
#include "extmod/machine_i2c.h"
3535

36+
#include "supervisor/shared/translate.h"
37+
3638
#if MICROPY_PY_MACHINE_I2C
3739

3840
typedef mp_machine_soft_i2c_obj_t machine_i2c_obj_t;
@@ -294,7 +296,7 @@ STATIC mp_obj_t machine_i2c_make_new(const mp_obj_type_t *type, size_t n_args, s
294296
extern mp_obj_t MICROPY_PY_MACHINE_I2C_MAKE_NEW(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args);
295297
return MICROPY_PY_MACHINE_I2C_MAKE_NEW(type, n_args, n_kw, args);
296298
#else
297-
mp_raise_ValueError("invalid I2C peripheral");
299+
mp_raise_ValueError(translate("invalid I2C peripheral"));
298300
#endif
299301
}
300302
--n_args;
@@ -335,7 +337,7 @@ STATIC mp_obj_t machine_i2c_start(mp_obj_t self_in) {
335337
mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(self_in);
336338
mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)self->type->protocol;
337339
if (i2c_p->start == NULL) {
338-
mp_raise_msg(&mp_type_OSError, "I2C operation not supported");
340+
mp_raise_msg(&mp_type_OSError, translate("I2C operation not supported"));
339341
}
340342
int ret = i2c_p->start(self);
341343
if (ret != 0) {
@@ -349,7 +351,7 @@ STATIC mp_obj_t machine_i2c_stop(mp_obj_t self_in) {
349351
mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(self_in);
350352
mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)self->type->protocol;
351353
if (i2c_p->stop == NULL) {
352-
mp_raise_msg(&mp_type_OSError, "I2C operation not supported");
354+
mp_raise_msg(&mp_type_OSError, translate("I2C operation not supported"));
353355
}
354356
int ret = i2c_p->stop(self);
355357
if (ret != 0) {
@@ -363,7 +365,7 @@ STATIC mp_obj_t machine_i2c_readinto(size_t n_args, const mp_obj_t *args) {
363365
mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(args[0]);
364366
mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)self->type->protocol;
365367
if (i2c_p->read == NULL) {
366-
mp_raise_msg(&mp_type_OSError, "I2C operation not supported");
368+
mp_raise_msg(&mp_type_OSError, translate("I2C operation not supported"));
367369
}
368370

369371
// get the buffer to read into
@@ -387,7 +389,7 @@ STATIC mp_obj_t machine_i2c_write(mp_obj_t self_in, mp_obj_t buf_in) {
387389
mp_obj_base_t *self = (mp_obj_base_t*)MP_OBJ_TO_PTR(self_in);
388390
mp_machine_i2c_p_t *i2c_p = (mp_machine_i2c_p_t*)self->type->protocol;
389391
if (i2c_p->write == NULL) {
390-
mp_raise_msg(&mp_type_OSError, "I2C operation not supported");
392+
mp_raise_msg(&mp_type_OSError, translate("I2C operation not supported"));
391393
}
392394

393395
// get the buffer to write from

extmod/machine_mem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
STATIC uintptr_t machine_mem_get_addr(mp_obj_t addr_o, uint align) {
4343
uintptr_t addr = mp_obj_int_get_truncated(addr_o);
4444
if ((addr & (align - 1)) != 0) {
45-
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "address %08x is not aligned to %d bytes", addr, align));
45+
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, translate("address %08x is not aligned to %d bytes"), addr, align));
4646
}
4747
return addr;
4848
}

extmod/machine_spi.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
#include "py/runtime.h"
3131
#include "extmod/machine_spi.h"
3232

33+
#include "supervisor/shared/translate.h"
34+
3335
#if MICROPY_PY_MACHINE_SPI
3436

3537
// if a port didn't define MSB/LSB constants then provide them
@@ -52,7 +54,7 @@ mp_obj_t mp_machine_spi_make_new(const mp_obj_type_t *type, size_t n_args, size_
5254
extern mp_obj_t MICROPY_PY_MACHINE_SPI_MAKE_NEW(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args);
5355
return MICROPY_PY_MACHINE_SPI_MAKE_NEW(type, n_args, n_kw, args);
5456
#else
55-
mp_raise_ValueError("invalid SPI peripheral");
57+
mp_raise_ValueError(translate("invalid SPI peripheral"));
5658
#endif
5759
}
5860
--n_args;
@@ -119,7 +121,7 @@ STATIC mp_obj_t mp_machine_spi_write_readinto(mp_obj_t self, mp_obj_t wr_buf, mp
119121
mp_buffer_info_t dest;
120122
mp_get_buffer_raise(rd_buf, &dest, MP_BUFFER_WRITE);
121123
if (src.len != dest.len) {
122-
mp_raise_ValueError("buffers must be the same length");
124+
mp_raise_ValueError(translate("buffers must be the same length"));
123125
}
124126
mp_machine_spi_transfer(self, src.len, src.buf, dest.buf);
125127
return mp_const_none;
@@ -202,15 +204,15 @@ STATIC mp_obj_t mp_machine_soft_spi_make_new(const mp_obj_type_t *type, size_t n
202204
self->spi.polarity = args[ARG_polarity].u_int;
203205
self->spi.phase = args[ARG_phase].u_int;
204206
if (args[ARG_bits].u_int != 8) {
205-
mp_raise_ValueError("bits must be 8");
207+
mp_raise_ValueError(translate("bits must be 8"));
206208
}
207209
if (args[ARG_firstbit].u_int != MICROPY_PY_MACHINE_SPI_MSB) {
208-
mp_raise_ValueError("firstbit must be MSB");
210+
mp_raise_ValueError(translate("firstbit must be MSB"));
209211
}
210212
if (args[ARG_sck].u_obj == MP_OBJ_NULL
211213
|| args[ARG_mosi].u_obj == MP_OBJ_NULL
212214
|| args[ARG_miso].u_obj == MP_OBJ_NULL) {
213-
mp_raise_ValueError("must specify all of sck/mosi/miso");
215+
mp_raise_ValueError(translate("must specify all of sck/mosi/miso"));
214216
}
215217
self->spi.sck = mp_hal_get_pin_obj(args[ARG_sck].u_obj);
216218
self->spi.mosi = mp_hal_get_pin_obj(args[ARG_mosi].u_obj);

extmod/modframebuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ STATIC mp_obj_t framebuf_make_new(const mp_obj_type_t *type, size_t n_args, size
296296
case FRAMEBUF_GS8:
297297
break;
298298
default:
299-
mp_raise_ValueError("invalid format");
299+
mp_raise_ValueError(translate("invalid format"));
300300
}
301301

302302
return MP_OBJ_FROM_PTR(o);

extmod/modubinascii.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
static void check_not_unicode(const mp_obj_t arg) {
3636
#if MICROPY_CPYTHON_COMPAT
3737
if (MP_OBJ_IS_STR(arg)) {
38-
mp_raise_TypeError("a bytes-like object is required");
38+
mp_raise_TypeError(translate("a bytes-like object is required"));
3939
}
4040
#endif
4141
}
@@ -87,7 +87,7 @@ mp_obj_t mod_binascii_unhexlify(mp_obj_t data) {
8787
mp_get_buffer_raise(data, &bufinfo, MP_BUFFER_READ);
8888

8989
if ((bufinfo.len & 1) != 0) {
90-
mp_raise_ValueError("odd-length string");
90+
mp_raise_ValueError(translate("odd-length string"));
9191
}
9292
vstr_t vstr;
9393
vstr_init_len(&vstr, bufinfo.len / 2);
@@ -98,7 +98,7 @@ mp_obj_t mod_binascii_unhexlify(mp_obj_t data) {
9898
if (unichar_isxdigit(hex_ch)) {
9999
hex_byte += unichar_xdigit_value(hex_ch);
100100
} else {
101-
mp_raise_ValueError("non-hex digit found");
101+
mp_raise_ValueError(translate("non-hex digit found"));
102102
}
103103
if (i & 1) {
104104
hex_byte <<= 4;
@@ -166,7 +166,7 @@ mp_obj_t mod_binascii_a2b_base64(mp_obj_t data) {
166166
}
167167

168168
if (nbits) {
169-
mp_raise_ValueError("incorrect padding");
169+
mp_raise_ValueError(translate("incorrect padding"));
170170
}
171171

172172
return mp_obj_new_str_from_vstr(&mp_type_bytes, &vstr);

extmod/moductypes.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
#include "py/objtuple.h"
3333
#include "py/binary.h"
3434

35+
#include "supervisor/shared/translate.h"
36+
3537
#if MICROPY_PY_UCTYPES
3638

3739
/// \module uctypes - Access data structures in memory
@@ -117,7 +119,7 @@ typedef struct _mp_obj_uctypes_struct_t {
117119
} mp_obj_uctypes_struct_t;
118120

119121
STATIC NORETURN void syntax_error(void) {
120-
mp_raise_TypeError("syntax error in uctypes descriptor");
122+
mp_raise_TypeError(translate("syntax error in uctypes descriptor"));
121123
}
122124

123125
STATIC mp_obj_t uctypes_struct_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
@@ -214,7 +216,7 @@ STATIC mp_uint_t uctypes_struct_size(mp_obj_t desc_in, int layout_type, mp_uint_
214216
// but scalar structure field is lowered into native Python int, so all
215217
// type info is lost. So, we cannot say if it's scalar type description,
216218
// or such lowered scalar.
217-
mp_raise_TypeError("Cannot unambiguously get sizeof scalar");
219+
mp_raise_TypeError(translate("Cannot unambiguously get sizeof scalar"));
218220
}
219221
syntax_error();
220222
}
@@ -392,7 +394,7 @@ STATIC mp_obj_t uctypes_struct_attr_op(mp_obj_t self_in, qstr attr, mp_obj_t set
392394

393395
// TODO: Support at least OrderedDict in addition
394396
if (!MP_OBJ_IS_TYPE(self->desc, &mp_type_dict)) {
395-
mp_raise_TypeError("struct: no fields");
397+
mp_raise_TypeError(translate("struct: no fields"));
396398
}
397399

398400
mp_obj_t deref = mp_obj_dict_get(self->desc, MP_OBJ_NEW_QSTR(attr));
@@ -525,7 +527,7 @@ STATIC mp_obj_t uctypes_struct_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_ob
525527
} else {
526528
// load / store
527529
if (!MP_OBJ_IS_TYPE(self->desc, &mp_type_tuple)) {
528-
mp_raise_TypeError("struct: cannot index");
530+
mp_raise_TypeError(translate("struct: cannot index"));
529531
}
530532

531533
mp_obj_tuple_t *t = MP_OBJ_TO_PTR(self->desc);
@@ -539,7 +541,7 @@ STATIC mp_obj_t uctypes_struct_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_ob
539541
uint val_type = GET_TYPE(arr_sz, VAL_TYPE_BITS);
540542
arr_sz &= VALUE_MASK(VAL_TYPE_BITS);
541543
if (index >= arr_sz) {
542-
nlr_raise(mp_obj_new_exception_msg(&mp_type_IndexError, "struct: index out of range"));
544+
nlr_raise(mp_obj_new_exception_msg(&mp_type_IndexError, translate("struct: index out of range")));
543545
}
544546

545547
if (t->len == 2) {

extmod/moduhashlib.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929

3030
#include "py/runtime.h"
3131

32+
#include "supervisor/shared/translate.h"
33+
3234
#if MICROPY_PY_UHASHLIB
3335

3436
#if MICROPY_PY_UHASHLIB_SHA256
@@ -97,7 +99,7 @@ STATIC mp_obj_t uhashlib_sha256_digest(mp_obj_t self_in) {
9799
static void check_not_unicode(const mp_obj_t arg) {
98100
#if MICROPY_CPYTHON_COMPAT
99101
if (MP_OBJ_IS_STR(arg)) {
100-
mp_raise_TypeError("a bytes-like object is required");
102+
mp_raise_TypeError(translate("a bytes-like object is required"));
101103
}
102104
#endif
103105
}

0 commit comments

Comments
 (0)