|
4 | 4 | /// commonly referred to as "kicking" or "refreshing".
|
5 | 5 | #[cfg(feature = "unproven")]
|
6 | 6 | pub trait Watchdog {
|
| 7 | + /// An enumeration of `Watchdog` errors. |
| 8 | + /// |
| 9 | + /// For infallible implementations, will be `Infallible` |
| 10 | + type Error; |
| 11 | + |
7 | 12 | /// Triggers the watchdog. This must be done once the watchdog is started
|
8 | 13 | /// to prevent the processor being reset.
|
9 |
| - fn feed(&mut self); |
| 14 | + fn try_feed(&mut self) -> Result<(), Self::Error>; |
10 | 15 | }
|
11 | 16 |
|
12 | 17 | /// Enables A watchdog timer to reset the processor if software is frozen or
|
13 | 18 | /// stalled.
|
14 | 19 | #[cfg(feature = "unproven")]
|
15 | 20 | pub trait WatchdogEnable {
|
| 21 | + /// An enumeration of `WatchdogEnable` errors. |
| 22 | + /// |
| 23 | + /// For infallible implementations, will be `Infallible` |
| 24 | + type Error; |
| 25 | + |
16 | 26 | /// Unit of time used by the watchdog
|
17 | 27 | type Time;
|
| 28 | + |
18 | 29 | /// Starts the watchdog with a given period, typically once this is done
|
19 | 30 | /// the watchdog needs to be kicked periodically or the processor is reset.
|
20 |
| - fn start<T>(&mut self, period: T) |
| 31 | + fn try_start<T>(&mut self, period: T) -> Result<(), Self::Error> |
21 | 32 | where
|
22 | 33 | T: Into<Self::Time>;
|
23 | 34 | }
|
24 | 35 |
|
25 | 36 | /// Disables a running watchdog timer so the processor won't be reset.
|
26 | 37 | #[cfg(feature = "unproven")]
|
27 | 38 | pub trait WatchdogDisable {
|
| 39 | + /// An enumeration of `WatchdogDisable` errors. |
| 40 | + /// |
| 41 | + /// For infallible implementations, will be `Infallible` |
| 42 | + type Error; |
| 43 | + |
28 | 44 | /// Disables the watchdog
|
29 |
| - fn disable(&mut self); |
| 45 | + fn try_disable(&mut self) -> Result<(), Self::Error>; |
30 | 46 | }
|
0 commit comments