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

Sleep support for esp32c3 #795

Merged
merged 9 commits into from
Sep 29, 2023
Merged

Sleep support for esp32c3 #795

merged 9 commits into from
Sep 29, 2023

Conversation

jneem
Copy link
Contributor

@jneem jneem commented Sep 17, 2023

This implements basic support for esp32c3 sleep. Only timer and GPIO are supported for wakeup so far.

I wrote this mostly by comparing the esp32s3 sleep implementation with the IDF source. I was a little confused by the RTCPinWithResistor trait, because as far as I could tell IDF configures pullup and pulldown on all the wakeup pins...

I had one question, though (which is probably caused by me being an embedded noob): what do you do to observe printlns when sleeping? espflash seems to just disconnect on deep sleep, and on light sleep it keeps the connection but doesn't actually print anything. I'm testing it right now using blinking leds...

Must

  • The code compiles without errors or warnings.
  • All examples work.
  • cargo fmt was run.
  • Your changes were added to the CHANGELOG.md in the proper section.
  • You updated existing examples or added examples (if applicable).
  • Added examples are checked in CI

Nice to have

  • You add a description of your work to this PR.
  • You added proper docs for your newly added features and code.

@jneem jneem marked this pull request as ready for review September 23, 2023 17:26
@jessebraham
Copy link
Member

Thanks for the PR. Could you please remove all of the #[rustfmt::skip] attributes? I don't want to get in the habit of doing this, it's really not necessary and adds a lot of noise to the code.

@jessebraham
Copy link
Member

(Also sorry, I will review this soon!)

Copy link
Contributor

@bjoernQ bjoernQ left a comment

Choose a reason for hiding this comment

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

LGTM - Thanks for your contribution

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.

I have apprehensions about having completely different RTCPin traits for RISC-V and Xtensa, but I think for the time being this is okay and probably implies we need to rethink that trait. Once we add support for more devices the path forward may become more clear, so we'll just roll with this for now I suppose.

Thanks for your work on this, LGTM!

@jessebraham jessebraham merged commit d819945 into esp-rs:main Sep 29, 2023
16 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.

3 participants