small improvements and fixes
All checks were successful
Rust/va416xx-rs/pipeline/head This commit looks good

This commit is contained in:
2024-07-01 16:02:10 +02:00
parent a2b43bff06
commit a2a4b5ff01
7 changed files with 90 additions and 25 deletions

View File

@ -13,11 +13,16 @@ use crate::{disable_interrupt, enable_interrupt};
pub const WDT_UNLOCK_VALUE: u32 = 0x1ACC_E551;
pub struct WdtController {
/// Watchdog peripheral driver.
pub struct Wdt {
clock_freq: Hertz,
wdt: pac::WatchDog,
}
/// Type alias for backwards compatibility
#[deprecated(since = "0.2.0", note = "Please use `Wdt` instead")]
pub type WdtController = Wdt;
/// Enable the watchdog interrupt
///
/// # Safety
@ -33,7 +38,7 @@ pub fn disable_wdt_interrupts() {
disable_interrupt(pac::Interrupt::WATCHDOG)
}
impl WdtController {
impl Wdt {
pub fn new(
&self,
syscfg: &mut pac::Sysconfig,