Skip to content

Reinit ADC completely on each call to AnalogIn.value.#327

Merged
tannewt merged 1 commit into
adafruit:2.xfrom
dhalbert:2.x_issue_326_analogin
Oct 15, 2017
Merged

Reinit ADC completely on each call to AnalogIn.value.#327
tannewt merged 1 commit into
adafruit:2.xfrom
dhalbert:2.x_issue_326_analogin

Conversation

@dhalbert
Copy link
Copy Markdown
Collaborator

Fixes #326. AnalogIn used to keep around the ADE settings struct, and reference count it. However, now other code uses the ADC (e.g., microcontroller.core.temperaature), so the ADC needs to be completely re-inited each time it's used, since we don't know what state it's in. So now theadc_config and adc_module instances are just created each time on the stack.

@dhalbert dhalbert requested a review from tannewt October 15, 2017 15:53
@dhalbert dhalbert self-assigned this Oct 15, 2017
Copy link
Copy Markdown
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.

So much simpler. Thanks!

@tannewt tannewt merged commit 8f3be0a into adafruit:2.x Oct 15, 2017
@dhalbert dhalbert deleted the 2.x_issue_326_analogin branch October 16, 2017 14:21
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