Showing 350 changed files with 6,920 additions and 5,263 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ jobs:
- name: Test all
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py -j1
working-directory: tests
- name: Print failure info
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py -j1 --print-failures
if: failure()
working-directory: tests
- name: Native Tests
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py -j1 --emit native
working-directory: tests
Expand Down Expand Up @@ -228,6 +232,7 @@ jobs:
- "bdmicro_vina_d51_pcb7"
- "bless_dev_board_multi_sensor"
- "blm_badge"
- "bluemicro840"
- "capablerobot_usbhub"
- "catwan_usbstick"
- "circuitbrains_basic_m0"
Expand Down Expand Up @@ -341,6 +346,7 @@ jobs:
- "qtpy_m0_haxpress"
- "raspberry_pi_pico"
- "raytac_mdbt50q-db-40"
- "raytac_mdbt50q-rx"
- "robohatmm1_m4"
- "sam32"
- "same54_xplained"
Expand All @@ -364,6 +370,7 @@ jobs:
- "sparkfun_samd21_mini"
- "sparkfun_samd51_micromod"
- "sparkfun_samd51_thing_plus"
- "sparkfun_stm32f405_micromod"
- "sparkfun_thing_plus_rp2040"
- "spresense"
- "stackrduino_m0_pro"
Expand Down Expand Up @@ -504,6 +511,10 @@ jobs:
- "espressif_saola_1_wrover"
- "franzininho_wifi_wroom"
- "franzininho_wifi_wrover"
- "gravitech_cucumber_m"
- "gravitech_cucumber_ms"
- "gravitech_cucumber_r"
- "gravitech_cucumber_rs"
- "lilygo_ttgo_t8_s2_st7789"
- "microdev_micro_s2"
- "muselab_nanoesp32_s2_wroom"
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,6 @@
[submodule "frozen/Adafruit_CircuitPython_SimpleIO"]
path = frozen/Adafruit_CircuitPython_SimpleIO
url = https://github.com/adafruit/adafruit_circuitpython_simpleio
[submodule "lib/quirc"]
path = lib/quirc
url = https://github.com/adafruit/quirc.git
3 changes: 1 addition & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ Behavior
- Autoreload is disabled while the REPL is active.
- Main is one of these: ``code.txt``, ``code.py``, ``main.py``,
``main.txt``
- Boot is one of these: ``settings.txt``, ``settings.py``, ``boot.py``,
``boot.txt``
- Boot is one of these: ``boot.py``, ``boot.txt``

API
~~~
Expand Down
11 changes: 10 additions & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import sys
import urllib.parse
import time
from collections import defaultdict

from sphinx.transforms import SphinxTransform
from docutils import nodes
Expand All @@ -47,9 +48,15 @@

#modules_support_matrix = shared_bindings_matrix.support_matrix_excluded_boards()
modules_support_matrix = shared_bindings_matrix.support_matrix_by_board()
modules_support_matrix_reverse = defaultdict(list)
for board, modules in modules_support_matrix.items():
for module in modules:
modules_support_matrix_reverse[module].append(board)
modules_support_matrix_reverse = dict((module, sorted(boards)) for module, boards in modules_support_matrix_reverse.items())

html_context = {
'support_matrix': modules_support_matrix
'support_matrix': modules_support_matrix,
'support_matrix_reverse': modules_support_matrix_reverse
}

# -- General configuration ------------------------------------------------
Expand Down Expand Up @@ -94,6 +101,8 @@
autoapi_python_class_content = "both"
autoapi_python_use_implicit_namespaces = True
autoapi_root = "shared-bindings"
def autoapi_prepare_jinja_env(jinja_env):
jinja_env.globals['support_matrix_reverse'] = modules_support_matrix_reverse

redirects_file = 'docs/redirects.txt'

Expand Down
16 changes: 16 additions & 0 deletions docs/autoapi/templates/python/module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@

{% endif %}

{% if support_matrix_reverse[obj.name] is defined %}
.. raw:: html

<p>
<details>
<summary>Available on these boards</summary>
<ul>
{% for board in support_matrix_reverse[obj.name] %}
<li> {{ board }}
{% endfor %}
</ul>
</details>
</p>

{% endif %}

{% block subpackages %}
{% set visible_subpackages = obj.subpackages|selectattr("display")|list %}
{% if visible_subpackages %}
Expand Down
2 changes: 1 addition & 1 deletion docs/common_hal.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ These instructions also apply to `analogio`, `busio`, `pulseio` and `touchio`. M
Common HAL related files are found in these locations:

* `shared-bindings` Shared home for the Python <-> C bindings which includes inline RST documentation for the created interfaces. The common hal functions are defined in the .h files of the corresponding C files.
* `shared-modules` Shared home for C code built on the Common HAL and used by all ports. This code only uses `common_hal` methods defined in `shared-bindings`.
* `shared-module` Shared home for C code built on the Common HAL and used by all ports. This code only uses `common_hal` methods defined in `shared-bindings`.
* `<port>/common-hal` Port-specific implementation of the Common HAL.

Each folder has the substructure of <python module name>/<class name> and they should match 1:1. `__init__.c` is used for module globals that are not classes (similar to `__init__.py`).
Expand Down
2 changes: 1 addition & 1 deletion docs/porting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ as a natural "TODO" list. An example minimal build list is shown below:
# Requires DigitalIO:
CIRCUITPY_BITBANGIO = 0
# Requires DigitalIO
CIRCUITPY_GAMEPAD = 0
CIRCUITPY_GAMEPADSHIFT = 0
# Requires neopixel_write or SPI (dotstar)
CIRCUITPY_PIXELBUF = 0
# Requires OS
Expand Down
3 changes: 0 additions & 3 deletions docs/redirects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,7 @@ shared-bindings/ustack/__init__.rst shared-bindings/ustack/
shared-bindings/vectorio/Circle.rst shared-bindings/vectorio/#vectorio.Circle
shared-bindings/vectorio/Polygon.rst shared-bindings/vectorio/#vectorio.Polygon
shared-bindings/vectorio/Rectangle.rst shared-bindings/vectorio/#vectorio.Rectangle
shared-bindings/vectorio/VectorShape.rst shared-bindings/vectorio/#vectorio.VectorShape
shared-bindings/vectorio/__init__.rst shared-bindings/vectorio/
shared-bindings/watchdog/WatchDogMode.rst shared-bindings/watchdog/#watchdog.WatchDogMode
shared-bindings/watchdog/WatchDogTimer.rst shared-bindings/watchdog/#watchdog.WatchDogTimer
shared-bindings/watchdog/__init__.rst shared-bindings/watchdog/
shared-bindings/wiznet/WIZNET5K.rst shared-bindings/wiznet/#wiznet.WIZNET5K
shared-bindings/wiznet/__init__.rst shared-bindings/wiznet/
1 change: 0 additions & 1 deletion docs/shared_bindings_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
additional_modules = {
"fontio": "CIRCUITPY_DISPLAYIO",
"terminalio": "CIRCUITPY_DISPLAYIO",
# "socket": "CIRCUITPY_NETWORK",
"adafruit_bus_device": "CIRCUITPY_BUSDEVICE",
"adafruit_pixelbuf": "CIRCUITPY_PIXELBUF"
}
Expand Down
1 change: 1 addition & 0 deletions lib/quirc
Submodule quirc added at 8c6ffa
9 changes: 7 additions & 2 deletions lib/utils/pyexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,14 @@ STATIC int parse_compile_execute(const void *source, mp_parse_input_kind_t input
}
if (result != NULL) {
result->return_code = ret;
#if CIRCUITPY_ALARM
// Don't set the exception object if we exited for deep sleep.
if (ret != 0 && ret != PYEXEC_DEEP_SLEEP) {
#else
if (ret != 0) {
#endif
mp_obj_t return_value = (mp_obj_t)nlr.ret_val;
result->exception_type = mp_obj_get_type(return_value);
result->exception = return_value;
result->exception_line = -1;

if (mp_obj_is_exception_instance(return_value)) {
Expand Down Expand Up @@ -242,7 +247,7 @@ STATIC mp_uint_t mp_reader_stdin_readbyte(void *data) {
mp_hal_stdout_tx_strn("\x04", 1); // indicate end to host
if (c == CHAR_CTRL_C) {
#if MICROPY_KBD_EXCEPTION
MP_STATE_VM(mp_kbd_exception).traceback_data = NULL;
MP_STATE_VM(mp_kbd_exception).traceback->data = NULL;
nlr_raise(MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)));
#else
mp_raise_type(&mp_type_KeyboardInterrupt);
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/pyexec.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ typedef enum {

typedef struct {
int return_code;
const mp_obj_type_t *exception_type;
mp_obj_t exception;
int exception_line;
} pyexec_result_t;

Expand Down
Loading