Skip to content

Commit ee2cb70

Browse files
author
Daniel Pollard
committed
merged master
2 parents e947e4e + 62b835a commit ee2cb70

File tree

96 files changed

+3296
-693
lines changed

Some content is hidden

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

96 files changed

+3296
-693
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ jobs:
216216
- "pewpew10"
217217
- "pewpew_m4"
218218
- "pirkey_m0"
219+
- "pitaya_go"
219220
- "pyb_nano_v2"
220221
- "pybadge"
221222
- "pybadge_airlift"
@@ -249,6 +250,7 @@ jobs:
249250
- "stm32f746g_discovery"
250251
- "stringcar_m0_express"
251252
- "teensy40"
253+
- "teensy41"
252254
- "teknikio_bluebird"
253255
- "thunderpack"
254256
- "trellis_m4_express"

docs/shared_bindings_matrix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def build_module_map():
9898
for module in modules:
9999
full_name = module
100100
search_name = module.lstrip("_")
101-
re_pattern = "CIRCUITPY_{}\s=\s(.+)".format(search_name.upper())
101+
re_pattern = "CIRCUITPY_{}\s*\??=\s*(.+)".format(search_name.upper())
102102
find_config = re.findall(re_pattern, configs)
103103
if not find_config:
104104
continue

extmod/modujson.c

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ STATIC mp_obj_t mod_ujson_dumps(mp_obj_t obj) {
5353
}
5454
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_ujson_dumps_obj, mod_ujson_dumps);
5555

56+
#define JSON_DEBUG(...) (void)0
57+
// #define JSON_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__)
58+
59+
5660
// The function below implements a simple non-recursive JSON parser.
5761
//
5862
// The JSON specification is at http://www.ietf.org/rfc/rfc4627.txt
@@ -80,6 +84,7 @@ typedef struct _ujson_stream_t {
8084

8185
STATIC byte ujson_stream_next(ujson_stream_t *s) {
8286
mp_uint_t ret = s->read(s->stream_obj, &s->cur, 1, &s->errcode);
87+
JSON_DEBUG(" usjon_stream_next err:%2d cur: %c \n", s->errcode, s->cur);
8388
if (s->errcode != 0) {
8489
mp_raise_OSError(s->errcode);
8590
}
@@ -89,9 +94,10 @@ STATIC byte ujson_stream_next(ujson_stream_t *s) {
8994
return s->cur;
9095
}
9196

92-
STATIC mp_obj_t mod_ujson_load(mp_obj_t stream_obj) {
97+
STATIC mp_obj_t _mod_ujson_load(mp_obj_t stream_obj, bool return_first_json) {
9398
const mp_stream_p_t *stream_p = mp_get_stream_raise(stream_obj, MP_STREAM_OP_READ);
9499
ujson_stream_t s = {stream_obj, stream_p->read, 0, 0};
100+
JSON_DEBUG("got JSON stream\n");
95101
vstr_t vstr;
96102
vstr_init(&vstr, 8);
97103
mp_obj_list_t stack; // we use a list as a simple stack for nested JSON
@@ -262,13 +268,18 @@ STATIC mp_obj_t mod_ujson_load(mp_obj_t stream_obj) {
262268
}
263269
}
264270
success:
265-
// eat trailing whitespace
266-
while (unichar_isspace(S_CUR(s))) {
267-
S_NEXT(s);
268-
}
269-
if (!S_END(s)) {
270-
// unexpected chars
271-
goto fail;
271+
// It is legal for a stream to have contents after JSON.
272+
// E.g., A UART is not closed after receiving an object; in load() we will
273+
// return the first complete JSON object, while in loads() we will retain
274+
// strict adherence to the buffer's complete semantic.
275+
if (!return_first_json) {
276+
while (unichar_isspace(S_CUR(s))) {
277+
S_NEXT(s);
278+
}
279+
if (!S_END(s)) {
280+
// unexpected chars
281+
goto fail;
282+
}
272283
}
273284
if (stack_top == MP_OBJ_NULL || stack.len != 0) {
274285
// not exactly 1 object
@@ -280,14 +291,18 @@ STATIC mp_obj_t mod_ujson_load(mp_obj_t stream_obj) {
280291
fail:
281292
mp_raise_ValueError(translate("syntax error in JSON"));
282293
}
294+
295+
STATIC mp_obj_t mod_ujson_load(mp_obj_t stream_obj) {
296+
return _mod_ujson_load(stream_obj, true);
297+
}
283298
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_ujson_load_obj, mod_ujson_load);
284299

285300
STATIC mp_obj_t mod_ujson_loads(mp_obj_t obj) {
286301
size_t len;
287302
const char *buf = mp_obj_str_get_data(obj, &len);
288303
vstr_t vstr = {len, len, (char*)buf, true};
289304
mp_obj_stringio_t sio = {{&mp_type_stringio}, &vstr, 0, MP_OBJ_NULL};
290-
return mod_ujson_load(MP_OBJ_FROM_PTR(&sio));
305+
return _mod_ujson_load(MP_OBJ_FROM_PTR(&sio), false);
291306
}
292307
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_ujson_loads_obj, mod_ujson_loads);
293308

locale/ID.po

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2020-05-05 14:57+1000\n"
11+
"POT-Creation-Date: 2020-05-12 14:37+1000\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -435,6 +435,10 @@ msgstr "buffers harus mempunyai panjang yang sama"
435435
msgid "Bytes must be between 0 and 255."
436436
msgstr ""
437437

438+
#: shared-bindings/aesio/aes.c
439+
msgid "CBC blocks must be multiples of 16 bytes"
440+
msgstr ""
441+
438442
#: py/objtype.c
439443
msgid "Call super().__init__() before accessing native object."
440444
msgstr ""
@@ -672,6 +676,10 @@ msgstr ""
672676
msgid "Drive mode not used when direction is input."
673677
msgstr ""
674678

679+
#: shared-bindings/aesio/aes.c
680+
msgid "ECB only operates on 16 bytes at a time"
681+
msgstr ""
682+
675683
#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c
676684
#: ports/atmel-samd/common-hal/ps2io/Ps2.c
677685
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
@@ -683,7 +691,7 @@ msgstr "Channel EXTINT sedang digunakan"
683691
msgid "Error in regex"
684692
msgstr "Error pada regex"
685693

686-
#: shared-bindings/microcontroller/Pin.c
694+
#: shared-bindings/aesio/aes.c shared-bindings/microcontroller/Pin.c
687695
#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c
688696
#: shared-bindings/terminalio/Terminal.c
689697
msgid "Expected a %q"
@@ -790,7 +798,8 @@ msgstr ""
790798
msgid "Group full"
791799
msgstr ""
792800

793-
#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c
801+
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c
802+
#: ports/stm/common-hal/busio/SPI.c
794803
msgid "Hardware busy, try alternative pins"
795804
msgstr ""
796805

@@ -810,6 +819,11 @@ msgstr ""
810819
msgid "I2C operation not supported"
811820
msgstr "operasi I2C tidak didukung"
812821

822+
#: shared-bindings/aesio/aes.c
823+
#, c-format
824+
msgid "IV must be %d bytes long"
825+
msgstr ""
826+
813827
#: py/persistentcode.c
814828
msgid ""
815829
"Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/"
@@ -989,6 +1003,10 @@ msgstr ""
9891003
msgid "Invalid word/bit length"
9901004
msgstr ""
9911005

1006+
#: shared-bindings/aesio/aes.c
1007+
msgid "Key must be 16, 24, or 32 bytes long"
1008+
msgstr ""
1009+
9921010
#: py/compile.c
9931011
msgid "LHS of keyword arg must be an id"
9941012
msgstr "LHS dari keyword arg harus menjadi sebuah id"
@@ -1034,15 +1052,15 @@ msgstr ""
10341052
msgid "Microphone startup delay must be in range 0.0 to 1.0"
10351053
msgstr ""
10361054

1037-
#: ports/stm/common-hal/busio/SPI.c
1055+
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c
10381056
msgid "Missing MISO or MOSI Pin"
10391057
msgstr ""
10401058

10411059
#: shared-bindings/displayio/Group.c
10421060
msgid "Must be a %q subclass."
10431061
msgstr ""
10441062

1045-
#: ports/stm/common-hal/busio/SPI.c
1063+
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c
10461064
msgid "Must provide MISO or MOSI pin"
10471065
msgstr ""
10481066

@@ -1073,11 +1091,11 @@ msgstr "Tidak ada DAC (Digital Analog Converter) di dalam chip"
10731091
msgid "No DMA channel found"
10741092
msgstr "tidak ada channel DMA ditemukan"
10751093

1076-
#: ports/stm/common-hal/busio/SPI.c
1094+
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c
10771095
msgid "No MISO Pin"
10781096
msgstr ""
10791097

1080-
#: ports/stm/common-hal/busio/SPI.c
1098+
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c
10811099
msgid "No MOSI Pin"
10821100
msgstr ""
10831101

@@ -1097,6 +1115,10 @@ msgstr "Tidak ada pin TX"
10971115
msgid "No available clocks"
10981116
msgstr ""
10991117

1118+
#: shared-bindings/_bleio/PacketBuffer.c
1119+
msgid "No connection: length cannot be determined"
1120+
msgstr ""
1121+
11001122
#: shared-bindings/board/__init__.c
11011123
msgid "No default %q bus"
11021124
msgstr "Tidak ada standar bus %q"
@@ -1118,6 +1140,10 @@ msgstr ""
11181140
msgid "No hardware support on pin"
11191141
msgstr "Tidak ada dukungan hardware untuk pin"
11201142

1143+
#: shared-bindings/aesio/aes.c
1144+
msgid "No key was specified"
1145+
msgstr ""
1146+
11211147
#: ports/stm/common-hal/pulseio/PWMOut.c
11221148
msgid "No more timers available on this pin."
11231149
msgstr ""
@@ -1303,6 +1329,10 @@ msgstr "sistem file (filesystem) bersifat Read-only"
13031329
msgid "Refresh too soon"
13041330
msgstr ""
13051331

1332+
#: shared-bindings/aesio/aes.c
1333+
msgid "Requested AES mode is unsupported"
1334+
msgstr ""
1335+
13061336
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
13071337
msgid "Right channel unsupported"
13081338
msgstr "Channel Kanan tidak didukung"
@@ -1367,6 +1397,10 @@ msgstr ""
13671397
msgid "Slices not supported"
13681398
msgstr ""
13691399

1400+
#: shared-bindings/aesio/aes.c
1401+
msgid "Source and destination buffers must be the same length"
1402+
msgstr ""
1403+
13701404
#: extmod/modure.c
13711405
msgid "Splitting with sub-captures"
13721406
msgstr "Memisahkan dengan menggunakan sub-captures"
@@ -1450,6 +1484,10 @@ msgstr ""
14501484
msgid "Too many displays"
14511485
msgstr ""
14521486

1487+
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
1488+
msgid "Total data to write is larger than outgoing_packet_length"
1489+
msgstr ""
1490+
14531491
#: py/obj.c
14541492
msgid "Traceback (most recent call last):\n"
14551493
msgstr ""

0 commit comments

Comments
 (0)