Store the RTC value in the .uninitialized section, but make sure to
flank it with some known values. That way we can determine if the RTC
value has been initialized, or if it's random uninitialized garbage.
As part of this, add a `common_hal_rtc_init()` routine to determine if
the value is correct, or reset it to 0 if it is not valid.
Signed-off-by: Sean Cross <sean@xobs.io>
Circuit Python supports saving a single word of data across reboots.
Previously, this data was placed immediately following the .bss.
However, this appeared to not work, as Circuit Python zeroes out the
heap when it starts up, and the heap begins immediately after the .bss.
Switch to using the new .uninitialized section in order to store this
word across resets.
Signed-off-by: Sean Cross <sean@xobs.io>
Previously, it was placed following .bss. However, now that there is a
new section after .bss, the heap must be moved forward.
Signed-off-by: Sean Cross <sean@xobs.io>
This section immediately follows the .bss section, and is designed to
contain uninitialized variables that should persist across reboots.
The section is placed directly after .bss, under the theory that the
size of Circuit Python's .bss + .data is bigger than the bootloader's
.bss + .data, so there is less likely to be a conflict.
Signed-off-by: Sean Cross <sean@xobs.io>
SPIM3 is faster than all other SPI blocks, and is capable of generating
a 32 MHz clock. However, it cannot be used at the same time as the BLE
radio without dedicating an additional 8 kB of RAM to it.
Therefore, some boards may want to disable this. Support pre-defining
NRFX_SPIM3_ENABLED on the command line to disable it on some bords.
Signed-off-by: Sean Cross <sean@xobs.io>
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.
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.