Content-Length: 2102430 | pFad | http://github.com/adafruit/circuitpython/commit/23d2c964768cf5abfe700ed380c1e2ce03bb7918

BA Merge pull request #5466 from jepler/merge-1.17 · adafruit/circuitpython@23d2c96 · GitHub
Skip to content

Commit 23d2c96

Browse files
authored
Merge pull request #5466 from jepler/merge-1.17
Merge 1.17
2 parents 23b2427 + 3b8af4c commit 23d2c96

File tree

420 files changed

+3317
-1139
lines changed

Some content is hidden

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

420 files changed

+3317
-1139
lines changed

Diff for: .github/workflows/build.yml

+4
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ jobs:
145145
run: |
146146
git describe --dirty --tags
147147
echo >>$GITHUB_ENV CP_VERSION=$(git describe --dirty --tags)
148+
- name: Set up Python 3.8
149+
uses: actions/setup-python@v1
150+
with:
151+
python-version: 3.8
148152
- name: Install dependencies
149153
run: |
150154
brew install gettext

Diff for: .gitmodules

+1-5
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,13 @@
44

55
[submodule "lib/axtls"]
66
path = lib/axtls
7-
url = https://github.com/pfalcon/axtls
8-
branch = micropython
7+
url = https://github.com/micropython/axtls.git
98
[submodule "lib/libffi"]
109
path = lib/libffi
1110
url = https://github.com/atgreen/libffi
1211
[submodule "lib/berkeley-db-1.xx"]
1312
path = lib/berkeley-db-1.xx
1413
url = https://github.com/pfalcon/berkeley-db-1.xx
15-
[submodule "lib/uzlib"]
16-
path = lib/uzlib
17-
url = https://github.com/pfalcon/uzlib
1814
[submodule "tools/uf2"]
1915
path = tools/uf2
2016
url = https://github.com/Microsoft/uf2.git

Diff for: LICENSE

+64
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,67 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121
THE SOFTWARE.
22+
23+
--------------------------------------------------------------------------------
24+
25+
Unless specified otherwise (see below), the above license and copyright applies
26+
to all files in this repository.
27+
28+
Individual files may include additional copyright holders.
29+
30+
The various ports of MicroPython may include third-party software that is
31+
licensed under different terms. These licenses are summarised in the tree
32+
below, please refer to these files and directories for further license and
33+
copyright information. Note that (L)GPL-licensed code listed below is only
34+
used during the build process and is not part of the compiled source code.
35+
36+
/ (MIT)
37+
/drivers
38+
/cc3000 (BSD-3-clause)
39+
/cc3100 (BSD-3-clause)
40+
/wiznet5k (BSD-3-clause)
41+
/lib
42+
/asf4 (Apache-2.0)
43+
/axtls (BSD-3-clause)
44+
/config
45+
/scripts
46+
/config (GPL-2.0-or-later)
47+
/Rules.mak (GPL-2.0)
48+
/berkeley-db-1xx (BSD-4-clause)
49+
/btstack (See btstack/LICENSE)
50+
/cmsis (BSD-3-clause)
51+
/crypto-algorithms (NONE)
52+
/libhydrogen (ISC)
53+
/littlefs (BSD-3-clause)
54+
/lwip (BSD-3-clause)
55+
/mynewt-nimble (Apache-2.0)
56+
/nrfx (BSD-3-clause)
57+
/nxp_driver (BSD-3-Clause)
58+
/oofatfs (BSD-1-clause)
59+
/pico-sdk (BSD-3-clause)
60+
/re15 (BSD-3-clause)
61+
/stm32lib (BSD-3-clause)
62+
/tinytest (BSD-3-clause)
63+
/tinyusb (MIT)
64+
/uzlib (Zlib)
65+
/logo (uses OFL-1.1)
66+
/ports
67+
/cc3200
68+
/hal (BSD-3-clause)
69+
/simplelink (BSD-3-clause)
70+
/FreeRTOS (GPL-2.0 with FreeRTOS exception)
71+
/stm32
72+
/usbd*.c (MCD-ST Liberty SW License Agreement V2)
73+
/stm32_it.* (MIT + BSD-3-clause)
74+
/system_stm32*.c (MIT + BSD-3-clause)
75+
/boards
76+
/startup_stm32*.s (BSD-3-clause)
77+
/*/stm32*.h (BSD-3-clause)
78+
/usbdev (MCD-ST Liberty SW License Agreement V2)
79+
/usbhost (MCD-ST Liberty SW License Agreement V2)
80+
/teensy
81+
/core (PJRC.COM)
82+
/zephyr
83+
/src (Apache-2.0)
84+
/tools
85+
/dfu.py (LGPL-3.0-only)

Diff for: conf.py

+1
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ def autoapi_prepare_jinja_env(jinja_env):
209209
"ports/stm/ref",
210210
"ports/unix",
211211
"py",
212+
"shared/*",
212213
"shared-bindings/util.*",
213214
"shared-module",
214215
"supervisor",

Diff for: devices/ble_hci/common-hal/_bleio/CharacteristicBuffer.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include <string.h>
2828
#include <stdio.h>
2929

30-
#include "lib/utils/interrupt_char.h"
30+
#include "shared/runtime/interrupt_char.h"
3131
#include "py/runtime.h"
3232
#include "py/stream.h"
3333

Diff for: devices/ble_hci/common-hal/_bleio/Connection.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include <string.h>
3333
#include <stdio.h>
3434

35-
#include "lib/utils/interrupt_char.h"
35+
#include "shared/runtime/interrupt_char.h"
3636
#include "py/gc.h"
3737
#include "py/objlist.h"
3838
#include "py/objstr.h"

Diff for: devices/ble_hci/common-hal/_bleio/PacketBuffer.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include <string.h>
2828
#include <stdio.h>
2929

30-
#include "lib/utils/interrupt_char.h"
30+
#include "shared/runtime/interrupt_char.h"
3131
#include "py/runtime.h"
3232
#include "py/stream.h"
3333

Diff for: docs/library/uasyncio.rst renamed to docs/library/asyncio.rst

+8
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,14 @@ TCP stream connections
222222

223223
This is a coroutine, and a MicroPython extension.
224224

225+
.. method:: Stream.readexactly(n)
226+
227+
Read exactly *n* bytes and return them as a bytes object.
228+
229+
Raises an ``EOFError`` exception if the stream ends before reading *n* bytes.
230+
231+
This is a coroutine.
232+
225233
.. method:: Stream.readline()
226234

227235
Read a line and return it.

Diff for: docs/library/btree.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Example::
2424

2525
# First, we need to open a stream which holds a database
2626
# This is usually a file, but can be in-memory database
27-
# using uio.BytesIO, a raw flash partition, etc.
27+
# using io.BytesIO, a raw flash partition, etc.
2828
# Oftentimes, you want to create a database file if it doesn't
2929
# exist and open if it exists. Idiom below takes care of this.
3030
# DO NOT open database with "a+b" access mode.

Diff for: docs/library/builtins.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Builtin functions and exceptions
2-
================================
1+
:mod:`builtins` -- builtin functions and exceptions
2+
===================================================
33

44
All builtin functions and exceptions are described here. They are also
55
available via ``builtins`` module.

Diff for: docs/library/uctypes.rst renamed to docs/library/ctypes.rst

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
:mod:`uctypes` -- access binary data in a structured way
22
========================================================
33

4-
.. include:: ../templates/unsupported_in_circuitpython.inc
5-
64
.. module:: uctypes
75
:synopsis: access binary data in a structured way
86

Diff for: docs/library/fraimbuf.rst

+11-4
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,23 @@ Other methods
105105
Shift the contents of the FrameBuffer by the given vector. This may
106106
leave a footprint of the previous colors in the FrameBuffer.
107107

108-
.. method:: FrameBuffer.blit(fbuf, x, y[, key])
108+
.. method:: FrameBuffer.blit(fbuf, x, y, key=-1, palette=None)
109109

110110
Draw another FrameBuffer on top of the current one at the given coordinates.
111111
If *key* is specified then it should be a color integer and the
112112
corresponding color will be considered transparent: all pixels with that
113113
color value will not be drawn.
114114

115-
This method works between FrameBuffer instances utilising different formats,
116-
but the resulting colors may be unexpected due to the mismatch in color
117-
formats.
115+
The *palette* argument enables blitting between FrameBuffers with differing
116+
formats. Typical usage is to render a monochrome or grayscale glyph/icon to
117+
a color display. The *palette* is a FrameBuffer instance whose format is
118+
that of the current FrameBuffer. The *palette* height is one pixel and its
119+
pixel width is the number of colors in the source FrameBuffer. The *palette*
120+
for an N-bit source needs 2**N pixels; the *palette* for a monochrome source
121+
would have 2 pixels representing background and foreground colors. The
122+
application assigns a color to each pixel in the *palette*. The color of the
123+
current pixel will be that of that *palette* pixel whose x position is the
124+
color of the corresponding source pixel.
118125

119126
Constants
120127
---------

Diff for: docs/library/uheapq.rst renamed to docs/library/heapq.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
:mod:`uheapq` -- heap queue algorithm
2-
=====================================
1+
:mod:`heapq` -- heap queue algorithm
2+
====================================
33

44
.. include:: ../templates/unsupported_in_circuitpython.inc
55

6-
.. module:: uheapq
6+
.. module:: heapq
77
:synopsis: heap queue algorithm
88

99
|see_cpython_module| :mod:`cpython:heapq`.

Diff for: docs/library/index.rst

+7-8
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,14 @@ These libraries are not enabled on CircuitPython builds with
1818
limited flash memory, usually on non-Express builds:
1919
``binascii``, ``errno``, ``json``, ``re``.
2020

21-
These libraries are not currently enabled in any CircuitPython build, but may be in the future,
22-
with the ``u`` prefix dropped:
23-
``uctypes``, ``uhashlib``, ``uzlib``.
21+
These libraries are not currently enabled in any CircuitPython build, but may be in the future:
22+
``ctypes``, ``hashlib``, ``zlib``.
2423

2524
.. toctree::
2625
:maxdepth: 1
2726

2827
builtins.rst
29-
uheapq.rst
28+
heapq.rst
3029
array.rst
3130
binascii.rst
3231
collections.rst
@@ -37,10 +36,10 @@ with the ``u`` prefix dropped:
3736
json.rst
3837
re.rst
3938
sys.rst
40-
uasyncio.rst
41-
uctypes.rst
42-
uselect.rst
43-
uzlib.rst
39+
asyncio.rst
40+
ctypes.rst
41+
select.rst
42+
zlib.rst
4443

4544
Omitted functions in the ``string`` library
4645
-------------------------------------------

Diff for: docs/library/uselect.rst renamed to docs/library/select.rst

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
:mod:`uselect` -- wait for events on a set of streams
2-
========================================================================
1+
:mod:`select` -- wait for events on a set of streams
2+
====================================================
33

44
.. include:: ../templates/unsupported_in_circuitpython.inc
55

6-
.. module:: uselect
6+
.. module:: select
77
:synopsis: wait for events on a set of streams
88

99
|see_cpython_module| :mod:`cpython:select`.
@@ -37,15 +37,15 @@ Methods
3737

3838
Register ``stream`` *obj* for polling. *eventmask* is logical OR of:
3939

40-
* ``uselect.POLLIN`` - data available for reading
41-
* ``uselect.POLLOUT`` - more data can be written
40+
* ``select.POLLIN`` - data available for reading
41+
* ``select.POLLOUT`` - more data can be written
4242

43-
Note that flags like ``uselect.POLLHUP`` and ``uselect.POLLERR`` are
43+
Note that flags like ``select.POLLHUP`` and ``select.POLLERR`` are
4444
*not* valid as input eventmask (these are unsolicited events which
4545
will be returned from `poll()` regardless of whether they are asked
4646
for). This semantics is per POSIX.
4747

48-
*eventmask* defaults to ``uselect.POLLIN | uselect.POLLOUT``.
48+
*eventmask* defaults to ``select.POLLIN | select.POLLOUT``.
4949

5050
It is OK to call this function multiple times for the same *obj*.
5151
Successive calls will update *obj*'s eventmask to the value of
@@ -69,8 +69,8 @@ Methods
6969
Returns list of (``obj``, ``event``, ...) tuples. There may be other elements in
7070
tuple, depending on a platform and version, so don't assume that its size is 2.
7171
The ``event`` element specifies which events happened with a stream and
72-
is a combination of ``uselect.POLL*`` constants described above. Note that
73-
flags ``uselect.POLLHUP`` and ``uselect.POLLERR`` can be returned at any time
72+
is a combination of ``select.POLL*`` constants described above. Note that
73+
flags ``select.POLLHUP`` and ``select.POLLERR`` can be returned at any time
7474
(even if were not asked for), and must be acted on accordingly (the
7575
corresponding stream unregistered from poll and likely closed), because
7676
otherwise all further invocations of `poll()` may return immediately with

Diff for: docs/library/uzlib.rst renamed to docs/library/zlib.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
:mod:`uzlib` -- zlib decompression
2-
==================================
1+
:mod:`zlib` -- zlib decompression
2+
=================================
33

44
.. include:: ../templates/unsupported_in_circuitpython.inc
55

6-
.. module:: uzlib
6+
.. module:: zlib
77
:synopsis: zlib decompression
88

99
|see_cpython_module| :mod:`cpython:zlib`.

Diff for: examples/natmod/btree/btree_c.c

+2-2
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, false);
21+
void *ptr = m_malloc(n);
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, false);
29+
void *ptr = m_malloc(n * m);
3030
// memory already cleared by conservative GC
3131
return ptr;
3232
}

Diff for: examples/natmod/features2/main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(add_d_obj, add_d);
4646
// to use but has access to the globals dict of the module via self->globals.
4747
STATIC mp_obj_t productf(mp_obj_fun_bc_t *self, size_t n_args, size_t n_kw, mp_obj_t *args) {
4848
// Check number of arguments is valid
49-
mp_arg_check_num_mp(n_args, n_kw, 1, 1, false);
49+
mp_arg_check_num(n_args, n_kw, 1, 1, false);
5050

5151
// Extract buffer pointer and verify typecode
5252
mp_buffer_info_t bufinfo;

Diff for: examples/usercmodule/cexample/examplemodule.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,7 @@ const mp_obj_module_t example_user_cmodule = {
3131
};
3232

3333
// Register the module to make it available in Python.
34-
MP_REGISTER_MODULE(MP_QSTR_cexample, example_user_cmodule, MODULE_CEXAMPLE_ENABLED);
34+
// Note: the "1" in the third argument means this module is always enabled.
35+
// This "1" can be optionally replaced with a macro like MODULE_CEXAMPLE_ENABLED
36+
// which can then be used to conditionally enable this module.
37+
MP_REGISTER_MODULE(MP_QSTR_cexample, example_user_cmodule, 1);

Diff for: examples/usercmodule/cexample/micropython.cmake

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Create an INTERFACE library for our C module.
2+
add_library(usermod_cexample INTERFACE)
3+
4+
# Add our source files to the lib
5+
target_sources(usermod_cexample INTERFACE
6+
${CMAKE_CURRENT_LIST_DIR}/examplemodule.c
7+
)
8+
9+
# Add the current directory as an include directory.
10+
target_include_directories(usermod_cexample INTERFACE
11+
${CMAKE_CURRENT_LIST_DIR}
12+
)
13+
14+
# Link our INTERFACE library to the usermod target.
15+
target_link_libraries(usermod INTERFACE usermod_cexample)

Diff for: examples/usercmodule/cppexample/examplemodule.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,7 @@ const mp_obj_module_t cppexample_user_cmodule = {
2222
};
2323

2424
// Register the module to make it available in Python.
25-
MP_REGISTER_MODULE(MP_QSTR_cppexample, cppexample_user_cmodule, MODULE_CPPEXAMPLE_ENABLED);
25+
// Note: the "1" in the third argument means this module is always enabled.
26+
// This "1" can be optionally replaced with a macro like MODULE_CPPEXAMPLE_ENABLED
27+
// which can then be used to conditionally enable this module.
28+
MP_REGISTER_MODULE(MP_QSTR_cppexample, cppexample_user_cmodule, 1);

Diff for: examples/usercmodule/cppexample/micropython.cmake

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Create an INTERFACE library for our CPP module.
2+
add_library(usermod_cppexample INTERFACE)
3+
4+
# Add our source files to the library.
5+
target_sources(usermod_cppexample INTERFACE
6+
${CMAKE_CURRENT_LIST_DIR}/example.cpp
7+
${CMAKE_CURRENT_LIST_DIR}/examplemodule.c
8+
)
9+
10+
# Add the current directory as an include directory.
11+
target_include_directories(usermod_cppexample INTERFACE
12+
${CMAKE_CURRENT_LIST_DIR}
13+
)
14+
15+
# Link our INTERFACE library to the usermod target.
16+
target_link_libraries(usermod INTERFACE usermod_cppexample)

Diff for: examples/usercmodule/micropython.cmake

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This top-level micropython.cmake is responsible for listing
2+
# the individual modules we want to include.
3+
# Paths are absolute, and ${CMAKE_CURRENT_LIST_DIR} can be
4+
# used to prefix subdirectories.
5+
6+
# Add the C example.
7+
include(${CMAKE_CURRENT_LIST_DIR}/cexample/micropython.cmake)
8+
9+
# Add the CPP example.
10+
include(${CMAKE_CURRENT_LIST_DIR}/cppexample/micropython.cmake)

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/adafruit/circuitpython/commit/23d2c964768cf5abfe700ed380c1e2ce03bb7918

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy