<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/lib/utils, branch 5.3.0-rc.0</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=5.3.0-rc.0</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=5.3.0-rc.0'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2019-12-04T15:29:57+00:00</updated>
<entry>
<title>protocols: Allow them to be (optionally) type-safe</title>
<updated>2019-12-04T15:29:57+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2019-12-03T20:50:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=238e12123690debaf2cf8488fb2a4d4003a06506'/>
<id>urn:sha1:238e12123690debaf2cf8488fb2a4d4003a06506</id>
<content type='text'>
Protocols are nice, but there is no way for C code to verify whether
a type's "protocol" structure actually implements some particular
protocol.  As a result, you can pass an object that implements the
"vfs" protocol to one that expects the "stream" protocol, and the
opposite of awesomeness ensues.

This patch adds an OPTIONAL (but enabled by default) protocol identifier
as the first member of any protocol structure.  This identifier is
simply a unique QSTR chosen by the protocol designer and used by each
protocol implementer.  When checking for protocol support, instead of
just checking whether the object's type has a non-NULL protocol field,
use `mp_proto_get` which implements the protocol check when possible.

The existing protocols are now named:
    protocol_framebuf
    protocol_i2c
    protocol_pin
    protocol_stream
    protocol_spi
    protocol_vfs
(most of these are unused in CP and are just inherited from MP; vfs and
stream are definitely used though)

I did not find any crashing examples, but here's one to give a flavor of what
is improved, using `micropython_coverage`.  Before the change,
the vfs "ioctl" protocol is invoked, and the result is not intelligible
as json (but it could have resulted in a hard fault, potentially):

    &gt;&gt;&gt; import uos, ujson
    &gt;&gt;&gt; u = uos.VfsPosix('/tmp')
    &gt;&gt;&gt; ujson.load(u)
    Traceback (most recent call last):
      File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    ValueError: syntax error in JSON

After the change, the vfs object is correctly detected as not supporting
the stream protocol:
    &gt;&gt;&gt; ujson.load(p)
    Traceback (most recent call last):
      File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    OSError: stream operation not supported
</content>
</entry>
<entry>
<title>Refine _bleio</title>
<updated>2019-10-22T01:57:03+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2019-09-14T19:40:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ae30a1e5aa198bdeee7dce04194b027ff4e3d65a'/>
<id>urn:sha1:ae30a1e5aa198bdeee7dce04194b027ff4e3d65a</id>
<content type='text'>
This PR refines the _bleio API. It was originally motivated by
the addition of a new CircuitPython service that enables reading
and modifying files on the device. Moving the BLE lifecycle outside
of the VM motivated a number of changes to remove heap allocations
in some APIs.

It also motivated unifying connection initiation to the Adapter class
rather than the Central and Peripheral classes which have been removed.
Adapter now handles the GAP portion of BLE including advertising, which
has moved but is largely unchanged, and scanning, which has been enhanced
to return an iterator of filtered results.

Once a connection is created (either by us (aka Central) or a remote
device (aka Peripheral)) it is represented by a new Connection class.
This class knows the current connection state and can discover and
instantiate remote Services along with their Characteristics and
Descriptors.

Relates to #586
</content>
</entry>
<entry>
<title>More size_t usage</title>
<updated>2019-08-27T19:49:46+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2019-08-27T19:49:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=966a48b23a985154ff691a09de72013e2eac2512'/>
<id>urn:sha1:966a48b23a985154ff691a09de72013e2eac2512</id>
<content type='text'>
</content>
</entry>
<entry>
<title>lib/utils/printf: Exclude __GI_vsnprintf alias for gcc 9 and above.</title>
<updated>2019-05-11T05:31:40+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2019-02-05T14:12:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=b3939e2513d0e9306f1652b17fab153fd8e9af84'/>
<id>urn:sha1:b3939e2513d0e9306f1652b17fab153fd8e9af84</id>
<content type='text'>
See issue #4457.
</content>
</entry>
<entry>
<title>Hide the traceback for the ReloadException.</title>
<updated>2019-05-08T21:53:20+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2019-05-08T21:53:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=6440af5c0670264170145d5b1cffa82fe5376159'/>
<id>urn:sha1:6440af5c0670264170145d5b1cffa82fe5376159</id>
<content type='text'>
Many users think it's an error when it's us simply stopping the
code.
</content>
</entry>
<entry>
<title>Set __file__ for the main source file (e.g. code.py, main.py)</title>
<updated>2019-02-21T03:37:29+00:00</updated>
<author>
<name>Craig Forbes</name>
<email>cpforbes@starlake.org</email>
</author>
<published>2019-02-21T03:37:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=1532863d8341ba0240da903533f5eb9d08987662'/>
<id>urn:sha1:1532863d8341ba0240da903533f5eb9d08987662</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Support print("", flush=True)</title>
<updated>2019-02-16T00:53:19+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2019-02-16T00:53:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=e6b140e7a0cf07fa365269e7801bb111565cb478'/>
<id>urn:sha1:e6b140e7a0cf07fa365269e7801bb111565cb478</id>
<content type='text'>
Fixes #1127
</content>
</entry>
<entry>
<title>Fix output overflow and make help translatable</title>
<updated>2018-11-10T00:41:08+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2018-11-10T00:41:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=355abc835ea75715b4dea38604ef64f8c4eeaa0f'/>
<id>urn:sha1:355abc835ea75715b4dea38604ef64f8c4eeaa0f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add i2cslave.I2CSlave bindings</title>
<updated>2018-08-16T15:11:20+00:00</updated>
<author>
<name>Noralf Trønnes</name>
<email>noralf@tronnes.org</email>
</author>
<published>2018-08-02T12:52:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=1ed0e45fc26a016645c91daf3e1c14cef5d477ba'/>
<id>urn:sha1:1ed0e45fc26a016645c91daf3e1c14cef5d477ba</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Two fixes and translate more strings.</title>
<updated>2018-08-09T20:29:30+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2018-08-09T01:24:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=96ebf5bc3fb455162286b9bc31e763f3c4f1c457'/>
<id>urn:sha1:96ebf5bc3fb455162286b9bc31e763f3c4f1c457</id>
<content type='text'>
* Fix finding translations with escaped characters.
* Add back \r to translations since its needed by screen.
</content>
</entry>
</feed>
