| Age | Commit message (Collapse) | Author |
|
Pixelbuf doc fix
|
|
Ujson should only worry about whitespace before JSON. This becomes apparent when you are using MP stream protocol to read directly from input buffers.
When you attempt to read(1) on a UART (and possibly other protocols) you have to wait for either the byte or the timeout.
Fixes:
- Waiting for a timeout after you have completed reading a correct and complete JSON off the input.
- Raising an OSError after reading a correct and complete JSON off the input.
- Eating more data than semantically owned off the input buffer.
- Blocking to start parsing JSON until the entire JSON body has been loaded into a potentially large, contiguous Python object.
Code you would write before:
```
line = board_busio_uart_port.read_line()
json_dict = json.loads(line)
```
or reaching for fixed buffers and swapping them around in Python.
Code that did not work before that does now:
```
json_dict = json.load(board_busio_uart_port)
```
- This removes the need for intermediate copies of data when reading JSON from micropython stream protocol inputs.
- It also increases total application speed by parsing JSON concurrently with receiving on boards that read from UART via DMA.
- It simplifies code that users write while improving their apps.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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>
|
|
|
|
|
|
|
|
|
|
Fix #2814 Corrected UART output.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Closes: #2787
|
|
|
|
|
|
When allocate_display_bus_or_raise was factored out, the assignment
of the bus's Python type was lost. Restore it.
This would have affected displays of any type other than RGBMatrix, when
they were created dynamically. Boards with displays configured in flash
were unaffected.
Closes: #2792
|
|
This isn't perfect and needs a bit more testing.
|
|
|
|
|
|
... allocate_display_bus_or_raise() uses fixed storage, not heap storage.
|
|
|
|
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.
|
|
|
|
|
|
This is a quick rename, it changes the user-facing names but not the
internal names of things.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
checking
They're not readily distinguishable by type.
I also added the requested height optional parameter; this is checked
against the computed one. It's not feasible to use this parameter to
artificailly reduce the number of used rows, because changes in the
underlying C protomatter library would be required.
Finally, I added a better error message when the number of RGB pins was
not what was expected.
|
|
- rename oe_pin -> output_enable_pin
- improve and reorganize docstrings
- rename swapbuffers->refresh
- rename "paused" -> "brightness", change semantics slightly
- common_hal several functions
- clarify why the common_hal routines can't be used directly in the
protocol's function pointers
- whitespace cleanups
- remove prototypes for nonexistent functions
|
|
|
|
|
|
|
|
The numbered error from the underlying library is not helpful for
beginning users
|
|
|
|
|
|
|