summaryrefslogtreecommitdiff
path: root/py
AgeCommit message (Collapse)Author
2020-05-13Merge remote-tracking branch 'adafruit/master' into improve_verificationScott Shawcroft
2020-05-12Don't build in empty help.cScott Shawcroft
2020-05-12Only enable COUNTIO in full buildsScott Shawcroft
2020-05-12Merge branch 'master' into Optical-Encoder-ModuleScott Shawcroft
2020-05-12Enable vectorio by default where displayio is enabledwarriorofwire
2020-05-12merged masterDaniel Pollard
2020-05-11set vectorio to FULL_BUILD and see what workswarriorofwire
2020-05-09vectorio: fix mpconfig definition for disabled boardswarriorofwire
2020-05-09Add vectorio: for drawing shapeswarriorofwire
vectorio builds on m4 express feather Concrete shapes are composed into a VectorShape which is put into a displayio Group for display. VectorShape provides transpose and x/y positioning for shape implementations. Included Shapes: * Circle - A radius; Circle is positioned at its axis in the VectorShape. - You can freely modify the radius to grow and shrink the circle in-place. * Polygon - An ordered list of points. - Beteween each successive point an edge is inferred. A final edge closing the shape is inferred between the last point and the first point. - You can modify the points in a Polygon. The points' coordinate system is relative to (0, 0) so if you'd like a top-center justified 10x20 rectangle you can do points [(-5, 0), (5, 0), (5, 20), (0, 20)] and your VectorShape x and y properties will position the rectangle relative to its top center point * Rectangle A width and a height.
2020-05-09removed duplicate build paramDaniel Pollard
2020-05-08Update py/circuitpy_mpconfig.mkDaniel Pollard
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2020-05-07updated descriptions and build variableDaniel Pollard
2020-05-06aesio: add basic AES encryption and decryptionSean Cross
This adds initial support for an AES module named aesio. This implementation supports only a subset of AES modes, namely ECB, CBC, and CTR modes. Example usage: ``` >>> import aesio >>> >>> key = b'Sixteen byte key' >>> cipher = aesio.AES(key, aesio.MODE_ECB) >>> output = bytearray(16) >>> cipher.encrypt_into(b'Circuit Python!!', output) >>> output bytearray(b'E\x14\x85\x18\x9a\x9c\r\x95>\xa7kV\xa2`\x8b\n') >>> ``` This key is 16-bytes, so it uses AES128. If your key is 24- or 32- bytes long, it will switch to AES192 or AES256 respectively. This has been tested with many of the official NIST test vectors, such as those used in `pycryptodome` at https://github.com/Legrandin/pycryptodome/tree/39626a5b01ce5c1cf51d022be166ad0aea722177/lib/Crypto/SelfTest/Cipher/test_vectors/AES CTR has not been tested as NIST does not provide test vectors for it. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-06changed build variables as per adviceDaniel Pollard
2020-05-05refactor countio based on feedbackDaniel Pollard
2020-05-04make translate againDan Halbert
2020-04-29change many ifndefs to ?=Dan Halbert
2020-04-29Merge remote-tracking branch 'adafruit/master' into ringbuf-fixesDan Halbert
2020-04-27Merge remote-tracking branch 'adafruit/master' into lower_powerScott Shawcroft
2020-04-27Merge pull request #2811 from jepler/update-ulabScott Shawcroft
ulab: actually update the submodule
2020-04-27Merge remote-tracking branch 'adafruit/master' into lower_powerScott Shawcroft
2020-04-26ulab: actually update the submoduleJeff Epler
PR#2802 missed the submodule update itself.
2020-04-23Minor redundancy fixLucian Copeland
2020-04-23Merge remote-tracking branch 'upstream/master' into stm32-docfixLucian Copeland
2020-04-23implement requested changesLucian Copeland
2020-04-22Remove old build flags, add fixes for shared_matrixLucian Copeland
2020-04-21ringbuf testedDan Halbert
2020-04-21merge from adafruitDan Halbert
2020-04-21further ringbuf cleanupDan Halbert
2020-04-20Merge remote-tracking branch 'adafruit/master' into lower_powerScott Shawcroft
This isn't perfect and needs a bit more testing.
2020-04-17RGBMatrix: finish renaming from ProtomatterJeff Epler
This gets all the purely internal references. Some uses of protomatter/Protomatter/PROTOMATTER remain, as they are references to symbols in the Protomatter C library itself.
2020-04-17Rename Protomatter -> RGBMatrixJeff Epler
This is a quick rename, it changes the user-facing names but not the internal names of things.
2020-04-17Rename _protomatter -> protomatterJeff Epler
I originally believed that there would be a wrapper library around it, like with _pixelbuf; but this proves not to be the case, as there's too little for the library to do.
2020-04-14Merge remote-tracking branch 'adafruit/master' into lower_powerScott Shawcroft
2020-04-14Make stripping circuitpython optional, not the defaultJeff Epler
2020-04-14Add Protomatter and FramebufferDisplayJeff Epler
2020-04-14py.mk: update warning flags needed for ulabJeff Epler
2020-04-02Clean upScott Shawcroft
2020-03-31Merge remote-tracking branch 'adafruit/master' into lower_powerScott Shawcroft
2020-03-20runtime: Improve error message when setting read-only propertyJeff Epler
Formerly, if you wrote SPI.frequency = 0 you would get the sightly erroneous error message AttributeError: 'SPI' object has no attribute 'frequency' In this case, a better message would read AttributeError: 'SPI' object cannot assign attribute 'frequency' This new message will both be used in the case where the attribute doesn't exist at all (and the object has no dynamic attributes; most instances of built in types behave this way), or if the attribute exists but is read-only.
2020-03-17ulab: include new 'extras' source fileJeff Epler
2020-03-17ulab: rename enable macro so it appears in the support matrixJeff Epler
2020-03-17objslice: take mp_obj_slice_indices from micropythonJeff Epler
2020-03-13Initial work on SAMDScott Shawcroft
2020-03-10Merge pull request #2690 from jepler/topic-pep-498-fstringsScott Shawcroft
Implement partial PEP-498 (f-string) support
2020-03-09circuitpy_mpconfig.mk: Enable ULAB for "full builds"Jeff Epler
This enables it on the imxrt and cds56 ports where it was disabled before
2020-03-09f-strings: Make optional, defaulting to !CIRCUITPY_MINIMAL_BUILDJeff Epler
This should reclaim *most* code space added to handle f-strings. However, there may be some small code growth as parse_string_literal takes a new parameter (which will always be 0, so hopefully the optimizer eliminates it)
2020-03-09lexer: catch concatenation of f'' and '' stringsJeff Epler
This turns the "edge case" into a parse-time error.
2020-03-09Address dpgeorge feedback - largely simplificationsJosh Klar
2020-03-09py: Implement partial PEP-498 (f-string) supportJosh Klar
This implements (most of) the PEP-498 spec for f-strings, with two exceptions: - raw f-strings (`fr` or `rf` prefixes) raise `NotImplementedError` - one special corner case does not function as specified in the PEP (more on that in a moment) This is implemented in the core as a syntax translation, brute-forcing all f-strings to run through `String.format`. For example, the statement `x='world'; print(f'hello {x}')` gets translated *at a syntax level* (injected into the lexer) to `x='world'; print('hello {}'.format(x))`. While this may lead to weird column results in tracebacks, it seemed like the fastest, most efficient, and *likely* most RAM-friendly option, despite being implemented under the hood with a completely separate `vstr_t`. Since [string concatenation of adjacent literals is implemented in the lexer](https://github.com/micropython/micropython/commit/534b7c368dc2af7720f3aaed0c936ef46d773957), two side effects emerge: - All strings with at least one f-string portion are concatenated into a single literal which *must* be run through `String.format()` wholesale, and: - Concatenation of a raw string with interpolation characters with an f-string will cause `IndexError`/`KeyError`, which is both different from CPython *and* different from the corner case mentioned in the PEP (which gave an example of the following:) ```python x = 10 y = 'hi' assert ('a' 'b' f'{x}' '{c}' f'str<{y:^4}>' 'd' 'e') == 'ab10{c}str< hi >de' ``` The above-linked commit detailed a pretty solid case for leaving string concatenation in the lexer rather than putting it in the parser, and undoing that decision would likely be disproportionately costly on resources for the sake of a probably-low-impact corner case. An alternative to become complaint with this corner case of the PEP would be to revert to string concatenation in the parser *only when an f-string is part of concatenation*, though I've done no investigation on the difficulty or costs of doing this. A decent set of tests is included. I've manually tested this on the `unix` port on Linux and on a Feather M4 Express (`atmel-samd`) and things seem sane.