8000 Merge remote-tracking branch 'adafruit/main' into audioeffect-reverb · unwiredben/circuitpython@3478eea · GitHub
[go: up one dir, main page]

Skip to content

Commit 3478eea

Browse files
committed
Merge remote-tracking branch 'adafruit/main' into audioeffect-reverb
2 parents f6357d5 + 670d046 commit 3478eea

File tree

304 files changed

+7780
-2687
lines changed

Some content is hidden

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

304 files changed

+7780
-2687
lines changed

.github/actions/deps/ports/broadcom/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ runs:
55
steps:
66
- name: Get broadcom toolchain
77
run: |
8-
wget --no-verbose https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz
9-
sudo tar -C /usr --strip-components=1 -xaf gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz
8+
wget --no-verbose https://adafruit-circuit-python.s3.amazonaws.com/arm-gnu-toolchain-13.3.rel1-x86_64-aarch64-none-elf.tar.xz
9+
sudo tar -C /usr --strip-components=1 -xaf arm-gnu-toolchain-13.3.rel1-x86_64-aarch64-none-elf.tar.xz
1010
sudo apt-get update
1111
sudo apt-get install -y mtools
1212
shell: bash

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,8 @@ TAGS
9797
# clangd cache
9898
##############
9999
.cache
100+
101+
**/CLAUDE.local.md
102+
103+
# windsurf rules
104+
.windsurfrules

.gitmodules

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@
172172
url = https://github.com/adafruit/Adafruit_CircuitPython_SimpleMath
173173
[submodule "ports/raspberrypi/sdk"]
174174
path = ports/raspberrypi/sdk
175-
url = https://github.com/raspberrypi/pico-sdk.git
175+
url = https://github.com/adafruit/pico-sdk.git
176+
branch = force_inline_critical_section
176177
[submodule "data/nvm.toml"]
177178
path = data/nvm.toml
178179
url = https://github.com/adafruit/nvm.toml.git
@@ -345,7 +346,7 @@
345346
url = https://github.com/adafruit/Adafruit_CircuitPython_Wave.git
346347
[submodule "ports/raspberrypi/lib/Pico-PIO-USB"]
347348
path = ports/raspberrypi/lib/Pico-PIO-USB
348-
url = https://github.com/adafruit/Pico-PIO-USB.git
349+
url = https://github.com/sekigon-gonnoc/Pico-PIO-USB.git
349350
branch = main
350351
[submodule "lib/micropython-lib"]
351352
path = lib/micropython-lib

.pre-commit-config.yaml

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,33 @@
44

55
# CIRCUITPY-CHANGE: CircuitPython-specific.
66

7+
# Note that by default, pre-commit hooks do not look inside submodules.
8+
# So you don't need to exclude submodules explicitly here.
9+
710
repos:
8-
- repo: https://github.com/pre-commit/pre-commit-hooks
11+
- repo: https://github.com/pre-commit/pre-commit-hooks
912
rev: v5.0.0
1013
hooks:
11-
- id: check-yaml
12-
- id: end-of-file-fixer
13-
exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|ports/mimxrt10xx/sdk|ports/raspberrypi/sdk|lib/tinyusb)'
14-
- id: trailing-whitespace
15-
exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|lib/mbedtls_errors/generate_errors.diff|ports/raspberrypi/sdk|ports/mimxrt10xx/sdk|lib/tinyusb)'
16-
- repo: https://github.com/codespell-project/codespell
14+
- id: check-yaml
15+
- id: end-of-file-fixer
16+
exclude: |
17+
(?x)^(
18+
tests/.*\.exp|
19+
tests/cmdline/.*|
20+
tests/.*/data/.*
21+
)
22+
- id: trailing-whitespace
23+
exclude: |
24+
(?x)^(
25+
tests/.*\.exp|
26+
tests/cmdline/.*|
27+
tests/.*/data/.*|
28+
lib/mbedtls_errors/generate_errors.diff
29+
)
30+
- repo: https://github.com/codespell-project/codespell
1731
rev: v2.2.4
1832
hooks:
19-
- id: codespell
33+
- id: codespell
2034
args: [-w]
2135
exclude: |
2236
(?x)^(
@@ -25,38 +39,30 @@ repos:
2539
tests/unicode/data/utf-8_invalid.txt|
2640
tests/extmod/data/qr.pgm|
2741
tests/basics/bytearray_byte_operations.py|
28-
ports/raspberrypi/sdk|
2942
ports/zephyr-cp/cptools/compat2driver.py
3043
)
31-
- repo: local
44+
- repo: local
3245
hooks:
33-
- id: translations
46+
- id: translations
3447
name: Translations
3548
entry: sh -c "if ! make check-translate; then make translate; fi"
3649
types: [c]
3750
pass_filenames: false
3851
language: system
39-
- id: formatting
52+
- id: formatting
4053
name: Formatting
41-
entry: python3 tools/codeformat.py
42-
types: [c]
43-
language: system
44-
exclude: |
45-
(?x)^(
46-
lib/tinyusb|
47-
ports/raspberrypi/sdk
48-
)
49-
- repo: https://github.com/astral-sh/ruff-pre-commit
50-
# Ruff version.
51-
rev: v0.9.4
52-
hooks:
53-
# Run the linter.
54-
- id: ruff
55-
args: [ --fix ]
56-
# Run the formatter.
57-
- id: ruff-format
58-
- repo: https://github.com/tox-dev/pyproject-fmt
59-
rev: "v2.5.0"
60-
hooks:
61-
- id: pyproject-fmt
62-
exclude: '^(ports/mimxrt10xx/sdk)'
54+
entry: python3 tools/codeformat.py -v -c
55+
language: python
56+
- repo: https://github.com/astral-sh/ruff-pre-commit
57+
# Ruff version.
58+
rev: v0.9.4
59+
hooks:
60+
# Run the linter.
61+
- id: ruff
62+
args: [ --fix ]
63+
# Run the formatter.
64+
- id: ruff-format
65+
- repo: https://github.com/tox-dev/pyproject-fmt
66+
rev: "v2.5.0"
67+
hooks:
68+
- id: pyproject-fmt

docs/environment.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,18 @@ This feature is not enabled on boards that the CIRCUITPY_OS_GETENV (os CIRCUIPTY
189189
flag has been set to 0. Currently this is primarily boards with limited flash including some
190190
of the Atmel_samd boards based on the SAMD21/M0 microprocessor.
191191

192+
CIRCUITPY_TERMINAL_FONT
193+
~~~~~~~~~~~~~~~~~~~~~~~
194+
Specifies a custom font file path to use for the terminalio console instead of the default
195+
``/fonts/terminal.lvfontbin``. This allows users to create and use custom fonts for the
196+
CircuitPython console.
197+
198+
This feature requires both CIRCUITPY_OS_GETENV and CIRCUITPY_LVFONTIO to be enabled.
199+
200+
Example:
201+
202+
.. code-block::
203+
204+
CIRCUITPY_TERMINAL_FONT="/fonts/myfont.lvfontbin"
205+
192206
`boards that the terminalio core module is available on <https://docs.circuitpython.org/en/latest/shared-bindings/terminalio/>`_

docs/shared_bindings_matrix.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666

6767
ADDITIONAL_MODULES = {
6868
"_asyncio": "MICROPY_PY_ASYNCIO",
69+
"_bleio (native)": "CIRCUITPY_BLEIO_NATIVE",
70+
"_bleio (HCI co-processor)": "CIRCUITPY_BLEIO_HCI",
6971
"_eve": "CIRCUITPY__EVE",
7072
"adafruit_bus_device": "CIRCUITPY_BUSDEVICE",
7173
"adafruit_pixelbuf": "CIRCUITPY_PIXELBUF",

docs/workflows.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,30 @@ The workflow APIs are documented here.
1919
These USB interfaces are enabled by default on boards with USB support. They are usable once the
2020
device has been plugged into a host.
2121

22-
### CIRCUITPY drive
22+
### Mass Storage
2323
CircuitPython exposes a standard mass storage (MSC) interface to enable file manipulation over a
24-
standard interface. This interface works underneath the file system at the block level so using it
25-
excludes other types of workflows from manipulating the file system at the same time.
24+
standard interface. (This is how USB drives work.) This interface works underneath the file system at
25+
the block level so using it excludes other types of workflows from manipulating the file system at
26+
the same time.
27+
28+
CircuitPython 10.x adds multiple Logical Units (LUNs) to the mass storage interface. This allows for
29+
multiple drives to be accessed and ejected independently.
30+
31+
#### CIRCUITPY drive
32+
The CIRCUITPY drive is the main drive that CircuitPython uses. It is writable by the host by default
33+
and read-only to CircuitPython. `storage.remount()` can be used to remount the drive to
34+
CircuitPython as read-write.
35+
36+
#### CPSAVES drive
37+
The board may also expose a CPSAVES drive. (This is based on the ``CIRCUITPY_SAVES_PARTITION_SIZE``
38+
setting in ``mpconfigboard.h``.) It is a portion of the main flash that is writable by CircuitPython
39+
by default. It is read-only to the host. `storage.remount()` can be used to remount the drive to the
40+
host as read-write.
41+
42+
#### SD card drive
43+
A few boards have SD card automounting. (This is based on the ``DEFAULT_SD`` settings in
44+
``mpconfigboard.h``.) The card is writable from CircuitPython by default and read-only to the host.
45+
`storage.remount()` can be used to remount the drive to the host as read-write.
2646

2747
### CDC serial
2848
CircuitPython exposes one CDC USB interface for CircuitPython serial. This is a standard serial

extmod/modasyncio.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,6 @@ static const mp_rom_map_elem_t task_queue_locals_dict_table[] = {
160160
{ MP_ROM_QSTR(MP_QSTR_push), MP_ROM_PTR(&task_queue_push_obj) },
161161
{ MP_ROM_QSTR(MP_QSTR_pop), MP_ROM_PTR(&task_queue_pop_obj) },
162162
{ MP_ROM_QSTR(MP_QSTR_remove), MP_ROM_PTR(&task_queue_remove_obj) },
163-
164-
// CIRCUITPY-CHANGE: Remove these in CircuitPython 10.0.0
165-
{ MP_ROM_QSTR(MP_QSTR_push_head), MP_ROM_PTR(&task_queue_push_obj) },
166-
{ MP_ROM_QSTR(MP_QSTR_push_sorted), MP_ROM_PTR(&task_queue_push_obj) },
167-
{ MP_ROM_QSTR(MP_QSTR_pop_head), MP_ROM_PTR(&task_queue_pop_obj) },
168163
};
169164
static MP_DEFINE_CONST_DICT(task_queue_locals_dict, task_queue_locals_dict_ 10000 table);
170165

extmod/vfs.c

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@
4747
#include "extmod/vfs_posix.h"
4848
#endif
4949

50+
51+
#if CIRCUITPY_SDCARDIO
52+
#include "shared-module/sdcardio/__init__.h"
53+
#endif
54+
5055
// For mp_vfs_proxy_call, the maximum number of additional args that can be passed.
5156
// A fixed maximum size is used to avoid the need for a costly variable array.
5257
#define PROXY_MAX_ARGS (2)
@@ -67,6 +72,10 @@ mp_vfs_mount_t *mp_vfs_lookup_path(const char *path, const char **path_out) {
6772
// path is "" or "/" so return virtual root
6873
return MP_VFS_ROOT;
6974
}
75+
// CIRCUITPY-CHANGE: Try and automount the SD card.
76+
#if CIRCUITPY_SDCARDIO
77+
automount_sd_card();
78+
#endif
7079
for (mp_vfs_mount_t *vfs = MP_STATE_VM(vfs_mount_table); vfs != NULL; vfs = vfs->next) {
7180
size_t len = vfs->len - 1;
7281
if (len == 0) {
@@ -367,8 +376,18 @@ mp_obj_t mp_vfs_getcwd(void) {
367376
}
368377
MP_DEFINE_CONST_FUN_OBJ_0(mp_vfs_getcwd_obj, mp_vfs_getcwd);
369378

370-
// CIRCUITPY-CHANGE: accessible from shared-module/os/__init__.c
371-
mp_obj_t mp_vfs_ilistdir_it_iternext(mp_obj_t self_in) {
379+
typedef struct _mp_vfs_ilistdir_it_t {
380+
mp_obj_base_t base;
381+
mp_fun_1_t iternext;
382+
union {
383+
mp_vfs_mount_t *vfs;
384+
mp_obj_t iter;
385+
} cur;
386+
bool is_str;
387+
bool is_iter;
388+
} mp_vfs_ilistdir_it_t;
389+
390+
static mp_obj_t mp_vfs_ilistdir_it_iternext(mp_obj_t self_in) {
372391
mp_vfs_ilistdir_it_t *self = MP_OBJ_TO_PTR(self_in);
373392
if (self->is_iter) {
374393
// continue delegating to root dir

extmod/vfs.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,6 @@ typedef struct _mp_vfs_mount_t {
9494
struct _mp_vfs_mount_t *next;
9595
} mp_vfs_mount_t;
9696

97-
// CIRCUITPY-CHANGE: allow outside use of ilistdir_it_iternext
98-
typedef struct _mp_vfs_ilistdir_it_t {
99-
mp_obj_base_t base;
100-
mp_fun_1_t iternext;
101-
union {
102-
mp_vfs_mount_t *vfs;
103-
mp_obj_t iter;
104-
} cur;
105-
bool is_str;
106-
bool is_iter;
107-
} mp_vfs_ilistdir_it_t;
108-
109-
mp_obj_t mp_vfs_ilistdir_it_iternext(mp_obj_t self_in);
11097
void mp_vfs_blockdev_init(mp_vfs_blockdev_t *self, mp_obj_t bdev);
11198
int mp_vfs_blockdev_read(mp_vfs_blockdev_t *self, size_t block_num, size_t num_blocks, uint8_t *buf);
11299
int mp_vfs_blockdev_read_ext(mp_vfs_blockdev_t *self, size_t block_num, size_t block_off, size_t len, uint8_t *buf);

0 commit comments

Comments
 (0)
0