Skip to content

Add Watchdog trait#13

Merged
williampMSFT merged 4 commits into
OpenDevicePartnership:mainfrom
williampMSFT:user/williamp/watchdog
Mar 17, 2026
Merged

Add Watchdog trait#13
williampMSFT merged 4 commits into
OpenDevicePartnership:mainfrom
williampMSFT:user/williamp/watchdog

Conversation

@williampMSFT

Copy link
Copy Markdown
Contributor

This adds a trait to feed a watchdog timer

Comment thread embedded-mcu-hal/src/watchdog.rs Outdated
Comment thread embedded-mcu-hal/src/watchdog.rs
@williampMSFT williampMSFT marked this pull request as ready for review March 9, 2026 23:42
@williampMSFT williampMSFT requested a review from a team as a code owner March 9, 2026 23:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new Watchdog trait to the embedded-mcu-hal crate, providing an abstraction for feeding a processor's watchdog timer to prevent resets. It includes a blanket implementation for &mut T references.

Changes:

  • Added a new Watchdog trait with an associated Error type and a feed method
  • Added a blanket impl of Watchdog for &mut T where T: Watchdog
  • Registered the new watchdog module as a public module in lib.rs

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
embedded-mcu-hal/src/watchdog.rs New file defining the Watchdog trait with a feed method and a blanket impl for &mut T
embedded-mcu-hal/src/lib.rs Adds pub mod watchdog; to expose the new module

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread embedded-mcu-hal/src/watchdog.rs
kurtjd
kurtjd previously approved these changes Mar 10, 2026
Comment thread embedded-mcu-hal/src/watchdog.rs Outdated
Comment thread embedded-mcu-hal/src/watchdog.rs
jerrysxie
jerrysxie previously approved these changes Mar 11, 2026
@williampMSFT williampMSFT dismissed stale reviews from jerrysxie and kurtjd via e4205d9 March 16, 2026 18:33
@williampMSFT williampMSFT enabled auto-merge (squash) March 16, 2026 18:33
kurtjd
kurtjd previously approved these changes Mar 16, 2026

@jerrysxie jerrysxie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@felipebalbi @williampMSFT Are we aligned on implementing this for MCXA and IMXRT?

@williampMSFT

Copy link
Copy Markdown
Contributor Author

@felipebalbi @williampMSFT Are we aligned on implementing this for MCXA and IMXRT?

I think so, yeah. There are a couple catches, though - we need to publish this crate to crates.io with semver versions, and we need to hide the implementation and linkage to embedded-mcu on the MCXA HAL behind a feature flag

@jerrysxie jerrysxie requested review from JamesHuard and gjpmsft March 16, 2026 20:19
@jerrysxie jerrysxie disabled auto-merge March 16, 2026 20:19
@jerrysxie jerrysxie requested a review from bramsdell-ms March 16, 2026 20:21
@jerrysxie

jerrysxie commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

@gjpmsft @JamesHuard @bramsdell-ms @jamesmunns @diondokter Any feedback on this initial implementation of a MCU agnostic watchdog trait?

@jerrysxie jerrysxie added the enhancement New feature or request label Mar 16, 2026
Comment thread embedded-mcu-hal/src/watchdog.rs
RobertZ2011
RobertZ2011 previously approved these changes Mar 16, 2026
This reverts commit 8dcd438.
@williampMSFT williampMSFT dismissed stale reviews from RobertZ2011 and kurtjd via 43259ac March 17, 2026 16:09
@williampMSFT williampMSFT enabled auto-merge (squash) March 17, 2026 16:51
@williampMSFT williampMSFT merged commit 9cf60db into OpenDevicePartnership:main Mar 17, 2026
10 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in ODP v0.2 Mar 17, 2026
@williampMSFT williampMSFT deleted the user/williamp/watchdog branch March 17, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants