Skip to content

Commit

Permalink
merge from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
dhalbert committed Aug 30, 2020
2 parents 767f3d0 + 0adccc5 commit 6dbd369
Show file tree
Hide file tree
Showing 133 changed files with 1,755 additions and 549 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,11 @@ jobs:
fail-fast: false
matrix:
board:
- "electroniccats_bastwifi"
- "espressif_kaluga_1"
- "espressif_saola_1_wroom"
- "espressif_saola_1_wrover"
- "microdev_micro_s2"
- "unexpectedmaker_feathers2"

steps:
Expand Down
4 changes: 3 additions & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
# Grab the JSON values to use while building the module support matrix
# in 'shared-bindings/index.rst'

# The stubs must be built before we calculate the shared bindings matrix
subprocess.check_output(["make", "stubs"])

#modules_support_matrix = shared_bindings_matrix.support_matrix_excluded_boards()
modules_support_matrix = shared_bindings_matrix.support_matrix_by_board()

Expand Down Expand Up @@ -77,7 +80,6 @@
'.md': 'markdown',
}

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

autoapi_type = 'python'
Expand Down
43 changes: 30 additions & 13 deletions docs/porting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@ as a natural "TODO" list. An example minimal build list is shown below:
.. code-block:: makefile
# These modules are implemented in ports/<port>/common-hal:
CIRCUITPY_MICROCONTROLLER = 0 # Typically the first module to create
CIRCUITPY_DIGITALIO = 0 # Typically the second module to create
# Typically the first module to create
CIRCUITPY_MICROCONTROLLER = 0
# Typically the second module to create
CIRCUITPY_DIGITALIO = 0
# Other modules:
CIRCUITPY_ANALOGIO = 0
CIRCUITPY_BUSIO = 0
CIRCUITPY_COUNTIO = 0
CIRCUITPY_NEOPIXEL_WRITE = 0
CIRCUITPY_PULSEIO = 0
CIRCUITPY_OS = 0
Expand All @@ -63,22 +68,34 @@ as a natural "TODO" list. An example minimal build list is shown below:
CIRCUITPY_AUDIOIO = 0
CIRCUITPY_ROTARYIO = 0
CIRCUITPY_RTC = 0
CIRCUITPY_SDCARDIO = 0
CIRCUITPY_FRAMEBUFFERIO = 0
CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_I2CPERIPHERAL = 0
CIRCUITPY_DISPLAYIO = 0 # Requires SPI, PulseIO (stub ok)
# Requires SPI, PulseIO (stub ok):
CIRCUITPY_DISPLAYIO = 0
# These modules are implemented in shared-module/ - they can be included in
# any port once their prerequisites in common-hal are complete.
CIRCUITPY_BITBANGIO = 0 # Requires DigitalIO
CIRCUITPY_GAMEPAD = 0 # Requires DigitalIO
CIRCUITPY_PIXELBUF = 0 # Requires neopixel_write or SPI (dotstar)
CIRCUITPY_RANDOM = 0 # Requires OS
CIRCUITPY_STORAGE = 0 # Requires OS, filesystem
CIRCUITPY_TOUCHIO = 0 # Requires Microcontroller
CIRCUITPY_USB_HID = 0 # Requires USB
CIRCUITPY_USB_MIDI = 0 # Requires USB
CIRCUITPY_REQUIRE_I2C_PULLUPS = 0 # Does nothing without I2C
CIRCUITPY_ULAB = 0 # No requirements, but takes extra flash
# Requires DigitalIO:
CIRCUITPY_BITBANGIO = 0
# Requires DigitalIO
CIRCUITPY_GAMEPAD = 0
# Requires neopixel_write or SPI (dotstar)
CIRCUITPY_PIXELBUF = 0
# Requires OS
CIRCUITPY_RANDOM = 0
# Requires OS, filesystem
CIRCUITPY_STORAGE = 0
# Requires Microcontroller
CIRCUITPY_TOUCHIO = 0
# Requires USB
CIRCUITPY_USB_HID = 0
CIRCUITPY_USB_MIDI = 0
# Does nothing without I2C
CIRCUITPY_REQUIRE_I2C_PULLUPS = 0
# No requirements, but takes extra flash
CIRCUITPY_ULAB = 0
Step 2: Init
--------------
Expand Down
59 changes: 33 additions & 26 deletions docs/shared_bindings_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import subprocess
import sys

from concurrent.futures import ThreadPoolExecutor

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

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


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

def all_ports_all_boards(ports=SUPPORTED_PORTS):
for port in ports:

port_dir = get_circuitpython_root_dir() / "ports" / port
for entry in (port_dir / "boards").iterdir():
if not entry.is_dir():
continue
yield (port, entry)

def support_matrix_by_board(use_branded_name=True):
""" Compiles a list of the available core modules available for each
board.
"""
base = build_module_map()

boards = dict()
for port in SUPPORTED_PORTS:

def support_matrix(arg):
port, entry = arg
port_dir = get_circuitpython_root_dir() / "ports" / port
for entry in (port_dir / "boards").iterdir():
if not entry.is_dir():
continue
board_modules = []
board_name = entry.name

settings = get_settings_from_makefile(str(port_dir), entry.name)

if use_branded_name:
with open(entry / "mpconfigboard.h") as get_name:
board_contents = get_name.read()
board_name_re = re.search(r"(?<=MICROPY_HW_BOARD_NAME)\s+(.+)",
board_contents)
if board_name_re:
board_name = board_name_re.group(1).strip('"')

board_modules = []
for module in base:
key = f'CIRCUITPY_{module.upper()}'
if int(lookup_setting(settings, key, '0')):
board_modules.append(base[module]['name'])
boards[board_name] = sorted(board_modules)
settings = get_settings_from_makefile(str(port_dir), entry.name)

if use_branded_name:
with open(entry / "mpconfigboard.h") as get_name:
board_contents = get_name.read()
board_name_re = re.search(r"(?<=MICROPY_HW_BOARD_NAME)\s+(.+)",
board_contents)
if board_name_re:
board_name = board_name_re.group(1).strip('"')

board_modules = []
for module in base:
key = f'CIRCUITPY_{module.upper()}'
if int(lookup_setting(settings, key, '0')):
board_modules.append(base[module]['name'])

return (board_name, sorted(board_modules))

executor = ThreadPoolExecutor(max_workers=os.cpu_count())
boards = dict(sorted(executor.map(support_matrix, all_ports_all_boards())))

#print(json.dumps(boards, indent=2))
return boards
Expand Down
2 changes: 2 additions & 0 deletions lib/utils/pyexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ STATIC int parse_compile_execute(const void *source, mp_parse_input_kind_t input
start = mp_hal_ticks_ms();
mp_call_function_0(module_fun);
mp_hal_set_interrupt_char(-1); // disable interrupt
// Handle any ctrl-c interrupt that arrived just in time
mp_handle_pending();
nlr_pop();
ret = 0;
if (exec_flags & EXEC_FLAG_PRINT_EOF) {
Expand Down
17 changes: 15 additions & 2 deletions locale/ID.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-14 09:36-0400\n"
"POT-Creation-Date: 2020-08-18 11:19-0400\n"
"PO-Revision-Date: 2020-07-06 18:10+0000\n"
"Last-Translator: oon arfiandwi <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -764,7 +764,7 @@ msgstr "Error pada regex"

#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c
#: shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
msgid "Expected a %q"
msgstr "Diharapkan %q"
Expand Down Expand Up @@ -1352,6 +1352,15 @@ msgstr "Tambahkan module apapun pada filesystem\n"
msgid "Polygon needs at least 3 points"
msgstr ""

#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
#: ports/cxd56/common-hal/pulseio/PulseOut.c
#: ports/nrf/common-hal/pulseio/PulseOut.c
#: ports/stm/common-hal/pulseio/PulseOut.c
msgid ""
"Port does not accept pins or frequency. "
"Construct and pass a PWMOut Carrier instead"
msgstr ""

#: shared-bindings/_bleio/Adapter.c
msgid "Prefix buffer must be on the heap"
msgstr ""
Expand All @@ -1366,6 +1375,10 @@ msgstr ""
msgid "Pull not used when direction is output."
msgstr ""

#: ports/stm/ref/pulseout-pre-timeralloc.c
msgid "PulseOut not supported on this chip"
msgstr ""

#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr ""
Expand Down
Loading

0 comments on commit 6dbd369

Please sign in to comment.