mirror of
https://github.com/trussed-dev/usbd-ccid.git
synced 2026-06-20 04:16:20 -07:00
Simplify time handling, Solo 2
This commit is contained in:
committed by
Nicolas Stalder
parent
03de6cb83f
commit
54cf898d64
@@ -9,6 +9,7 @@ edition = "2018"
|
||||
[dependencies]
|
||||
apdu-dispatch = { git = "https://github.com/solokeys/apdu-dispatch", branch = "main" }
|
||||
delog = "0.1.0"
|
||||
embedded-time = "0.10.1"
|
||||
heapless = "0.6"
|
||||
heapless-bytes = "0.2.0"
|
||||
interchange = "0.2.0"
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
use core::convert::TryFrom;
|
||||
use core::time::Duration;
|
||||
|
||||
use embedded_time::duration::Extensions;
|
||||
use interchange::Requester;
|
||||
use apdu_dispatch::interchanges;
|
||||
|
||||
@@ -57,7 +57,7 @@ where
|
||||
pub fn did_start_processing(&mut self) -> Status {
|
||||
if self.pipe.did_started_processing() {
|
||||
// We should send a wait extension later
|
||||
Status::ReceivedData(Duration::from_millis(1000))
|
||||
Status::ReceivedData(1_000.milliseconds())
|
||||
} else {
|
||||
Status::Idle
|
||||
}
|
||||
@@ -66,7 +66,7 @@ where
|
||||
pub fn send_wait_extension (&mut self) -> Status {
|
||||
if self.pipe.send_wait_extension() {
|
||||
// We should send another wait extension later
|
||||
Status::ReceivedData(Duration::from_millis(1000))
|
||||
Status::ReceivedData(1_000.milliseconds())
|
||||
} else {
|
||||
Status::Idle
|
||||
}
|
||||
|
||||
+2
-3
@@ -1,5 +1,4 @@
|
||||
// use cortex_m_semihosting::hprintln;
|
||||
use core::time::Duration;
|
||||
use embedded_time::duration::Milliseconds;
|
||||
|
||||
// pub mod apdu;
|
||||
pub mod packet;
|
||||
@@ -16,7 +15,7 @@ pub enum ClassRequest {
|
||||
|
||||
pub enum Status {
|
||||
Idle,
|
||||
ReceivedData(Duration),
|
||||
ReceivedData(Milliseconds),
|
||||
}
|
||||
|
||||
impl core::convert::TryFrom<u8> for ClassRequest {
|
||||
|
||||
Reference in New Issue
Block a user