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

Provide an API to get reliable system uptime #1139

Closed
AnthonyGrondin opened this issue Feb 5, 2024 · 1 comment · Fixed by #1503
Closed

Provide an API to get reliable system uptime #1139

AnthonyGrondin opened this issue Feb 5, 2024 · 1 comment · Fixed by #1503
Assignees
Labels
status:needs-attention This should be prioritized

Comments

@AnthonyGrondin
Copy link
Contributor

AnthonyGrondin commented Feb 5, 2024

Currently, there are multiple timers, hardware and software that can be used in multiple configurations on the ESP32. Some have edge cases, like xtensa_lx::timer::get_cycle_count() that overflows after a certain time, or Systimer that overflows too on certain targets.

There should be a unified public API that allows reliably fetching the current uptime of the board, no matter the timer(s) configurations. It could also implement traits from Fugit to get the uptime in multiple formats, such as Duration (ms, seconds, etc), and count (total cycle count).

See also: https://github.com/esp-rs/esp-wifi/blob/e8042d54b63c4807b3c66b5d8923e38d9eae6d8e/esp-wifi/src/lib.rs#L83-L86

@jessebraham
Copy link
Member

I also would like to see something like this, so thanks for opening this issue. I'm pretty swamped currently, but I will see if I can find somebody to look into this in the next couple weeks.

@jessebraham jessebraham added the help wanted Extra attention is needed label Feb 13, 2024
@jessebraham jessebraham added status:needs-attention This should be prioritized and removed enhancement help wanted Extra attention is needed labels Apr 3, 2024
@bjoernQ bjoernQ self-assigned this Apr 22, 2024
@bjoernQ bjoernQ mentioned this issue Apr 23, 2024
3 tasks
@github-project-automation github-project-automation bot moved this from Todo to Done in esp-rs Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:needs-attention This should be prioritized
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants