nrf/wdt: add handle steal
This commit is contained in:
@ -150,4 +150,12 @@ impl WatchdogHandle {
|
||||
let idx = self.index as usize;
|
||||
((rd >> idx) & 0x1) == 0
|
||||
}
|
||||
|
||||
/// Steal a watchdog handle by index.
|
||||
///
|
||||
/// Safety: watchdog must be initialized, index must be between 0 and N-1 where
|
||||
/// N is the handle count when initializing.
|
||||
pub unsafe fn steal(index: u8) -> Self {
|
||||
Self { index }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user