mirror of
https://github.com/trussed-dev/pc-usbip-runner.git
synced 2026-06-20 04:16:19 -07:00
Merge pull request #16 from sosthene-nitrokey/parrallel-poll
Respond to USB in parrallel to application processing
This commit is contained in:
+16
-13
@@ -100,21 +100,24 @@ impl<S: StoreProvider + Clone> Runner<S> {
|
||||
);
|
||||
|
||||
log::info!("Ready for work");
|
||||
loop {
|
||||
thread::sleep(Duration::from_millis(5));
|
||||
|
||||
#[cfg(feature = "ctaphid")]
|
||||
apps.with_ctaphid_apps(|apps| ctaphid_dispatch.poll(apps));
|
||||
#[cfg(feature = "ccid")]
|
||||
apps.with_ccid_apps(|apps| apdu_dispatch.poll(apps));
|
||||
|
||||
usb_device.poll(&mut [
|
||||
thread::scope(|s| {
|
||||
s.spawn(move || loop {
|
||||
thread::sleep(Duration::from_millis(5));
|
||||
usb_device.poll(&mut [
|
||||
#[cfg(feature = "ctaphid")]
|
||||
&mut ctaphid,
|
||||
#[cfg(feature = "ccid")]
|
||||
&mut ccid,
|
||||
]);
|
||||
});
|
||||
loop {
|
||||
thread::sleep(Duration::from_millis(5));
|
||||
#[cfg(feature = "ctaphid")]
|
||||
&mut ctaphid,
|
||||
apps.with_ctaphid_apps(|apps| ctaphid_dispatch.poll(apps));
|
||||
#[cfg(feature = "ccid")]
|
||||
&mut ccid,
|
||||
]);
|
||||
}
|
||||
apps.with_ccid_apps(|apps| apdu_dispatch.poll(apps));
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user