Skip to content
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

Workaround for ESP32-C6 one-shot ADC #876

Merged
merged 2 commits into from
Oct 26, 2023

Conversation

bjoernQ
Copy link
Contributor

@bjoernQ bjoernQ commented Oct 26, 2023

Fixes #780

unsafe {
ets_delay_us(40);
}
ADCI::start_onetime_sample();
Copy link
Contributor

@bugadani bugadani Oct 26, 2023

Choose a reason for hiding this comment

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

This isn't the same sequence as the linked C code: that is a bit_clear(); wait; bit_set() sequence, while this looks like two bit sets. It's interesting how the workaround still seems to work, I wonder what actually needs the delay.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's not the same thing - but works

Copy link
Member

@jessebraham jessebraham 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 the fix!

@jessebraham jessebraham merged commit 663cbd9 into esp-rs:main Oct 26, 2023
17 checks passed
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.

[ESP32-C6] ADC always returns 0, adc_cal panics
3 participants