Skip to content

Commit

Permalink
Return device locked error when lock screen (pin code) is activated
Browse files Browse the repository at this point in the history
  • Loading branch information
yogh333 committed Jan 9, 2025
1 parent e5b0d0e commit 16c4665
Showing 1 changed file with 12 additions and 1 deletion.
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

0 comments on commit 16c4665

Please sign in to comment.