Content-Length: 1459471 | pFad | http://github.com/adafruit/circuitpython/commit/d1e710fb4b5c3c8f842da2eae72ca69ec0598a95

2C Merge remote-tracking branch 'adafruit/8.2.x' into merge_in_8.2.x · adafruit/circuitpython@d1e710f · GitHub
Skip to content

Commit d1e710f

Browse files
committed
Merge remote-tracking branch 'adafruit/8.2.x' into merge_in_8.2.x
2 parents c6d195a + 722f75f commit d1e710f

File tree

70 files changed

+115
-35
lines changed

Some content is hidden

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

70 files changed

+115
-35
lines changed

ports/espressif/bindings/espnow/ESPNow.c

+1
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ STATIC const mp_stream_p_t espnow_stream_p = {
340340
//| This is an easy way to check if the buffer is empty.
341341
//| """
342342
//| ...
343+
//|
343344
//| def __len__(self) -> int:
344345
//| """Return the number of `bytes` available to read. Used to implement ``len()``."""
345346
//| ...

ports/raspberrypi/boards/pimoroni_pico_dv_base/pins.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
5353
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO25) },
5454
{ MP_ROM_QSTR(MP_QSTR_GP25), MP_ROM_PTR(&pin_GPIO25) },
5555

56-
{ MP_ROM_QSTR(MP_QSTR_I2S_WORD_SELECT), MP_ROM_PTR(&pin_GPIO26) },
56+
{ MP_ROM_QSTR(MP_QSTR_I2S_DATA), MP_ROM_PTR(&pin_GPIO26) },
5757
{ MP_ROM_QSTR(MP_QSTR_GP26_A0), MP_ROM_PTR(&pin_GPIO26) },
5858
{ MP_ROM_QSTR(MP_QSTR_GP26), MP_ROM_PTR(&pin_GPIO26) },
5959
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) },
@@ -63,7 +63,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
6363
{ MP_ROM_QSTR(MP_QSTR_GP27), MP_ROM_PTR(&pin_GPIO27) },
6464
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) },
6565

66-
{ MP_ROM_QSTR(MP_QSTR_I2S_DATA), MP_ROM_PTR(&pin_GPIO28) },
66+
{ MP_ROM_QSTR(MP_QSTR_I2S_WORD_SELECT), MP_ROM_PTR(&pin_GPIO28) },
6767
{ MP_ROM_QSTR(MP_QSTR_GP28_A2), MP_ROM_PTR(&pin_GPIO28) },
6868
{ MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) },
6969
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) },

shared-bindings/_bleio/CharacteristicBuffer.c

+2
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,14 @@ STATIC void check_for_deinit(bleio_characteristic_buffer_obj_t *self) {
9999
//| :return: Data read
100100
//| :rtype: bytes or None"""
101101
//| ...
102+
//|
102103
//| def readinto(self, buf: WriteableBuffer) -> Optional[int]:
103104
//| """Read bytes into the ``buf``. Read at most ``len(buf)`` bytes.
104105
//|
105106
//| :return: number of bytes read and stored into ``buf``
106107
//| :rtype: int or None (on a non-blocking error)"""
107108
//| ...
109+
//|
108110
//| def readline(self) -> bytes:
109111
//| """Read a line, ending in a newline character.
110112
//|

shared-bindings/_bleio/Connection.c

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ void bleio_connection_ensure_connected(bleio_connection_obj_t *self) {
7272
//| Connections may also be made when another device initiates a connection. To use a Connection
7373
//| created by a peer, read the `Adapter.connections` property."""
7474
//| ...
75+
//|
7576
//| def disconnect(self) -> None:
7677
//| """Disconnects from the remote peripheral. Does nothing if already disconnected."""
7778
//| ...

shared-bindings/_bleio/Descriptor.c

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
//| and attached to a Characteristic by calling `add_to_characteristic()`.
4545
//| Remote Descriptor objects are created by `Connection.discover_remote_services()`
4646
//| as part of remote Characteristics in the remote Services that are discovered."""
47+
//|
4748
//| @classmethod
4849
//| def add_to_characteristic(
4950
//| cls,

shared-bindings/_bleio/ScanEntry.c

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
//| def __init__(self) -> None:
4545
//| """Cannot be instantiated directly. Use `_bleio.Adapter.start_scan`."""
4646
//| ...
47+
//|
4748
//| def matches(self, prefixes: ScanEntry, *, match_all: bool = True) -> bool:
4849
//| """Returns True if the ScanEntry matches all prefixes when ``match_all`` is True. This is stricter
4950
//| than the scan filtering which accepts any advertisements that match any of the prefixes

shared-bindings/_bleio/ScanResults.c

+2
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ STATIC mp_obj_t scanresults_iternext(mp_obj_t self_in) {
4949
//| def __init__(self) -> None:
5050
//| """Cannot be instantiated directly. Use `_bleio.Adapter.start_scan`."""
5151
//| ...
52+
//|
5253
//| def __iter__(self) -> Iterator[ScanEntry]:
5354
//| """Returns itself since it is the iterator."""
5455
//| ...
56+
//|
5557
//| def __next__(self) -> ScanEntry:
5658
//| """Returns the next `_bleio.ScanEntry`. Blocks if none have been received and scanning is still
5759
//| active. Raises `StopIteration` if scanning is finished and no other results are available.

shared-bindings/_pixelmap/PixelMap.c

+2
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,12 @@ MP_DEFINE_CONST_FUN_OBJ_2(pixelmap_pixelmap_indices_obj, pixelmap_pixelmap_indic
160160
//| def __getitem__(self, index: slice) -> PixelReturnSequence:
161161
//| """Retrieve the value of the underlying pixels."""
162162
//| ...
163+
//|
163164
//| @overload
164165
//| def __getitem__(self, index: int) -> PixelReturnType:
165166
//| """Retrieve the value of one of the underlying pixels at 'index'."""
166167
//| ...
168+
//|
167169
//| @overload
168170
//| def __setitem__(self, index: slice, value: PixelSequence) -> None: ...
169171
//| @overload

shared-bindings/adafruit_pixelbuf/PixelBuf.c

+2
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,14 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(pixelbuf_pixelbuf_fill_obj, pixelbuf_pixelbuf_f
268268
//| between 0 and 255. When in PWM (DotStar) mode, the 4th tuple value is a float of the pixel
269269
//| intensity from 0-1.0."""
270270
//| ...
271+
//|
271272
//| @overload
272273
//| def __getitem__(self, index: int) -> PixelReturnType:
273274
//| """Returns the pixel value at the given index as a tuple of (Red, Green, Blue[, White]) values
274275
//| between 0 and 255. When in PWM (DotStar) mode, the 4th tuple value is a float of the pixel
275276
//| intensity from 0-1.0."""
276277
//| ...
278+
//|
277279
//| @overload
278280
//| def __setitem__(self, index: slice, value: PixelSequence) -> None: ...
279281
//| @overload

shared-bindings/alarm/SleepMemory.c

+3
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,13 @@
5353
//| def __init__(self) -> None:
5454
//| """Not used. Access the sole instance through `alarm.sleep_memory`."""
5555
//| ...
56+
//|
5657
//| def __bool__(self) -> bool:
5758
//| """``sleep_memory`` is ``True`` if its length is greater than zero.
5859
//| This is an easy way to check for its existence.
5960
//| """
6061
//| ...
62+
//|
6163
//| def __len__(self) -> int:
6264
//| """Return the length. This is used by (`len`)"""
6365
//| ...
@@ -85,6 +87,7 @@ STATIC MP_DEFINE_CONST_DICT(alarm_sleep_memory_locals_dict, alarm_sleep_memory_l
8587
//| def __getitem__(self, index: int) -> int:
8688
//| """Returns the value at the given index."""
8789
//| ...
90+
//|
8891
//| @overload
8992
//| def __setitem__(self, index: slice, value: ReadableBuffer) -> None: ...
9093
//| @overload

shared-bindings/canio/Listener.c

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(canio_listener_in_waiting_obj, canio_listener_i
8080
//| This method exists so that `Listener` can be used as an
8181
//| iterable"""
8282
//| ...
83+
//|
8384
//| def __next__(self) -> Union[RemoteTransmissionRequest, Message]:
8485
//| """Reads a message, after waiting up to self.timeout seconds
8586
//|

shared-bindings/displayio/Bitmap.c

+1
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ MP_PROPERTY_GETTER(displayio_bitmap_bits_per_value_obj,
139139
//|
140140
//| print(bitmap[0,1])"""
141141
//| ...
142+
//|
142143
//| def __setitem__(self, index: Union[Tuple[int, int], int], value: int) -> None:
143144
//| """Sets the value at the given index. The index can either be an x,y tuple or an int equal
144145
//| to ``y * width + x``.

shared-bindings/displayio/Group.c

+2
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
281281
//|
282282
//| print(group[0])"""
283283
//| ...
284+
//|
284285
//| def __setitem__(
285286
//| self,
286287
//| index: int,
@@ -292,6 +293,7 @@ STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
292293
//|
293294
//| group[0] = sprite"""
294295
//| ...
296+
//|
295297
//| def __delitem__(self, index: int) -> None:
296298
//| """Deletes the value at the given index.
297299
//|

shared-bindings/displayio/Palette.c

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
104104
//| def __getitem__(self, index: int) -> Optional[int]:
105105
//| r"""Return the pixel color at the given index as an integer."""
106106
//| ...
107+
//|
107108
//| def __setitem__(
108109
//| self, index: int, value: Union[int, ReadableBuffer, Tuple[int, int, int]]
109110
//| ) -> None:

shared-bindings/displayio/TileGrid.c

+1
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@ MP_PROPERTY_GETSET(displayio_tilegrid_bitmap_obj,
409409
//|
410410
//| print(grid[0])"""
411411
//| ...
412+
//|
412413
//| def __setitem__(self, index: Union[Tuple[int, int], int], value: int) -> None:
413414
//| """Sets the tile index at the given index. The index can either be an x,y tuple or an int equal
414415
//| to ``y * width + x``.

shared-bindings/fontio/BuiltinFont.c

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
//| The two element version is ``(width, height)``, in which
4848
//| ``x_offset`` and ``y_offset`` are assumed to be zero."""
4949
//| pass
50+
//|
5051
//| def get_glyph(self, codepoint: int) -> Optional[Glyph]:
5152
//| """Retrieve the Glyph for a given code point
5253
//|

shared-bindings/keypad/EventQueue.c

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(keypad_eventqueue_clear_obj, keypad_eventqueue_clear);
100100
//| This is an easy way to check if the queue is empty.
101101
//| """
102102
//| ...
103+
//|
103104
//| def __len__(self) -> int:
104105
//| """Return the number of events currently in the queue. Used to implement ``len()``."""
105106
//| ...

shared-bindings/memorymap/AddressRange.c

+2
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
//| # print GPIO16 pad drive strength
7373
//| print(rp2040_get_pad_drive(16))
7474
//| """
75+
//|
7576

7677
//| def __init__(self, *, start, length) -> None:
7778
//| """Constructs an address range starting at ``start`` and ending at
@@ -144,6 +145,7 @@ STATIC MP_DEFINE_CONST_DICT(memorymap_addressrange_locals_dict, memorymap_addres
144145
//| when possible.
145146
//| All others may use multiple transactions."""
146147
//| ...
148+
//|
147149
//| @overload
148150
//| def __setitem__(self, index: slice, value: ReadableBuffer) -> None: ...
149151
//| @overload

shared-bindings/nvm/ByteArray.c

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
//| import microcontroller
4242
//| microcontroller.nvm[0:3] = b"\xcc\x10\x00"
4343
//| """
44+
//|
4445

4546
//| def __init__(self) -> None:
4647
//| """Not currently dynamically supported. Access the sole instance through `microcontroller.nvm`."""
@@ -74,6 +75,7 @@ STATIC MP_DEFINE_CONST_DICT(nvm_bytearray_locals_dict, nvm_bytearray_locals_dict
7475
//| def __getitem__(self, index: int) -> int:
7576
//| """Returns the value at the given index."""
7677
//| ...
78+
//|
7779
//| @overload
7880
//| def __setitem__(self, index: slice, value: ReadableBuffer) -> None: ...
7981
//| @overload

shared-bindings/storage/__init__.c

+8
Original file line numberDiff line numberDiff line change
@@ -275,30 +275,38 @@ STATIC const mp_rom_map_elem_t storage_module_globals_table[] = {
275275
//| larger filesystems, but you will need to format the filesystem on another device.
276276
//| """
277277
//| ...
278+
//|
278279
//| def open(self, path: str, mode: str) -> None:
279280
//| """Like builtin ``open()``"""
280281
//| ...
282+
//|
281283
//| def ilistdir(
282284
//| self, path: str
283285
//| ) -> Iterator[Union[Tuple[AnyStr, int, int, int], Tuple[AnyStr, int, int]]]:
284286
//| """Return an iterator whose values describe files and folders within
285287
//| ``path``"""
286288
//| ...
289+
//|
287290
//| def mkdir(self, path: str) -> None:
288291
//| """Like `os.mkdir`"""
289292
//| ...
293+
//|
290294
//| def rmdir(self, path: str) -> None:
291295
//| """Like `os.rmdir`"""
292296
//| ...
297+
//|
293298
//| def stat(self, path: str) -> Tuple[int, int, int, int, int, int, int, int, int, int]:
294299
//| """Like `os.stat`"""
295300
//| ...
301+
//|
296302
//| def statvfs(self, path: int) -> Tuple[int, int, int, int, int, int, int, int, int, int]:
297303
//| """Like `os.statvfs`"""
298304
//| ...
305+
//|
299306
//| def mount(self, readonly: bool, mkfs: VfsFat) -> None:
300307
//| """Don't call this directly, call `storage.mount`."""
301308
//| ...
309+
//|
302310
//| def umount(self) -> None:
303311
//| """Don't call this directly, call `storage.umount`."""
304312
//| ...

shared-bindings/usb_cdc/Serial.c

+6
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
//| """You cannot create an instance of `usb_cdc.Serial`.
4242
//| The available instances are in the ``usb_cdc.serials`` tuple."""
4343
//| ...
44+
//|
4445
//| def read(self, size: int = 1) -> bytes:
4546
//| """Read at most ``size`` bytes. If ``size`` exceeds the internal buffer size
4647
//| only the bytes in the buffer will be read. If `timeout` is > 0 or ``None``,
@@ -50,6 +51,7 @@
5051
//| :return: Data read
5152
//| :rtype: bytes"""
5253
//| ...
54+
//|
5355
//| def readinto(self, buf: WriteableBuffer) -> int:
5456
//| """Read bytes into the ``buf``. Read at most ``len(buf)`` bytes. If `timeout`
5557
//| is > 0 or ``None``, keep waiting until the timeout expires or ``len(buf)``
@@ -58,6 +60,7 @@
5860
//| :return: number of bytes read and stored into ``buf``
5961
//| :rtype: int"""
6062
//| ...
63+
//|
6164
//| def readline(self, size: int = -1) -> Optional[bytes]:
6265
//| r"""Read a line ending in a newline character ("\\n"), including the newline.
6366
//| Return everything readable if no newline is found and ``timeout`` is 0.
@@ -70,6 +73,7 @@
7073
//| :return: the line read
7174
//| :rtype: bytes or None"""
7275
//| ...
76+
//|
7377
//| def readlines(self) -> List[Optional[bytes]]:
7478
//| """Read multiple lines as a list, using `readline()`.
7579
//|
@@ -79,12 +83,14 @@
7983
//| :return: a list of the line read
8084
//| :rtype: list"""
8185
//| ...
86+
//|
8287
//| def write(self, buf: ReadableBuffer) -> int:
8388
//| """Write as many bytes as possible from the buffer of bytes.
8489
//|
8590
//| :return: the number of bytes written
8691
//| :rtype: int"""
8792
//| ...
93+
//|
8894
//| def flush(self) -> None:
8995
//| """Force out any unwritten bytes, waiting until they are written."""
9096
//| ...

shared-bindings/usb_midi/PortIn.c

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
//| :return: Data read
5656
//| :rtype: bytes or None"""
5757
//| ...
58+
//|
5859
//| def readinto(self, buf: WriteableBuffer, nbytes: Optional[int] = None) -> Optional[bytes]:
5960
//| """Read bytes into the ``buf``. If ``nbytes`` is specified then read at most
6061
//| that many bytes. Otherwise, read at most ``len(buf)`` bytes.

shared-bindings/wifi/ScannedNetworks.c

+2
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ STATIC mp_obj_t scannednetworks_iternext(mp_obj_t self_in) {
5050
//| def __init__(self) -> None:
5151
//| """Cannot be instantiated directly. Use `wifi.Radio.start_scanning_networks`."""
5252
//| ...
53+
//|
5354
//| def __iter__(self) -> Iterator[Network]:
5455
//| """Returns itself since it is the iterator."""
5556
//| ...
57+
//|
5658
//| def __next__(self) -> Network:
5759
//| """Returns the next `wifi.Network`.
5860
//| Raises `StopIteration` if scanning is finished and no other results are available."""

tests/cpydiff/builtin_next_arg2.py

+1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99
except StopIteration:
1010
val = deflt
1111
"""
12+
1213
print(next(iter(range(0)), 42))

tests/cpydiff/core_class_delnotimpl.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
cause: Unknown
55
workaround: Unknown
66
"""
7+
78
import gc
89

910

tests/cpydiff/core_function_argcount.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
cause: MicroPython counts "self" as an argument.
55
workaround: Interpret error messages with the information above in mind.
66
"""
7+
78
try:
89
[].append()
910
except Exception as e:

tests/cpydiff/core_import_all.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
cause: Not implemented.
55
workaround: Manually import the sub-modules directly in __init__.py using ``from . import foo, bar``.
66
"""
7+
78
from modules3 import *
89

910
foo.hello()

tests/cpydiff/core_import_path.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
cause: MicroPython doesn't support namespace packages split across filesystem. Beyond that, MicroPython's import system is highly optimized for minimal memory usage.
55
workaround: Details of import handling is inherently implementation dependent. Don't rely on such details in portable applications.
66
"""
7+
78
import modules
89

910
print(modules.__path__)

tests/cpydiff/core_import_split_ns_pkgs.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
cause: MicroPython's import system is highly optimized for simplicity, minimal memory usage, and minimal filesystem search overhead.
55
workaround: Don't install modules belonging to the same namespace package in different directories. For MicroPython, it's recommended to have at most 3-component module search paths: for your current application, per-user (writable), system-wide (non-writable).
66
"""
7+
78
import sys
89

910
sys.path.append(sys.path[1] + "/modules")

tests/cpydiff/core_locals_eval.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
cause: MicroPython doesn't maintain symbolic local environment, it is optimized to an array of slots. Thus, local variables can't be accessed by a name. Effectively, ``eval(expr)`` in MicroPython is equivalent to ``eval(expr, globals(), globals())``.
55
workaround: Unknown
66
"""
7+
78
val = 1
89

910

tests/cpydiff/module_array_comparison.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
cause: Code size
55
workaround: Compare individual elements
66
"""
7+
78
import array
89

910
array.array("b", [1, 2]) == array.array("i", [1, 2])

tests/cpydiff/module_array_constructor.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
cause: MicroPython implements implicit truncation in order to reduce code size and execution time
55
workaround: If CPython compatibility is needed then mask the value explicitly
66
"""
7+
78
import array
89

910
a = array.array("b", [257])

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/d1e710fb4b5c3c8f842da2eae72ca69ec0598a95

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy