Skip to content

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

Merged
merged 13 commits into from
Aug 31, 2017

Conversation

dhalbert
Copy link
Collaborator

[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.

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.
@dhalbert dhalbert requested a review from tannewt August 30, 2017 01:00
Copy link
Member

@tannewt tannewt left a 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.
Copy link
Member

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?

Copy link
Collaborator Author

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
================= ======= ============== =======
Copy link
Member

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I built the docs with sphinx locally to check, and it looks OK. I forgot the ending ========== line the first time, and pushed a new commit to fix that.
screenshot from 2017-08-30 13-27-05

//|
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");
Copy link
Member

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!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

#include "shared-bindings/core/__init__.h"
#include "shared-bindings/core/Core.h"

//| :mod:`core` --- Microcontroller core chip information and control
Copy link
Member

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.

Copy link
Member

@tannewt tannewt left a 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.

@dhalbert dhalbert merged commit fdb97ed into adafruit:master Aug 31, 2017
@dhalbert dhalbert changed the title Add microcontroller.core.temperature, for use as a simple sensor on minimal boards. Add microcontroller.cpu.temperature, for use as a simple sensor on minimal boards. Aug 31, 2017
@dhalbert dhalbert deleted the issue_177_samd_temp branch August 31, 2017 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants