Skip to content

Add microcontroller.core.temperature, for use as a simple sensor on minimal boards. - #210

Closed
dhalbert wants to merge 8 commits into
adafruit:masterfrom
dhalbert:issue_177_samd_temp
Closed

Add microcontroller.core.temperature, for use as a simple sensor on minimal boards.#210
dhalbert wants to merge 8 commits into
adafruit:masterfrom
dhalbert:issue_177_samd_temp

Conversation

@dhalbert

@dhalbert dhalbert commented Aug 29, 2017

Copy link
Copy Markdown
Collaborator

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.

@dhalbert
dhalbert requested a review from tannewt August 29, 2017 19:39
@dhalbert dhalbert self-assigned this Aug 29, 2017

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This will break the ESP8266. You probably want to #ifdef it out like nvm.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Instead, I implemented core for ESP8266. core.temperature does not exist (or at least there's no public API yet) and will return None. The common-hal temperature function returns NAN to signal no value is available. core.frequency is available and I return that.

Comment thread shared-bindings/busio/UART.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please rebase so this isn't in the diff.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed, I hope.

Comment thread shared-bindings/microcontroller/core.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think this should be documented as a mod because properties only work on objects. Instead, document microcontroller.core as an object of microcontroller.Core. Please capitalize where appropriate such as the file, docs and QSTR name.

Comment thread shared-bindings/microcontroller/core.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove __ to match new style header guards.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

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