Add reset command to ectool

This commit is contained in:
13r0ck
2023-05-19 11:36:16 -06:00
committed by Tim Crawford
parent 485f390077
commit fe6faa21fc

View File

@ -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) => {