Skip to content

Commit 162fa6e

Browse files
committed
Merge remote-tracking branch 'origin/main' into extra-memset
2 parents 91e15af + d8dfd4f commit 162fa6e

File tree

734 files changed

+19922
-14101
lines changed

Some content is hidden

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

734 files changed

+19922
-14101
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,13 @@ jobs:
287287
fetch-depth: 1
288288
- name: Get CP deps
289289
run: python tools/ci_fetch_deps.py ${{ matrix.board }} ${{ github.sha }}
290+
- uses: carlosperate/arm-none-eabi-gcc-action@v1
291+
with:
292+
release: '10-2020-q4'
290293
- name: Install dependencies
291294
run: |
292295
sudo apt-get install -y gettext
293296
pip install -r requirements-ci.txt -r requirements-dev.txt
294-
wget --no-verbose https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
295-
sudo tar -C /usr --strip-components=1 -xaf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
296297
- name: Versions
297298
run: |
298299
gcc --version
@@ -382,7 +383,8 @@ jobs:
382383
if: ${{ needs.test.outputs.boards-espressif != '[]' }}
383384
steps:
384385
- name: Set up Python 3
385-
uses: actions/setup-python@v2
386+
id: py3
387+
uses: actions/setup-python@v4
386388
with:
387389
python-version: "3.x"
388390
- uses: actions/[email protected]
@@ -400,7 +402,7 @@ jobs:
400402
id: idf-cache
401403
with:
402404
path: ${{ github.workspace }}/.idf_tools
403-
key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/espressif/esp-idf/HEAD') }}-20220404
405+
key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/espressif/esp-idf/HEAD') }}-${{ steps.py3.outputs.python-path }}-20220404
404406
- name: Clone IDF submodules
405407
run: |
406408
(cd $IDF_PATH && git submodule update --init)
@@ -486,8 +488,9 @@ jobs:
486488
pip install -r requirements-ci.txt -r requirements-dev.txt
487489
wget --no-verbose https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz
488490
sudo tar -C /usr --strip-components=1 -xaf gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz
489-
wget --no-verbose https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
490-
sudo tar -C /usr --strip-components=1 -xaf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
491+
- uses: carlosperate/arm-none-eabi-gcc-action@v1
492+
with:
493+
release: '10-2020-q4'
491494
- name: Install mkfs.fat
492495
run: |
493496
wget https://github.com/dosfstools/dosfstools/releases/download/v4.2/dosfstools-4.2.tar.gz

.gitmodules

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@
145145
url = https://github.com/adafruit/Adafruit_CircuitPython_RFM69.git
146146
[submodule "ports/espressif/esp-idf"]
147147
path = ports/espressif/esp-idf
148-
url = https://github.com/espressif/esp-idf.git
149-
branch = release/v4.4
148+
url = https://github.com/adafruit/esp-idf.git
149+
branch = circuitpython8
150150
[submodule "ports/espressif/certificates/nina-fw"]
151151
path = ports/espressif/certificates/nina-fw
152152
url = https://github.com/adafruit/nina-fw.git
@@ -289,3 +289,21 @@
289289
[submodule "frozen/pew-pewpew-lcd"]
290290
path = frozen/pew-pewpew-lcd
291291
url = https://github.com/pypewpew/pew-pewpew-lcd.git
292+
[submodule "frozen/mixgo_cp_lib"]
293+
path = frozen/mixgo_cp_lib
294+
url = https://github.com/dahanzimin/circuitpython_lib.git
295+
[submodule "frozen/Adafruit_CircuitPython_IS31FL3731"]
296+
path = frozen/Adafruit_CircuitPython_IS31FL3731
297+
url = https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3731.git
298+
[submodule "frozen/Adafruit_CircuitPython_Ticks"]
299+
path = frozen/Adafruit_CircuitPython_Ticks
300+
url = https://github.com/adafruit/Adafruit_CircuitPython_Ticks.git
301+
[submodule "frozen/Adafruit_CircuitPython_asyncio"]
302+
path = frozen/Adafruit_CircuitPython_asyncio
303+
url = https://github.com/adafruit/Adafruit_CircuitPython_asyncio.git
304+
[submodule "frozen/circuitpython_ef_music"]
305+
path = frozen/circuitpython_ef_music
306+
url = https://github.com/elecfreaks/circuitpython_ef_music.git
307+
[submodule "frozen/circuitpython_picoed"]
308+
path = frozen/circuitpython_picoed
309+
url = https://github.com/elecfreaks/circuitpython_picoed.git

.readthedocs.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,15 @@
99
version: 2
1010

1111
build:
12-
os: ubuntu-20.04
13-
tools:
14-
python: "3"
15-
16-
submodules:
17-
include:
18-
- extmod/ulab
12+
os: ubuntu-20.04
13+
tools:
14+
python: "3"
15+
jobs:
16+
post_install:
17+
- python tools/ci_fetch_deps.py docs HEAD
1918

2019
formats:
21-
- pdf
20+
- pdf
2221

2322
python:
2423
install:

BUILDING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ The test suite in the top level `tests` directory. It needs the unix port to ru
7070
Then you can run the test suite:
7171

7272
cd ../../tests
73-
./run-tests
73+
./run-tests.py
7474

7575
A successful run will say something like
7676

README.rst

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,11 @@ If you'd like to use the term "CircuitPython" and Blinka for your product here i
9090
* Your product is listed on `circuitpython.org <https://circuitpython.org>`__ (source
9191
`here <https://github.com/adafruit/circuitpython-org/>`_). This is to ensure that a user of your
9292
product can always download the latest version of CircuitPython from the standard place.
93-
* Your product has a user accessible USB plug which appears as a CIRCUITPY drive when plugged in
94-
AND/OR provides file and serial access over Bluetooth Low Energy. Boards that do not support USB
95-
should be clearly marked as BLE-only CircuitPython.
93+
* Your product supports at least one standard "`Workflow <https://docs.circuitpython.org/en/latest/docs/workflows.html>`__" for serial and file access:
94+
* With a user accessible USB plug which appears as a CIRCUITPY drive when plugged in.
95+
* With file and serial access over Bluetooth Low Energy using the BLE Workflow.
96+
* With file access over WiFi using the WiFi Workflow with serial access over USB and/or WebSocket.
97+
* Boards that do not support the USB Workflow should be clearly marked.
9698

9799
If you choose not to meet these requirements, then we ask you call your version of CircuitPython
98100
something else (for example, SuperDuperPython) and not use the Blinka logo. You can say it is
@@ -120,7 +122,7 @@ Behavior
120122
make each file independent from each other.
121123

122124
- ``boot.py`` runs only once on start up before
123-
USB is initialized. This lays the ground work for configuring USB at
125+
workflows are initialized. This lays the ground work for configuring USB at
124126
startup rather than it being fixed. Since serial is not available,
125127
output is written to ``boot_out.txt``.
126128
- ``code.py`` (or ``main.py``) is run after every reload until it
@@ -135,7 +137,10 @@ Behavior
135137
possible to fix code that causes nasty crashes by making it available through mass storage after
136138
the crash. A reset (the button) is needed after it's fixed to get back into normal mode.
137139
- RGB status LED indicating CircuitPython state.
138-
- Re-runs ``code.py`` or other main file after file system writes over USB mass storage. (Disable with
140+
- One green flash - code completed without error.
141+
- Two red flashes - code ended due to an exception.
142+
- Three yellow flashes - safe mode. May be due to CircuitPython internal error.
143+
- Re-runs ``code.py`` or other main file after file system writes by a workflow. (Disable with
139144
``supervisor.disable_autoreload()``)
140145
- Autoreload is disabled while the REPL is active.
141146
- Main is one of these: ``code.txt``, ``code.py``, ``main.py``,

conf.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,25 @@
3333

3434
tools_describe = str(pathlib.Path(__file__).parent / "tools/describe")
3535

36+
# Monkeypatch autoapi
37+
def _format_args(args_info, include_annotations=True, ignore_self=None):
38+
result = []
39+
40+
for i, (prefix, name, annotation, default) in enumerate(args_info):
41+
if i == 0 and ignore_self is not None and name == ignore_self:
42+
continue
43+
formatted = "{}{}{}{}".format(
44+
prefix or "",
45+
name or "",
46+
": {}".format(annotation) if annotation and include_annotations else "",
47+
(" = {}" if annotation else "={}").format(default) if default else "",
48+
)
49+
result.append(formatted)
50+
return ", ".join(result)
51+
52+
import autoapi.mappers.python.objects as objects
53+
objects._format_args = _format_args
54+
3655
# If extensions (or modules to document with autodoc) are in another directory,
3756
# add these directories to sys.path here. If the directory is relative to the
3857
# documentation root, use os.path.abspath to make it absolute, like shown here.

data/nvm.toml

devices/ble_hci/common-hal/_bleio/Adapter.c

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
#include "shared-bindings/_bleio/ScanEntry.h"
5050
#include "shared-bindings/time/__init__.h"
5151

52+
#if CIRCUITPY_DOTENV
53+
#include "shared-module/dotenv/__init__.h"
54+
#endif
55+
5256
#define MSEC_TO_UNITS(TIME, RESOLUTION) (((TIME) * 1000) / (RESOLUTION))
5357
#define SEC_TO_UNITS(TIME, RESOLUTION) (((TIME) * 1000000) / (RESOLUTION))
5458
#define UNITS_TO_SEC(TIME, RESOLUTION) (((TIME)*(RESOLUTION)) / 1000000)
@@ -278,17 +282,27 @@ char default_ble_name[] = { 'C', 'I', 'R', 'C', 'U', 'I', 'T', 'P', 'Y', 0, 0, 0
278282
// Get various values and limits set by the adapter.
279283
// Set event mask.
280284
STATIC void bleio_adapter_hci_init(bleio_adapter_obj_t *self) {
285+
mp_int_t name_len = 0;
281286

282-
const size_t len = sizeof(default_ble_name);
283-
284-
bt_addr_t addr;
285-
hci_check_error(hci_read_bd_addr(&addr));
286-
287-
default_ble_name[len - 4] = nibble_to_hex_lower[addr.val[1] >> 4 & 0xf];
288-
default_ble_name[len - 3] = nibble_to_hex_lower[addr.val[1] & 0xf];
289-
default_ble_name[len - 2] = nibble_to_hex_lower[addr.val[0] >> 4 & 0xf];
290-
default_ble_name[len - 1] = nibble_to_hex_lower[addr.val[0] & 0xf];
291-
self->name = mp_obj_new_str(default_ble_name, len);
287+
#if CIRCUITPY_DOTENV
288+
char ble_name[32];
289+
name_len = dotenv_get_key("/.env", "CIRCUITPY_BLE_NAME", ble_name, sizeof(ble_name) - 1);
290+
if (name_len > 0) {
291+
self->name = mp_obj_new_str(ble_name, (size_t)name_len);
292+
}
293+
#endif
294+
295+
if (name_len <= 0) {
296+
name_len = sizeof(default_ble_name);
297+
bt_addr_t addr;
298+
hci_check_error(hci_read_bd_addr(&addr));
299+
300+
default_ble_name[name_len - 4] = nibble_to_hex_lower[addr.val[1] >> 4 & 0xf];
301+
default_ble_name[name_len - 3] = nibble_to_hex_lower[addr.val[1] & 0xf];
302+
default_ble_name[name_len - 2] = nibble_to_hex_lower[addr.val[0] >> 4 & 0xf];
303+
default_ble_name[name_len - 1] = nibble_to_hex_lower[addr.val[0] & 0xf];
304+
self->name = mp_obj_new_str(default_ble_name, (uint8_t)name_len);
305+
}
292306

293307
// Get version information.
294308
if (hci_read_local_version(&self->hci_version, &self->hci_revision, &self->lmp_version,

devices/ble_hci/common-hal/_bleio/Characteristic.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self,
5757
self->value = mp_obj_new_bytes(initial_value_bufinfo->buf, initial_value_bufinfo->len);
5858

5959
const mp_int_t max_length_max = 512;
60-
if (max_length < 0 || max_length > max_length_max) {
61-
mp_raise_ValueError(translate("max_length must be <= 512"));
62-
}
60+
61+
mp_arg_validate_int_range(max_length, 0, max_length_max, MP_QSTR_max_length);
62+
6363
self->max_length = max_length;
6464
self->fixed_length = fixed_length;
6565

devices/ble_hci/common-hal/_bleio/att.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include "shared-bindings/_bleio/Service.h"
4545
#include "shared-bindings/_bleio/UUID.h"
4646
#include "supervisor/shared/tick.h"
47+
#include "supervisor/shared/translate/translate.h"
4748

4849
STATIC uint16_t max_mtu = BT_ATT_DEFAULT_LE_MTU; // 23
4950
STATIC unsigned long timeout = 5000;

0 commit comments

Comments
 (0)