mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
fix #382
this should fix the issue on #382. The behavior is now: *device not plugged in* 1. select "Lock device (reboot)" 2. device reboots 3. device goes to sleep 4. user wakes up the device 5. user is challenged with the unlock PIN *device is plugged in* 1. select "Lock device (reboot)" 2. device reboots 3. user is challenged with the unlock PIN I think this should be the "least surprising" outcome given the description of the menu item.
This commit is contained in:
parent
d1af22f861
commit
fe646f52c1
1 changed files with 10 additions and 12 deletions
|
|
@ -634,18 +634,16 @@ fn wrapped_main() -> ! {
|
||||||
// reset it for good measure
|
// reset it for good measure
|
||||||
early_settings.set_early_sleep(false).unwrap();
|
early_settings.set_early_sleep(false).unwrap();
|
||||||
|
|
||||||
while ((llio.adc_vbus().unwrap() as u32) * 503) > 150_000 {
|
if ((llio.adc_vbus().unwrap() as u32) * 503) <= 150_000 {
|
||||||
modals.show_notification(t!("mainmenu.cant_sleep", xous::LANG), None).expect("couldn't notify that power is plugged in");
|
match susres.initiate_suspend() {
|
||||||
}
|
Ok(_) => {},
|
||||||
|
Err(xous::Error::Timeout) => {
|
||||||
match susres.initiate_suspend() {
|
// TODO: maybe this branch needs a different log message/flow?
|
||||||
Ok(_) => {},
|
modals.show_notification(t!("suspend.fail", xous::LANG), None).unwrap();
|
||||||
Err(xous::Error::Timeout) => {
|
}
|
||||||
// TODO: maybe this branch needs a different log message/flow?
|
Err(_e) => {
|
||||||
modals.show_notification(t!("suspend.fail", xous::LANG), None).unwrap();
|
panic!("Unhandled error on suspend request");
|
||||||
}
|
}
|
||||||
Err(_e) => {
|
|
||||||
panic!("Unhandled error on suspend request");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue