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

implement fetching the RTC timer value in milliseconds and mircroseconds #476

Merged
merged 5 commits into from
May 8, 2023

Conversation

liebman
Copy link
Contributor

@liebman liebman commented Apr 12, 2023

This implements get_time_ms() and get_time_us() on rtc_cntl::Rtc examples are included and have been tested on all cpu types except esp32c2.

Random notes:

  • in the pac for esp32c6 what was all in RTC_CNTL seems broken out into a number of LP_X peripherals.
  • should these be combind in the hal api or should they remain seperate? If seperate should we do the same with other chips?

@bjoernQ
Copy link
Contributor

bjoernQ commented Apr 21, 2023

Awesome! Maybe it would be good to align the field names in the SVD/PACs but that can also be done afterwards

Is there anything blocking you here?

@liebman
Copy link
Contributor Author

liebman commented Apr 22, 2023

Blocked only by because I'm vacationing in Japan. :-)

@jessebraham
Copy link
Member

I'm happy to update the PACs (either before or after merging this, makes no difference to me), so just lemme know if/when you'd like that done!

In the meantime, enjoy your vacation!

@liebman liebman marked this pull request as ready for review May 5, 2023 19:38
@liebman
Copy link
Contributor Author

liebman commented May 5, 2023

@jessebraham ok - lets go ahead and review/merge this. We can adjust the PACs after.
EDIT: lets not merge until I put a limit on the loop waiting for the update for esp32.

@liebman
Copy link
Contributor Author

liebman commented May 5, 2023

ok - I added what esp-idf does for esp32 - they delay 1us between checks of the update bit to avoid flooding the RTC bus

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.

Seems to be working as far as I can tell so LGTM, thanks for contributing this! I'll get the PACs cleaned up, then whenever we publish them next we can revisit this.

@jessebraham jessebraham merged commit 905c0af into esp-rs:main May 8, 2023
i404788 pushed a commit to i404788/esp-hal that referenced this pull request Jul 22, 2023
…nds (esp-rs#476)

* implement fetching the rtc timer value in miliseconds and mircroseconds

* fmt cleanup

* add rtc_time examples

* get_time_raw/esp32: delay 1us between time update checks like esp-idf

* cargo fmt
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