-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add microcontroller.cpu.temperature, for use as a simple sensor on minimal boards. #211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any idea why this diff is still in here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rst tables are really finicky. I have a feeling the last ======
will need to be longer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shared-bindings/nvm/ByteArray.c
Outdated
//| | ||
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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing this up!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
shared-bindings/core/__init__.c
Outdated
#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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
[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.