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:
bunnie 2023-05-21 18:25:27 +08:00
parent d1af22f861
commit fe646f52c1

View file

@ -634,10 +634,7 @@ 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() { match susres.initiate_suspend() {
Ok(_) => {}, Ok(_) => {},
Err(xous::Error::Timeout) => { Err(xous::Error::Timeout) => {
@ -649,6 +646,7 @@ fn wrapped_main() -> ! {
} }
} }
} }
}
// spawn a thread to auto-mount the PDDB // spawn a thread to auto-mount the PDDB
let _ = thread::spawn({ let _ = thread::spawn({