<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py, branch 5.0.0-beta.1</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=5.0.0-beta.1</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=5.0.0-beta.1'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2019-12-10T20:03:06+00:00</updated>
<entry>
<title>audiocore: Add MP3File using Adafruit_MP3 library</title>
<updated>2019-12-10T20:03:06+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2019-11-26T15:29:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=a08d9e6d8e0059c8aa59feadd7b94d95d691e273'/>
<id>urn:sha1:a08d9e6d8e0059c8aa59feadd7b94d95d691e273</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Merge pull request #2353 from jepler/audiosample-protocol</title>
<updated>2019-12-09T22:50:16+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@adafruit.com</email>
</author>
<published>2019-12-09T22:50:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=19ac8aea8ca7656ecfdac597448feab493803669'/>
<id>urn:sha1:19ac8aea8ca7656ecfdac597448feab493803669</id>
<content type='text'>
Convert audiosamples to use micropython "protocols" (safely)</content>
</entry>
<entry>
<title>proto: Use %q format-string shortcut</title>
<updated>2019-12-05T19:06:10+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2019-12-05T19:06:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=49a547eed881408d77f750c5f0328e2d93770369'/>
<id>urn:sha1:49a547eed881408d77f750c5f0328e2d93770369</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add connection interval and debugging</title>
<updated>2019-12-04T22:39:02+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2019-11-23T00:33:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=17c8356b8c06ac160bf9fad6b6b4b8b1095d8dcd'/>
<id>urn:sha1:17c8356b8c06ac160bf9fad6b6b4b8b1095d8dcd</id>
<content type='text'>
This also sets TinyUSB to master and to not include its submodules.

It also fixes an old displayio example comment and retries gattc
reads.
</content>
</entry>
<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>Merge pull request #2345 from jepler/compressed-unicode</title>
<updated>2019-12-03T01:11:49+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@adafruit.com</email>
</author>
<published>2019-12-03T01:11:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=15886b1505d854d76e353b9c5261568c7065d2bf'/>
<id>urn:sha1:15886b1505d854d76e353b9c5261568c7065d2bf</id>
<content type='text'>
translation: Compress as unicode, not bytes</content>
</entry>
<entry>
<title>makeqstrdata: reclaim some more bytes on some translations</title>
<updated>2019-12-02T20:49:23+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2019-12-02T20:49:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=1a0dcb5caaaa2d9f0dc25d87735b76f1bf5f2c24'/>
<id>urn:sha1:1a0dcb5caaaa2d9f0dc25d87735b76f1bf5f2c24</id>
<content type='text'>
If a translation only has unicode code points 255 and below, the "values"
array can be 8 bits instead of 16 bits.  This reclaims some code size,
e.g., in a local build, trinket_m0 / en_US reclaimed 112 bytes and de_DE
reclaimed 104 bytes.  However, languages like zh_Latn_pinyin, which use
code points above 255, did not benefit.
</content>
</entry>
<entry>
<title>makeqstrdata: fix printing of 'increased length' message</title>
<updated>2019-12-02T16:18:48+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2019-12-02T16:18:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=879e1041c9bb0067bc06337870f2515922469cf0'/>
<id>urn:sha1:879e1041c9bb0067bc06337870f2515922469cf0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>translation: Compress as unicode, not bytes</title>
<updated>2019-12-02T15:46:46+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2019-12-02T14:41:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=e06a3bbceb548432969bfcfa1076dc4363478151'/>
<id>urn:sha1:e06a3bbceb548432969bfcfa1076dc4363478151</id>
<content type='text'>
By treating each unicode code-point as a single entity for huffman
compression, the overall compression rate can be somewhat improved
without changing the algorithm.  On the decompression side, when
compressed values above 127 are encountered, they need to be
converted from a 16-bit Unicode code point into a UTF-8 byte
sequence.

Doing this returns approximately 1.5kB of flash storage with the
zh_Latn_pinyin translation. (292 -&gt; 1768 bytes remaining in my build
of trinket_m0)

Other "more ASCII" translations benefit less, and in fact
zh_Latn_pinyin is no longer the most constrained translation!
(de_DE 1156 -&gt; 1384 bytes free in flash, I didn't check others
before pushing for CI)

English is slightly pessimized, 2840 -&gt; 2788 bytes, probably mostly
because the "values" array was changed from uint8_t to uint16_t,
which is strictly not required for an all-ASCII translation.  This
could probably be avoided in this case, but as English is not the
most constrained translation it doesn't really matter.

Testing performed: built for feather nRF52840 express and trinket m0
in English and zh_Latn_pinyin; ran and verified the localized
messages such as
    Àn xià rènhé jiàn jìnrù REPL. Shǐyòng CTRL-D chóngxīn jiāzài.
and
    Press any key to enter the REPL. Use CTRL-D to reload.
were properly displayed.
</content>
</entry>
<entry>
<title>Merge remote-tracking branch 'origin/master' into tick-refactor</title>
<updated>2019-11-29T17:27:09+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2019-11-29T17:27:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=95d9c49e439cc4ba440ea737b57d03544bc952dc'/>
<id>urn:sha1:95d9c49e439cc4ba440ea737b57d03544bc952dc</id>
<content type='text'>
</content>
</entry>
</feed>
