Skip to content

Commit

Permalink
chore: fix pisugar-poweroff
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyc committed Jun 27, 2022
1 parent bc5f329 commit 38bf5af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pisugar-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ impl PiSugarCore {
let _ = execute_shell("sync");
}

let _ = call_rtc!(&self.rtc, force_shutdown);
call_rtc!(&self.rtc, force_shutdown)?;
call_battery!(&self.battery, shutdown)
}

Expand Down
4 changes: 3 additions & 1 deletion pisugar-poweroff/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ use std::convert::TryInto;
fn shutdown(config: PiSugarConfig, model: Model, retries: u32) -> Result<()> {
let core = PiSugarCore::new(config, model)?;
for _ in 0..retries {
let _ = core.force_shutdown();
if let Err(e) = core.force_shutdown() {
eprintln!("{}", e);
}
sleep(Duration::from_millis(10));
}
Ok(())
Expand Down

0 comments on commit 38bf5af

Please sign in to comment.