changed watchdog set_time to set_timeout

This commit is contained in:
Jacob Weaver
2024-12-13 10:36:05 -06:00
parent 6b27e84e4b
commit 24368d6b70
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ impl<'a> Hs<'a> {
} else { } else {
watchdog.disable(); watchdog.disable();
} }
watchdog.set_time(config.watchdog_timeout); watchdog.set_timeout(config.watchdog_timeout);
Self { Self {
data: Default::default(), data: Default::default(),
config, config,
+5 -5
View File
@@ -1,7 +1,7 @@
pub trait Watchdog { pub trait Watchdog {
fn enable(&mut self); fn enable(&mut self);
fn disable(&mut self); fn disable(&mut self);
fn set_time(&mut self, time: i32); fn set_timeout(&mut self, time: i32);
fn feed(&mut self); fn feed(&mut self);
} }
@@ -42,7 +42,7 @@ mod watchdog_std {
); );
} }
fn set_time(&mut self, time: i32) { fn set_timeout(&mut self, time: i32) {
unwrap_print_err!(self.wd.set_timeout(time), "failed to set watchdog timeout"); unwrap_print_err!(self.wd.set_timeout(time), "failed to set watchdog timeout");
} }
@@ -57,7 +57,7 @@ pub use watchdog_std::*;
pub type WatchdogRef<'a> = Option<&'a mut dyn Watchdog>; pub type WatchdogRef<'a> = Option<&'a mut dyn Watchdog>;
impl<'a> Watchdog for Option<&'a mut dyn Watchdog> { impl<'a> Watchdog for WatchdogRef<'a> {
fn enable(&mut self) { fn enable(&mut self) {
if let Some(wd) = self { if let Some(wd) = self {
wd.enable(); wd.enable();
@@ -70,9 +70,9 @@ impl<'a> Watchdog for Option<&'a mut dyn Watchdog> {
} }
} }
fn set_time(&mut self, time: i32) { fn set_timeout(&mut self, time: i32) {
if let Some(wd) = self { if let Some(wd) = self {
wd.set_time(time); wd.set_timeout(time);
} }
} }