From fe6faa21fcc0ef0dc1345559d364e3b3bd5f3f7f Mon Sep 17 00:00:00 2001 From: 13r0ck Date: Fri, 19 May 2023 11:36:16 -0600 Subject: [PATCH] Add reset command to ectool --- tool/src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tool/src/main.rs b/tool/src/main.rs index eef1735..6eb9f0a 100644 --- a/tool/src/main.rs +++ b/tool/src/main.rs @@ -376,6 +376,7 @@ fn main() { ) ) .subcommand(SubCommand::with_name("led_save")) + .subcommand(SubCommand::with_name("reset")) .subcommand(SubCommand::with_name("matrix")) .subcommand(SubCommand::with_name("print") .arg(Arg::with_name("message") @@ -601,6 +602,13 @@ fn main() { process::exit(1); }, }, + Some(("reset", _sub_m)) => match unsafe { ec.reset() } { + Ok(()) => (), + Err(err) => { + eprintln!("failed to reset device: {:X?}", err); + process::exit(1); + }, + }, Some(("matrix", _sub_m)) => match unsafe { matrix(&mut ec) } { Ok(()) => (), Err(err) => {