Skip to content

Commit 6dbd369

Browse files
committed
merge from upstream
2 parents 767f3d0 + 0adccc5 commit 6dbd369

File tree

133 files changed

+1755
-549
lines changed

Some content is hidden

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

133 files changed

+1755
-549
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,11 @@ jobs:
408408
fail-fast: false
409409
matrix:
410410
board:
411+
- "electroniccats_bastwifi"
412+
- "espressif_kaluga_1"
411413
- "espressif_saola_1_wroom"
412414
- "espressif_saola_1_wrover"
415+
- "microdev_micro_s2"
413416
- "unexpectedmaker_feathers2"
414417

415418
steps:

conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
# Grab the JSON values to use while building the module support matrix
4343
# in 'shared-bindings/index.rst'
4444

45+
# The stubs must be built before we calculate the shared bindings matrix
46+
subprocess.check_output(["make", "stubs"])
47+
4548
#modules_support_matrix = shared_bindings_matrix.support_matrix_excluded_boards()
4649
modules_support_matrix = shared_bindings_matrix.support_matrix_by_board()
4750

@@ -77,7 +80,6 @@
7780
'.md': 'markdown',
7881
}
7982

80-
subprocess.check_output(["make", "stubs"])
8183
extensions.append('autoapi.extension')
8284

8385
autoapi_type = 'python'

docs/porting.rst

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,15 @@ as a natural "TODO" list. An example minimal build list is shown below:
5151
.. code-block:: makefile
5252
5353
# These modules are implemented in ports/<port>/common-hal:
54-
CIRCUITPY_MICROCONTROLLER = 0 # Typically the first module to create
55-
CIRCUITPY_DIGITALIO = 0 # Typically the second module to create
54+
55+
# Typically the first module to create
56+
CIRCUITPY_MICROCONTROLLER = 0
57+
# Typically the second module to create
58+
CIRCUITPY_DIGITALIO = 0
59+
# Other modules:
5660
CIRCUITPY_ANALOGIO = 0
5761
CIRCUITPY_BUSIO = 0
62+
CIRCUITPY_COUNTIO = 0
5863
CIRCUITPY_NEOPIXEL_WRITE = 0
5964
CIRCUITPY_PULSEIO = 0
6065
CIRCUITPY_OS = 0
@@ -63,22 +68,34 @@ as a natural "TODO" list. An example minimal build list is shown below:
6368
CIRCUITPY_AUDIOIO = 0
6469
CIRCUITPY_ROTARYIO = 0
6570
CIRCUITPY_RTC = 0
71+
CIRCUITPY_SDCARDIO = 0
72+
CIRCUITPY_FRAMEBUFFERIO = 0
6673
CIRCUITPY_FREQUENCYIO = 0
6774
CIRCUITPY_I2CPERIPHERAL = 0
68-
CIRCUITPY_DISPLAYIO = 0 # Requires SPI, PulseIO (stub ok)
75+
# Requires SPI, PulseIO (stub ok):
76+
CIRCUITPY_DISPLAYIO = 0
6977
7078
# These modules are implemented in shared-module/ - they can be included in
7179
# any port once their prerequisites in common-hal are complete.
72-
CIRCUITPY_BITBANGIO = 0 # Requires DigitalIO
73-
CIRCUITPY_GAMEPAD = 0 # Requires DigitalIO
74-
CIRCUITPY_PIXELBUF = 0 # Requires neopixel_write or SPI (dotstar)
75-
CIRCUITPY_RANDOM = 0 # Requires OS
76-
CIRCUITPY_STORAGE = 0 # Requires OS, filesystem
77-
CIRCUITPY_TOUCHIO = 0 # Requires Microcontroller
78-
CIRCUITPY_USB_HID = 0 # Requires USB
79-
CIRCUITPY_USB_MIDI = 0 # Requires USB
80-
CIRCUITPY_REQUIRE_I2C_PULLUPS = 0 # Does nothing without I2C
81-
CIRCUITPY_ULAB = 0 # No requirements, but takes extra flash
80+
# Requires DigitalIO:
81+
CIRCUITPY_BITBANGIO = 0
82+
# Requires DigitalIO
83+
CIRCUITPY_GAMEPAD = 0
84+
# Requires neopixel_write or SPI (dotstar)
85+
CIRCUITPY_PIXELBUF = 0
86+
# Requires OS
87+
CIRCUITPY_RANDOM = 0
88+
# Requires OS, filesystem
89+
CIRCUITPY_STORAGE = 0
90+
# Requires Microcontroller
91+
CIRCUITPY_TOUCHIO = 0
92+
# Requires USB
93+
CIRCUITPY_USB_HID = 0
94+
CIRCUITPY_USB_MIDI = 0
95+
# Does nothing without I2C
96+
CIRCUITPY_REQUIRE_I2C_PULLUPS = 0
97+
# No requirements, but takes extra flash
98+
CIRCUITPY_ULAB = 0
8299
83100
Step 2: Init
84101
--------------

docs/shared_bindings_matrix.py

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import subprocess
2929
import sys
3030

31+
from concurrent.futures import ThreadPoolExecutor
3132

3233
SUPPORTED_PORTS = ['atmel-samd', 'esp32s2', 'litex', 'mimxrt10xx', 'nrf', 'stm']
3334

@@ -42,7 +43,7 @@ def get_circuitpython_root_dir():
4243
def get_shared_bindings():
4344
""" Get a list of modules in shared-bindings based on folder names
4445
"""
45-
shared_bindings_dir = get_circuitpython_root_dir() / "shared-bindings"
46+
shared_bindings_dir = get_circuitpython_root_dir() / "circuitpython-stubs"
4647
return [item.name for item in shared_bindings_dir.iterdir()]
4748

4849

@@ -131,38 +132,44 @@ def lookup_setting(settings, key, default=''):
131132
key = value[2:-1]
132133
return value
133134

135+
def all_ports_all_boards(ports=SUPPORTED_PORTS):
136+
for port in ports:
137+
138+
port_dir = get_circuitpython_root_dir() / "ports" / port
139+
for entry in (port_dir / "boards").iterdir():
140+
if not entry.is_dir():
141+
continue
142+
yield (port, entry)
143+
134144
def support_matrix_by_board(use_branded_name=True):
135145
""" Compiles a list of the available core modules available for each
136146
board.
137147
"""
138148
base = build_module_map()
139149

140-
boards = dict()
141-
for port in SUPPORTED_PORTS:
142-
150+
def support_matrix(arg):
151+
port, entry = arg
143152
port_dir = get_circuitpython_root_dir() / "ports" / port
144-
for entry in (port_dir / "boards").iterdir():
145-
if not entry.is_dir():
146-
continue
147-
board_modules = []
148-
board_name = entry.name
149-
150-
settings = get_settings_from_makefile(str(port_dir), entry.name)
151-
152-
if use_branded_name:
153-
with open(entry / "mpconfigboard.h") as get_name:
154-
board_contents = get_name.read()
155-
board_name_re = re.search(r"(?<=MICROPY_HW_BOARD_NAME)\s+(.+)",
156-
board_contents)
157-
if board_name_re:
158-
board_name = board_name_re.group(1).strip('"')
159-
160-
board_modules = []
161-
for module in base:
162-
key = f'CIRCUITPY_{module.upper()}'
163-
if int(lookup_setting(settings, key, '0')):
164-
board_modules.append(base[module]['name'])
165-
boards[board_name] = sorted(board_modules)
153+
settings = get_settings_from_makefile(str(port_dir), entry.name)
154+
155+
if use_branded_name:
156+
with open(entry / "mpconfigboard.h") as get_name:
157+
board_contents = get_name.read()
158+
board_name_re = re.search(r"(?<=MICROPY_HW_BOARD_NAME)\s+(.+)",
159+
board_contents)
160+
if board_name_re:
161+
board_name = board_name_re.group(1).strip('"')
162+
163+
board_modules = []
164+
for module in base:
165+
key = f'CIRCUITPY_{module.upper()}'
166+
if int(lookup_setting(settings, key, '0')):
167+
board_modules.append(base[module]['name'])
168+
169+
return (board_name, sorted(board_modules))
170+
171+
executor = ThreadPoolExecutor(max_workers=os.cpu_count())
172+
boards = dict(sorted(executor.map(support_matrix, all_ports_all_boards())))
166173

167174
#print(json.dumps(boards, indent=2))
168175
return boards

lib/utils/pyexec.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ STATIC int parse_compile_execute(const void *source, mp_parse_input_kind_t input
113113
start = mp_hal_ticks_ms();
114114
mp_call_function_0(module_fun);
115115
mp_hal_set_interrupt_char(-1); // disable interrupt
116+
// Handle any ctrl-c interrupt that arrived just in time
117+
mp_handle_pending();
116118
nlr_pop();
117119
ret = 0;
118120
if (exec_flags & EXEC_FLAG_PRINT_EOF) {

locale/ID.po

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ msgid ""
55
msgstr ""
66
"Project-Id-Version: PACKAGE VERSION\n"
77
"Report-Msgid-Bugs-To: \n"
8-
"POT-Creation-Date: 2020-08-14 09:36-0400\n"
8+
"POT-Creation-Date: 2020-08-18 11:19-0400\n"
99
"PO-Revision-Date: 2020-07-06 18:10+0000\n"
1010
"Last-Translator: oon arfiandwi <[email protected]>\n"
1111
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -764,7 +764,7 @@ msgstr "Error pada regex"
764764

765765
#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c
766766
#: shared-bindings/microcontroller/Pin.c
767-
#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c
767+
#: shared-bindings/neopixel_write/__init__.c
768768
#: shared-bindings/terminalio/Terminal.c
769769
msgid "Expected a %q"
770770
msgstr "Diharapkan %q"
@@ -1352,6 +1352,15 @@ msgstr "Tambahkan module apapun pada filesystem\n"
13521352
msgid "Polygon needs at least 3 points"
13531353
msgstr ""
13541354

1355+
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
1356+
#: ports/cxd56/common-hal/pulseio/PulseOut.c
1357+
#: ports/nrf/common-hal/pulseio/PulseOut.c
1358+
#: ports/stm/common-hal/pulseio/PulseOut.c
1359+
msgid ""
1360+
"Port does not accept pins or frequency. "
1361+
"Construct and pass a PWMOut Carrier instead"
1362+
msgstr ""
1363+
13551364
#: shared-bindings/_bleio/Adapter.c
13561365
msgid "Prefix buffer must be on the heap"
13571366
msgstr ""
@@ -1366,6 +1375,10 @@ msgstr ""
13661375
msgid "Pull not used when direction is output."
13671376
msgstr ""
13681377

1378+
#: ports/stm/ref/pulseout-pre-timeralloc.c
1379+
msgid "PulseOut not supported on this chip"
1380+
msgstr ""
1381+
13691382
#: ports/stm/common-hal/os/__init__.c
13701383
msgid "RNG DeInit Error"
13711384
msgstr ""

0 commit comments

Comments
 (0)