Skip to content

Commit a7afd66

Browse files
authored
Merge branch 'adafruit:main' into lilygo_t_display_rp2040
2 parents ff4a446 + 0708125 commit a7afd66

File tree

421 files changed

+10127
-3212
lines changed

Some content is hidden

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

421 files changed

+10127
-3212
lines changed

.github/workflows/build.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ jobs:
4242
run: python tools/ci_fetch_deps.py test ${{ github.sha }}
4343
- name: CircuitPython version
4444
run: |
45-
git describe --dirty --tags || git log --parents HEAD~4..
46-
echo >>$GITHUB_ENV CP_VERSION=$(git describe --dirty --tags)
45+
tools/describe || git log --parents HEAD~4..
46+
echo >>$GITHUB_ENV CP_VERSION=$(tools/describe)
4747
- name: Install dependencies
4848
run: |
4949
sudo apt-get update
@@ -72,10 +72,23 @@ jobs:
7272
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py -j1 --emit native
7373
working-directory: tests
7474
- name: mpy Tests
75-
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py -j1 --mpy-cross-flags='-mcache-lookup-bc' --via-mpy -d basics float micropython
75+
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py -j1 --via-mpy -d basics float micropython
7676
working-directory: tests
7777
- name: Native mpy Tests
78-
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py -j1 --mpy-cross-flags='-mcache-lookup-bc' --via-mpy --emit native -d basics float micropython
78+
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py -j1 --via-mpy --emit native -d basics float micropython
79+
working-directory: tests
80+
- name: Build native modules
81+
run: |
82+
make -C examples/natmod/features1
83+
make -C examples/natmod/features2
84+
make -C examples/natmod/btree
85+
make -C examples/natmod/framebuf
86+
make -C examples/natmod/uheapq
87+
make -C examples/natmod/urandom
88+
make -C examples/natmod/ure
89+
make -C examples/natmod/uzlib
90+
- name: Test native modules
91+
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-natmodtests.py extmod/{btree*,framebuf*,uheapq*,ure*,uzlib*}.py
7992
working-directory: tests
8093
- name: Build mpy-cross.static-aarch64
8194
run: make -C mpy-cross -j2 -f Makefile.static-aarch64
@@ -148,8 +161,8 @@ jobs:
148161
run: python tools/ci_fetch_deps.py mpy-cross-mac ${{ github.sha }}
149162
- name: CircuitPython version
150163
run: |
151-
git describe --dirty --tags
152-
echo >>$GITHUB_ENV CP_VERSION=$(git describe --dirty --tags)
164+
tools/describe || git log --parents HEAD~4..
165+
echo >>$GITHUB_ENV CP_VERSION=$(tools/describe)
153166
- name: Install dependencies
154167
run: |
155168
brew install gettext
@@ -204,8 +217,8 @@ jobs:
204217
run: python tools/ci_fetch_deps.py docs ${{ github.sha }}
205218
- name: CircuitPython version
206219
run: |
207-
git describe --dirty --tags
208-
echo >>$GITHUB_ENV CP_VERSION=$(git describe --dirty --tags)
220+
tools/describe || git log --parents HEAD~4..
221+
echo >>$GITHUB_ENV CP_VERSION=$(tools/describe)
209222
- name: Set up Python 3
210223
uses: actions/setup-python@v2
211224
with:
@@ -379,7 +392,9 @@ jobs:
379392
- name: Get CP deps
380393
run: python tools/ci_fetch_deps.py ${{ matrix.board }} ${{ github.sha }}
381394
- name: CircuitPython version
382-
run: git describe --dirty --tags
395+
run: |
396+
tools/describe || git log --parents HEAD~4..
397+
echo >>$GITHUB_ENV CP_VERSION=$(tools/describe)
383398
- uses: actions/cache@v2
384399
name: Fetch IDF tool cache
385400
id: idf-cache

.github/workflows/create_website_pr.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ jobs:
3434
gcc --version
3535
python3 --version
3636
- name: CircuitPython version
37-
run: git describe --dirty --tags
37+
run: |
38+
tools/describe || git log --parents HEAD~4..
39+
echo >>$GITHUB_ENV CP_VERSION=$(tools/describe)
3840
- name: Website
3941
run: python3 build_board_info.py
4042
working-directory: tools

.github/workflows/ports_windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ jobs:
7777
run: python tools/ci_fetch_deps.py windows ${{ github.sha }}
7878
- name: CircuitPython version
7979
run: |
80-
git describe --dirty --tags
81-
echo >>$GITHUB_ENV CP_VERSION=$(git describe --dirty --tags)
80+
tools/describe || git log --parents HEAD~4..
81+
echo >>$GITHUB_ENV CP_VERSION=$(tools/describe)
8282
8383
- name: build mpy-cross
8484
run: make -j2 -C mpy-cross

.gitmodules

Lines changed: 8 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/adafruit/esp-idf.git
149-
branch = circuitpython-v4.4
148+
url = https://github.com/espressif/esp-idf.git
149+
branch = release/v4.4
150150
[submodule "ports/espressif/certificates/nina-fw"]
151151
path = ports/espressif/certificates/nina-fw
152152
url = https://github.com/adafruit/nina-fw.git
@@ -277,3 +277,9 @@
277277
[submodule "ports/stm/st_driver/stm32f4xx_hal_driver"]
278278
path = ports/stm/st_driver/stm32f4xx_hal_driver
279279
url = https://github.com/adafruit/stm32f4xx_hal_driver.git
280+
[submodule "frozen/Adafruit_CircuitPython_PortalBase"]
281+
path = frozen/Adafruit_CircuitPython_PortalBase
282+
url = https://github.com/adafruit/Adafruit_CircuitPython_PortalBase.git
283+
[submodule "frozen/Adafruit_CircuitPython_FakeRequests"]
284+
path = frozen/Adafruit_CircuitPython_FakeRequests
285+
url = https://github.com/adafruit/Adafruit_CircuitPython_FakeRequests.git

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2013-2021 Damien P. George
3+
Copyright (c) 2013-2022 Damien P. George
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

conf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,15 @@
2424
import sys
2525
import urllib.parse
2626
import time
27+
import pathlib
2728
from collections import defaultdict
2829

2930
from sphinx.transforms import SphinxTransform
3031
from docutils import nodes
3132
from sphinx import addnodes
3233

34+
tools_describe = str(pathlib.Path(__file__).parent / "tools/describe")
35+
3336
# If extensions (or modules to document with autodoc) are in another directory,
3437
# add these directories to sys.path here. If the directory is relative to the
3538
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -129,7 +132,7 @@ def autoapi_prepare_jinja_env(jinja_env):
129132

130133
final_version = ""
131134
git_describe = subprocess.run(
132-
["git", "describe", "--dirty", "--tags"],
135+
[tools_describe],
133136
stdout=subprocess.PIPE,
134137
stderr=subprocess.STDOUT,
135138
encoding="utf-8"

docs/library/binascii.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,9 @@ Functions
3636
Encode binary data in base64 format, as in `RFC 3548
3737
<https://tools.ietf.org/html/rfc3548.html>`_. Returns the encoded data
3838
followed by a newline character, as a bytes object.
39+
40+
.. function:: crc32(data, value=0, /)
41+
42+
Compute CRC-32, the 32-bit checksum of the bytes in *data* starting with an
43+
initial CRC of *value*. The default initial CRC is 0. The algorithm is
44+
consistent with the ZIP file checksum.

docs/library/framebuf.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ For example::
2121
import framebuf
2222

2323
# FrameBuffer needs 2 bytes for every RGB565 pixel
24-
fbuf = framebuf.FrameBuffer(bytearray(10 * 100 * 2), 10, 100, framebuf.RGB565)
24+
fbuf = framebuf.FrameBuffer(bytearray(100 * 10 * 2), 100, 10, framebuf.RGB565)
2525

2626
fbuf.fill(0)
2727
fbuf.text('MicroPython!', 0, 0, 0xffff)
28-
fbuf.hline(0, 10, 96, 0xffff)
28+
fbuf.hline(0, 9, 96, 0xffff)
2929

3030
Constructors
3131
------------

docs/library/sys.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@ Constants
8080

8181
A mutable list of directories to search for imported modules.
8282

83+
.. admonition:: Difference to CPython
84+
:class: attention
85+
86+
On MicroPython, an entry with the value ``".frozen"`` will indicate that import
87+
should search :term:`frozen modules <frozen module>` at that point in the search.
88+
If no frozen module is found then search will *not* look for a directory called
89+
``.frozen``, instead it will continue with the next entry in ``sys.path``.
90+
8391
.. data:: platform
8492

8593
The platform that CircuitPython is running on. For OS/RTOS ports, this is

examples/natmod/btree/btree_c.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ void *memmove(void *dest, const void *src, size_t n) {
1818
}
1919

2020
void *malloc(size_t n) {
21-
void *ptr = m_malloc(n);
21+
void *ptr = m_malloc(n, false);
2222
return ptr;
2323
}
2424
void *realloc(void *ptr, size_t n) {
2525
mp_printf(&mp_plat_print, "UNDEF %d\n", __LINE__);
2626
return NULL;
2727
}
2828
void *calloc(size_t n, size_t m) {
29-
void *ptr = m_malloc(n * m);
29+
void *ptr = m_malloc(n * m, false);
3030
// memory already cleared by conservative GC
3131
return ptr;
3232
}
@@ -51,7 +51,7 @@ int *__errno (void)
5151

5252
ssize_t mp_stream_posix_write(void *stream, const void *buf, size_t len) {
5353
mp_obj_base_t* o = stream;
54-
const mp_stream_p_t *stream_p = o->type->protocol;
54+
const mp_stream_p_t *stream_p = o->type->ext[0].protocol;
5555
mp_uint_t out_sz = stream_p->write(MP_OBJ_FROM_PTR(stream), buf, len, &native_errno);
5656
if (out_sz == MP_STREAM_ERROR) {
5757
return -1;
@@ -62,7 +62,7 @@ ssize_t mp_stream_posix_write(void *stream, const void *buf, size_t len) {
6262

6363
ssize_t mp_stream_posix_read(void *stream, void *buf, size_t len) {
6464
mp_obj_base_t* o = stream;
65-
const mp_stream_p_t *stream_p = o->type->protocol;
65+
const mp_stream_p_t *stream_p = o->type->ext[0].protocol;
6666
mp_uint_t out_sz = stream_p->read(MP_OBJ_FROM_PTR(stream), buf, len, &native_errno);
6767
if (out_sz == MP_STREAM_ERROR) {
6868
return -1;
@@ -73,7 +73,7 @@ ssize_t mp_stream_posix_read(void *stream, void *buf, size_t len) {
7373

7474
off_t mp_stream_posix_lseek(void *stream, off_t offset, int whence) {
7575
const mp_obj_base_t* o = stream;
76-
const mp_stream_p_t *stream_p = o->type->protocol;
76+
const mp_stream_p_t *stream_p = o->type->ext[0].protocol;
7777
struct mp_stream_seek_t seek_s;
7878
seek_s.offset = offset;
7979
seek_s.whence = whence;
@@ -86,15 +86,15 @@ off_t mp_stream_posix_lseek(void *stream, off_t offset, int whence) {
8686

8787
int mp_stream_posix_fsync(void *stream) {
8888
mp_obj_base_t* o = stream;
89-
const mp_stream_p_t *stream_p = o->type->protocol;
89+
const mp_stream_p_t *stream_p = o->type->ext[0].protocol;
9090
mp_uint_t res = stream_p->ioctl(MP_OBJ_FROM_PTR(stream), MP_STREAM_FLUSH, 0, &native_errno);
9191
if (res == MP_STREAM_ERROR) {
9292
return -1;
9393
}
9494
return res;
9595
}
9696

97-
mp_obj_type_t btree_type;
97+
mp_obj_full_type_t btree_type;
9898

9999
#include "extmod/modbtree.c"
100100

@@ -123,12 +123,13 @@ mp_obj_t mpy_init(mp_obj_fun_bc_t *self, size_t n_args, size_t n_kw, mp_obj_t *a
123123
MP_DYNRUNTIME_INIT_ENTRY
124124

125125
btree_type.base.type = (void*)&mp_fun_table.type_type;
126+
btree_type.flags = MP_TYPE_FLAG_EXTENDED;
126127
btree_type.name = MP_QSTR_btree;
127128
btree_type.print = btree_print;
128-
btree_type.getiter = btree_getiter;
129-
btree_type.iternext = btree_iternext;
130-
btree_type.binary_op = btree_binary_op;
131-
btree_type.subscr = btree_subscr;
129+
btree_type.ext[0].getiter = btree_getiter;
130+
btree_type.ext[0].iternext = btree_iternext;
131+
btree_type.ext[0].binary_op = btree_binary_op;
132+
btree_type.ext[0].subscr = btree_subscr;
132133
btree_locals_dict_table[0] = (mp_map_elem_t){ MP_OBJ_NEW_QSTR(MP_QSTR_close), MP_OBJ_FROM_PTR(&btree_close_obj) };
133134
btree_locals_dict_table[1] = (mp_map_elem_t){ MP_OBJ_NEW_QSTR(MP_QSTR_flush), MP_OBJ_FROM_PTR(&btree_flush_obj) };
134135
btree_locals_dict_table[2] = (mp_map_elem_t){ MP_OBJ_NEW_QSTR(MP_QSTR_get), MP_OBJ_FROM_PTR(&btree_get_obj) };

0 commit comments

Comments
 (0)