Add microcontroller.cpu.temperature, for use as a simple sensor on minimal boards. - #211
Conversation
…re. Dummy value returned for now.
Squeeze firmware size by using -finline-limit. Otherwise non-Express builds were slightly too big.
…gleton class. Clarify some documentation. Transpose support matrix in `shared-bindings/index.rst`. It was getting r-e-a-l-l-y w-i-d-e, especially after adding `core` and `nvm` entries.
tannewt
left a comment
There was a problem hiding this comment.
Thanks for adding the ESP8266 support! I don't think a new module is needed though. I think I confused you with the capitalization. Renaming the class to Processor should help with that.
It does beg the question how it scales to multi-core but we can ignore that for 2.0.
| //| bytes. Otherwise, read everything that has been buffered. | ||
| //| bytes. Otherwise, read everything that arrives until the connection | ||
| //| times out. Providing the number of bytes expected is highly recommended | ||
| //| because it will be faster. |
There was a problem hiding this comment.
Any idea why this diff is still in here?
There was a problem hiding this comment.
That's a good question. It's possible I deleted a commit when I did a rebase, but I don't remember doing that. However, I'd say it's harmless. If you do a squash merge you could just delete the redundant comment, I think.
There were two merges from adafruit/circuitpython. One was the v1.9.2 merge, and the next was one or two commits after that, including this one.
| =============== ========== ========= =========== ======= ======= =========== ================= =============== ================ ======= ========= ======== ========= ======== ========= ======= ========= | ||
| ================= ======= ============== ======= | ||
| Module / Port SAMD21 SAMD21 Express ESP8266 | ||
| ================= ======= ============== ======= |
There was a problem hiding this comment.
rst tables are really finicky. I have a feeling the last ====== will need to be longer.
| STATIC mp_obj_t nvm_bytearray_make_new(const mp_obj_type_t *type, | ||
| mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { | ||
| return mp_const_none; | ||
| mp_raise_TypeError("cannot be created: use instance in microcontroller.nvm"); |
| #include "shared-bindings/core/__init__.h" | ||
| #include "shared-bindings/core/Core.h" | ||
|
|
||
| //| :mod:`core` --- Microcontroller core chip information and control |
There was a problem hiding this comment.
I think this should be folded back into microcontroller because I don't expect it to be unavailable on any port. It also conflicts with: https://downloads.pf.itd.nrl.navy.mil/docs/core/core-python-html/
Instead, perhaps rename the type to Processor to reduce confusion with the core attribute.
tannewt
left a comment
There was a problem hiding this comment.
Looks awesome! Thank you for your patience Dan. I'll approve and let you squash and rebase it into master. Please ignore Rosie. I'm not sure why its temperamental.
The PIO USB receiver can lock onto an incoming packet a few bits early, so every byte arrives shifted and the aligned CRC check fails on wire data that is perfectly valid. The device retransmits forever and the endpoint is stuck until reboot. On the Fruit Jam this presents as hub hot plug delivery dying permanently, gated by unrelated build flags (vectorio compiled in but never imported), because the firmware memory layout steers the timing that decides the framing. Pulls sekigon-gonnoc/Pico-PIO-USB#211, which keys the realignment on the SYNC byte (0x80) to derive the exact shift and recover the packet. Fixes the 3-year-old sekigon-gonnoc/Pico-PIO-USB#97. DRAFT: submodule temporarily points at the mikeysklar fork so CI can fetch the commit. Repoint to the upstream sekigon-gonnoc SHA and restore the .gitmodules URL once adafruit#211 merges.

[replaces #210 due to force push problems]
Add microcontroller.core.temperature, for use as a simple sensor on minimal boards.
Also added microcontroller.core.frequency to return CPU frequency, in int Hertz.
Added -finline-limit=n to atmel-samd/Makefile to squeeze non-Express enough to fit.
This branch crossed the v1.9.2 merge, so I gave up trying to rebase.
Fixes #177.