In principle this allows core SSL code to be used with e.g., wiznet
or airlift sockets. It might actually be useful with wiznet ethernet devices
(it's probably not with airlift)
Incorrect error handling in send/recv would raise an OSError with
an incorrect (negative) code.
It's likely that this bug was always happening in the Pico W
implementation, which became the basis of the current shared
implementation.
Push handling of WANT_{READ,WRITE} down into mbedtls_raise_error
and use it in recv_into and send.
Tested by connecting to google.com:443, sending nothing, and trying
to read a byte:
```py
import socketpool, ssl, time, wifi
socket = socketpool.SocketPool(wifi.radio)
ctx = ssl.SSLContext()
with ctx.wrap_socket(socket.socket()) as ss:
ss.connect(("google.com", 443))
ss.settimeout(1)
b = bytearray(1)
try:
t0 = time.monotonic()
ss.recv_into(b)
except Exception as ee:
t1 = time.monotonic()
exc = ee
print(t1-t0)
raise exc
```
As desired, an exception `OSError: [Errno 116] ETIMEDOUT` occurred
and the time delta value was 1.0 seconds.
(tested on pycamera)
Closes: #8988
the mbedtls version is a bit different so there are some new #ifdefs
needed.
Tested with the ssl test from https://github.com/adafruit/circuitpython/issues/8910
on Adafruit MatrixPortal S3 (no pico w testing done)
This can perform arbitrary channel mixing between two images.
Alpha blend & maximum functions are demonstrated in the test.
However, it should make most of the usual photo editing blends
possible. (for dissolve, fill a mask bitmap with random values,
which may be expensive to do from circuitpython code; we can
specifically accelerate it if we need to)
Otherwise it will be freed during a collect and potentially
overwritten. This is a bug in 8.x but isn't seen as early as in
9.x because 9.x will collect before expanding the split heap
further.
Fixes#8793
This replaces the earlier, Bitmap-based way of interacting with the
UVC framebuffer.
Typical usage:
```py
displayio.release_displays()
display = frambufferio.FramebufferDisplay(uvc.UVCFramebuffer())
```
This works on a MacroPad with a 128x128 framebuffer, but does not work
on a QT Py esp32s3.
On esp32s3, having the UVC-configuring line alone causes a hard-fault
at startup. However, disabling some other USB devices allows it to boot
and run code.py:
```py
import uvc
import usb_hid
import usb_midi
usb_hid.disable()
usb_midi.disable()
uvc.enable_framebuffer(64, 64)
```
however, as far as I can tell within qv4l2, the device never actually
transmits a frame of data (received frame count never increases).
I have not yet analyzed this failure in further detail.
Otherwise it will be freed during a collect and potentially
overwritten. This is a bug in 8.x but isn't seen as early as in
9.x because 9.x will collect before expanding the split heap
further.
Fixes#8793
This changes storage.mount() to require that a mount point exist
on the parent file system.
A bug in background tasks is also fixed where the function
parameter is cleared on pending callbacks during "reset".
Disk usage is shown on the directory listing and changes based on
the mounted file system. Writable is also loaded per-directory.
Fixes#8108. Fixes#8690. Fixes#8107.
This reduces the time from about 133ms to about 122ms on my test
image on the memento pycamera
a similar change to morph did not produce a performance improvement,
so I didn't include it.
morph9 is a form of morph which performs 9 different convolutions,
like a version of mix where each coefficient is a (2n+1)x(2n+1) matrix.
Most use cases are covered by morph-then-mix, but some advanced operations
may be more efficient to implement via morph9.
This allows operations between channels in an image. It can be used for
the following use cases:
* Conversion to B&W or sepia
* Adding color casts
* Mixing or swapping arbitrary channels
* Inverting or scaling arbitrary channels
bitmapfilter.morph is taken from openmv's imlib.
It is substantially faster than blur/sharpen implemented in ulab,
by up to 10x. It also avoids making many allocations.
due to mbedtls version skew, some macros need to be provided.
The espressif common-hal implementation is no longer needed.
The copyright of hashlib/__init__.h comes from micropython
extmod/modhashlib.c where I found the macro definitions.
Previously, negative amplitudes were clamped to zero.
Now, they are allowed to range from -ALMOST_ONE to +ALMOST_ONE.
This is useful in certain circumstances, such as using synthio
to create CV-like outputs that can be positive or negative, by
using the amplitude property of the note.
This simplifies allocating outside of the VM because the VM doesn't
take up all remaining memory by default.
On ESP we delegate to the IDF for allocations. For all other ports,
we use TLSF to manage an outer "port" heap. The IDF uses TLSF
internally and we use their fork for the other ports.
This also removes the dynamic C stack sizing. It wasn't often used
and is not possible with a fixed outer heap.
Fixes#8512. Fixes#7334.
micropython puts the pointer-ness into the typedef; we can put the
const-ness there too.
this reduces the delta to micropython; for instance, emitinlinextensa
and emitinlinethumb now match upstream.
These are moved:
* Display -> busdisplay.BusDisplay
* FourWire -> fourwire.FourWire
* EPaperDisplay -> epaperdisplay.EPaperDisplay
* I2CDisplay -> i2cdisplaybus.I2CDisplayBus
`paralleldisplay` is now `paralleldisplaybus` (and registered as
`paralleldisplay` too).
Bus related helpers are split out of display_core into bus_core.
It is in still displayio since it is a dependency of both
busdisplay and epaperdisplay.
Fixes#7667