Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return device locked error when lock screen (pin code) is activated #14

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion rust-app/src/main_nanos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ use core::cell::RefCell;
use core::pin::Pin;
use pin_cell::*;

// Trick to manage pin code
use core::convert::TryFrom;
struct Temp {}
impl TryFrom<io::ApduHeader> for Temp {
type Error = io::StatusWords;
fn try_from(_header: io::ApduHeader) -> Result<Self, Self::Error> {
Ok(Self {})
}
}

#[allow(dead_code)]
pub fn app_main() {
let comm: SingleThreaded<RefCell<io::Comm>> = SingleThreaded(RefCell::new(io::Comm::new()));
Expand Down Expand Up @@ -116,7 +126,8 @@ pub fn app_main() {
}
io::Event::Ticker => {
if UxEvent::Event.request() != BOLOS_UX_OK {
UxEvent::block();
let mut c = comm.borrow_mut();
UxEvent::block_and_get_event::<Temp>(&mut c);
// Redisplay application menu here
menu(states.borrow(), &idle_menu, &busy_menu);
}
Expand Down
Loading