-
Notifications
You must be signed in to change notification settings - Fork 208
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
Allow configuring the watchdogs in the init config #2180
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly looks good to me, and I agree with @bugadani we should find a better place for these configs.
Another thing to think about it how to test this. I don't think there is a way to do something like #[should_reset]
in embedded-test, but we should at least test that recreating the peripheral in "user" code and feeding the wdt works (we should also check that when users construct Rtc etc the wdg registers are not reset.
30feb87
to
4f9fe2a
Compare
ESP32 hil is failing, but not related to this PR |
892ed5d
to
591f0c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
591f0c3
to
cd0a8a8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
I tested the |
let mut timg1_wd = crate::timer::timg::Wdt::<self::peripherals::TIMG1>::new(); | ||
timg1_wd.enable(); | ||
timg1_wd.set_timeout(duration); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this play nice with
esp-hal/esp-hal/src/timer/timg.rs
Line 251 in 370f541
T::reset_peripheral(); |
Thank you for your contribution!
We appreciate the time and effort you've put into this pull request.
To help us review it efficiently, please ensure you've gone through the following checklist:
Submission Checklist 📝
cargo xtask fmt-packages
command to ensure that all changed code is formatted correctly.CHANGELOG.md
in the proper section.Extra:
Pull Request Details 📖
Description
Provides a way to configure watchdogs in
esp_hal::init()
Testing
Tested different watchdog configurations in one example.