From 9e89803cb8f6031cd52224c7c9eb3540a46828dc Mon Sep 17 00:00:00 2001 From: Mirna Date: Thu, 29 Oct 2020 22:51:51 +0200 Subject: [PATCH] Removed Select syscalls, handled in the driver --- third_party/libtock-drivers/src/nfc.rs | 30 -------------------------- 1 file changed, 30 deletions(-) diff --git a/third_party/libtock-drivers/src/nfc.rs b/third_party/libtock-drivers/src/nfc.rs index 24ff50b..a67e944 100644 --- a/third_party/libtock-drivers/src/nfc.rs +++ b/third_party/libtock-drivers/src/nfc.rs @@ -12,14 +12,11 @@ mod command_nr { pub const RECEIVE: usize = 2; pub const EMULATE: usize = 3; pub const CONFIGURE: usize = 4; - pub const FRAMEDELAYMAX: usize = 5; - pub const SELECTED: usize = 6; } mod subscribe_nr { pub const TRANSMIT: usize = 1; pub const RECEIVE: usize = 2; - pub const SELECT: usize = 3; } mod allow_nr { @@ -54,38 +51,11 @@ impl NfcTag { syscalls::command(DRIVER_NUMBER, command_nr::EMULATE, enabled as usize, 0).is_ok() } - /// Subscribe to the tag being SELECTED callback. - pub fn selected() -> bool { - let is_selected = Cell::new(false); - let mut is_selected_alarm = || is_selected.set(true); - let subscription = syscalls::subscribe::( - DRIVER_NUMBER, - subscribe_nr::SELECT, - &mut is_selected_alarm, - ); - if subscription.is_err() { - return false; - } - - let result = syscalls::command(DRIVER_NUMBER, command_nr::SELECTED, 0, 0); - if result.is_err() { - return false; - } - - util::yieldk_for(|| is_selected.get()); - true - } - /// Configure the tag type command. pub fn configure(tag_type: u8) -> bool { syscalls::command(DRIVER_NUMBER, command_nr::CONFIGURE, tag_type as usize, 0).is_ok() } - /// Set the maximum frame delay value to support transmission with the reader. - pub fn set_framedelaymax(delay: u32) -> bool { - syscalls::command(DRIVER_NUMBER, command_nr::FRAMEDELAYMAX, delay as usize, 0).is_ok() - } - /// 1. Share with the driver a buffer. /// 2. Subscribe to having a successful receive callback. /// 3. Issue the request for reception.