mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
Merge pull request #735 from betrusted-io/bootwait-state
add ability to directly set bootwait
This commit is contained in:
commit
4b4ec33964
1 changed files with 15 additions and 4 deletions
|
|
@ -176,12 +176,12 @@ impl Repl {
|
|||
}
|
||||
}
|
||||
"bootwait" => {
|
||||
let one_way = OneWayCounter::new();
|
||||
if args.len() != 1 {
|
||||
return Err(Error::help("bootwait [check | toggle]"));
|
||||
return Err(Error::help("bootwait [check | toggle | enable | disable]"));
|
||||
}
|
||||
if args[0] == "toggle" {
|
||||
// this toggles the bootwait flag by incrementing its one-way counter
|
||||
let one_way = OneWayCounter::new();
|
||||
match one_way.inc_coded::<bao1x_api::BootWaitCoding>() {
|
||||
Ok(_) => {
|
||||
let state = one_way
|
||||
|
|
@ -192,12 +192,23 @@ impl Repl {
|
|||
Err(e) => crate::println!("Couldn't toggle bootwait: {:?}", e),
|
||||
}
|
||||
} else if args[0] == "check" {
|
||||
let one_way = OneWayCounter::new();
|
||||
let state =
|
||||
one_way.get_decoded::<bao1x_api::BootWaitCoding>().expect("couldn't fetch flag");
|
||||
crate::println!("bootwait is {:?}", state);
|
||||
} else if args[0] == "enable" {
|
||||
while one_way.get_decoded::<bao1x_api::BootWaitCoding>().expect("couldn't fetch flag")
|
||||
!= bao1x_api::BootWaitCoding::Enable
|
||||
{
|
||||
one_way.inc_coded::<bao1x_api::BootWaitCoding>().unwrap();
|
||||
}
|
||||
} else if args[0] == "disable" {
|
||||
while one_way.get_decoded::<bao1x_api::BootWaitCoding>().expect("couldn't fetch flag")
|
||||
!= bao1x_api::BootWaitCoding::Disable
|
||||
{
|
||||
one_way.inc_coded::<bao1x_api::BootWaitCoding>().unwrap();
|
||||
}
|
||||
} else {
|
||||
return Err(Error::help("bootwait [check | toggle]"));
|
||||
return Err(Error::help("bootwait [check | toggle | enable | disable]"));
|
||||
}
|
||||
}
|
||||
"boardtype" => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue