Skip to content

Commit bb046f9

Browse files
authored
Merge pull request #3540 from WarriorOfWire/async_syntax
__await__ magic method and async/await
2 parents 2e5bea2 + 10badd9 commit bb046f9

File tree

15 files changed

+104
-51
lines changed

15 files changed

+104
-51
lines changed

locale/circuitpython.pot

Lines changed: 15 additions & 3 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-10-06 13:26-0400\n"
11+
"POT-Creation-Date: 2020-10-10 23:49-0700\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"
@@ -246,6 +246,10 @@ msgstr ""
246246
msgid "'return' outside function"
247247
msgstr ""
248248

249+
#: py/compile.c
250+
msgid "'yield from' inside async function"
251+
msgstr ""
252+
249253
#: py/compile.c
250254
msgid "'yield' outside function"
251255
msgstr ""
@@ -289,6 +293,7 @@ msgid "All I2C peripherals are in use"
289293
msgstr ""
290294

291295
#: ports/atmel-samd/common-hal/canio/Listener.c
296+
#: ports/stm/common-hal/canio/Listener.c
292297
msgid "All RX FIFOs in use"
293298
msgstr ""
294299

@@ -896,6 +901,7 @@ msgid "File exists"
896901
msgstr ""
897902

898903
#: ports/atmel-samd/common-hal/canio/Listener.c
904+
#: ports/stm/common-hal/canio/Listener.c
899905
msgid "Filters too complex"
900906
msgstr ""
901907

@@ -932,7 +938,8 @@ msgid "Group full"
932938
msgstr ""
933939

934940
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c
935-
#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/sdioio/SDCard.c
941+
#: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c
942+
#: ports/stm/common-hal/sdioio/SDCard.c
936943
msgid "Hardware busy, try alternative pins"
937944
msgstr ""
938945

@@ -1002,7 +1009,8 @@ msgid "Invalid %q pin"
10021009
msgstr ""
10031010

10041011
#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c
1005-
#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/sdioio/SDCard.c
1012+
#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c
1013+
#: ports/stm/common-hal/sdioio/SDCard.c
10061014
msgid "Invalid %q pin selection"
10071015
msgstr ""
10081016

@@ -3426,6 +3434,10 @@ msgstr ""
34263434
msgid "type object '%q' has no attribute '%q'"
34273435
msgstr ""
34283436

3437+
#: py/objgenerator.c
3438+
msgid "type object 'generator' has no attribute '__await__'"
3439+
msgstr ""
3440+
34293441
#: py/objtype.c
34303442
msgid "type takes 1 or 3 arguments"
34313443
msgstr ""

ports/atmel-samd/boards/circuitbrains_basic_m0/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ CIRCUITPY_COUNTIO = 0
1616
CIRCUITPY_FREQUENCYIO = 0
1717
CIRCUITPY_I2CPERIPHERAL = 0
1818
CIRCUITPY_VECTORIO = 0
19+
MICROPY_PY_ASYNC_AWAIT = 0
1920

2021
SUPEROPT_GC = 0
2122

ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ LONGINT_IMPL = MPZ
1515
CIRCUITPY_DISPLAYIO = 0
1616
CIRCUITPY_FREQUENCYIO = 0
1717
CIRCUITPY_I2CPERIPHERAL = 0
18+
MICROPY_PY_ASYNC_AWAIT = 0
1819

1920
SUPEROPT_GC = 0
2021
CFLAGS_INLINE_LIMIT = 55

ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ CIRCUITPY_USB_MIDI = 0
2222
CIRCUITPY_USB_HID = 0
2323
CIRCUITPY_TOUCHIO = 0
2424
CFLAGS_INLINE_LIMIT = 35
25+
2526
# Make more room.
2627
SUPEROPT_GC = 0
2728

ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ CIRCUITPY_SAMD = 0
2222
CIRCUITPY_USB_MIDI = 0
2323
CIRCUITPY_USB_HID = 0
2424
CIRCUITPY_TOUCHIO = 0
25+
2526
CFLAGS_INLINE_LIMIT = 35
2627
# Make more room.
2728
SUPEROPT_GC = 0

ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ CIRCUITPY_COUNTIO = 0
1717
CIRCUITPY_RTC = 0
1818
CIRCUITPY_FREQUENCYIO = 0
1919
CIRCUITPY_I2CPERIPHERAL = 0
20+
MICROPY_PY_ASYNC_AWAIT = 0
2021

2122
SUPEROPT_GC = 0
2223

ports/nrf/boards/pca10100/mpconfigboard.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ CIRCUITPY_RTC = 1
2424
CIRCUITPY_SDCARDIO = 0
2525
CIRCUITPY_TOUCHIO = 0
2626
CIRCUITPY_ULAB = 0
27+
MICROPY_PY_ASYNC_AWAIT = 0
2728

2829
SUPEROPT_GC = 0
2930

ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ USB_MANUFACTURER = "SparkFun Electronics"
66
MCU_CHIP = nrf52840
77

88
INTERNAL_FLASH_FILESYSTEM = 1
9+
10+
MICROPY_PY_ASYNC_AWAIT = 0

py/circuitpy_mpconfig.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979

8080
#define MICROPY_PY_ARRAY (1)
8181
#define MICROPY_PY_ARRAY_SLICE_ASSIGN (1)
82-
#define MICROPY_PY_ASYNC_AWAIT (0)
8382
#define MICROPY_PY_ATTRTUPLE (1)
8483

8584
#define MICROPY_PY_BUILTINS_BYTEARRAY (1)

py/circuitpy_mpconfig.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
CIRCUITPY_FULL_BUILD ?= 1
3333
CFLAGS += -DCIRCUITPY_FULL_BUILD=$(CIRCUITPY_FULL_BUILD)
3434

35+
# async/await language keyword support
36+
MICROPY_PY_ASYNC_AWAIT ?= $(CIRCUITPY_FULL_BUILD)
37+
CFLAGS += -DMICROPY_PY_ASYNC_AWAIT=$(MICROPY_PY_ASYNC_AWAIT)
3538

3639
CIRCUITPY_AESIO ?= 0
3740
CFLAGS += -DCIRCUITPY_AESIO=$(CIRCUITPY_AESIO)

0 commit comments

Comments
 (0)