File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -88,8 +88,15 @@ const APP: () = {
8888 handles
8989 }
9090 Err ( wdt) => match Watchdog :: try_recover :: < count:: Four > ( wdt) {
91- Ok ( Parts { handles, .. } ) => {
91+ Ok ( Parts { mut handles, .. } ) => {
9292 rprintln ! ( "Oops, watchdog already active, but recovering!" ) ;
93+
94+ // Pet all the dogs quickly to reset to default timeout
95+ handles. 0 . pet ( ) ;
96+ handles. 1 . pet ( ) ;
97+ handles. 2 . pet ( ) ;
98+ handles. 3 . pet ( ) ;
99+
93100 handles
94101 }
95102 Err ( _wdt) => {
Original file line number Diff line number Diff line change @@ -173,6 +173,9 @@ impl Watchdog<Active> {
173173 /// number of requested handles matches the activated number of handles,
174174 /// an activated handle will be returned. Otherwise the peripheral will
175175 /// be returned
176+ ///
177+ /// NOTE: Since the watchdog is already counting, you want to pet these dogs
178+ /// as soon as possible!
176179 pub fn try_recover < H : sealed:: Handles > ( wdt : WDT ) -> Result < Parts < H :: Handles > , WDT > {
177180 // Do we have the same number of handles at least?
178181 if wdt. rren . read ( ) . bits ( ) == H :: ENABLE {
You can’t perform that action at this time.
0 commit comments